ソースコードの管理場所
Revision | 46958c57fc2c9b941e4638a7472e0fa2917334d2 (tree) |
---|---|
Time | 2014-10-07 13:41:15 |
Author | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
Backported commits 36ad2f96 and 98cb5558
@@ -553,6 +553,7 @@ end | ||
553 | 553 | ------------------------------------------------------------------------ |
554 | 554 | |
555 | 555 | local is_ucs_in_japanese_char = ltjc.is_ucs_in_japanese_char_direct |
556 | +local font = font | |
556 | 557 | -- EXT: italic correction |
557 | 558 | function append_italic() |
558 | 559 | local p = to_direct(tex.nest[tex.nest.ptr].tail) |
@@ -566,7 +567,7 @@ function append_italic() | ||
566 | 567 | local j = font_metric_table[f] |
567 | 568 | setfield(g, 'kern', j.char_type[find_char_class(getchar(p), j)].italic) |
568 | 569 | else |
569 | - local h = font_getfont(f) | |
570 | + local h = font_getfont(f) or font.fonts[f] | |
570 | 571 | if h then |
571 | 572 | setfield(g, 'kern', h.characters[getchar(p)].italic) |
572 | 573 | else |
@@ -42,6 +42,7 @@ local is_ucs_in_japanese_char = ltjc.is_ucs_in_japanese_char_direct | ||
42 | 42 | local ltjf_replace_altfont = ltjf.replace_altfont |
43 | 43 | local attr_orig_char = luatexbase.attributes['ltj@origchar'] |
44 | 44 | local STCK = luatexja.userid_table.STCK |
45 | +local lang_ja = token.create('ltj@japanese')[2] | |
45 | 46 | |
46 | 47 | ------------------------------------------------------------------------ |
47 | 48 | -- MAIN PROCESS STEP 1: replace fonts |
@@ -56,7 +57,8 @@ do | ||
56 | 57 | local pc = getchar(p) |
57 | 58 | local pf = ltjf_replace_altfont(has_attr(p, attr_curjfnt) or getfont(p), pc) |
58 | 59 | setfield(p, 'font', pf); set_attr(p, attr_curjfnt, pf) |
59 | - setfield(p, 'subtype', floor(getsubtype(p)*0.5)*2) | |
60 | + setfield(p, 'lang', lang_ja) | |
61 | + -- setfield(p, 'subtype', floor(getsubtype(p)*0.5)*2) | |
60 | 62 | set_attr(p, attr_orig_char, pc) |
61 | 63 | end |
62 | 64 | return p |
@@ -74,8 +76,7 @@ do | ||
74 | 76 | wt, head = {}, p |
75 | 77 | while p do |
76 | 78 | local pfunc = suppress_hyphenate_ja_aux[getid(p)] |
77 | - if pfunc then p = pfunc(p) end | |
78 | - p = node_next(p) | |
79 | + p = node_next(pfunc and pfunc(p) or p) | |
79 | 80 | end |
80 | 81 | head = to_node(head) |
81 | 82 | lang.hyphenate(head) |
@@ -143,6 +143,7 @@ | ||
143 | 143 | \newluatexattribute\ltj@yablshift % attribute for \yabaselineshift |
144 | 144 | \newluatexattribute\ltj@ykblshift % attribute for \ykbaselineshift |
145 | 145 | \newluatexattribute\jfam % index for current jfam |
146 | +\newlanguage\ltj@@japanese | |
146 | 147 | \ltj@icflag=0 |
147 | 148 | \ltj@origchar=0 |
148 | 149 | \ltj@charclass=0 |