From 861d8aaa71392b99670ff380a8c08ffe34d5702e Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Sat, 1 Apr 2017 06:45:47 +0900 Subject: [PATCH] typo --- src/ltj-jfmglue.lua | 2 +- src/ltj-pretreat.lua | 15 +++++++++------ src/ltj-setwidth.lua | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ltj-jfmglue.lua b/src/ltj-jfmglue.lua index 21e323f..174e0aa 100644 --- a/src/ltj-jfmglue.lua +++ b/src/ltj-jfmglue.lua @@ -1006,7 +1006,7 @@ end -- (anything) .. (和文文字で始まる hlist) local function handle_np_ja_hlist() local qid = Nq.id - if qid==id_jglyph or ((qid==id_pbox or Nq.id == id_pbox_w) and Nq.met) then + if qid==id_jglyph or ((qid==id_pbox or qid == id_pbox_w) and Nq.met) then local g = non_ihb_flag and get_OB_skip(0) or get_kanjiskip() -- O_B->K handle_penalty_normal(Nq.post, 0, g); real_insert(g) elseif Nq.met then -- Nq.id==id_hlist diff --git a/src/ltj-pretreat.lua b/src/ltj-pretreat.lua index fa0573c..9ff46eb 100644 --- a/src/ltj-pretreat.lua +++ b/src/ltj-pretreat.lua @@ -102,7 +102,7 @@ do local pid = getid(p) while pid==id_glyph do local pc = getchar(p) - if (has_attr(p, attr_icflag) or 0)<=0 and is_ucs_in_japanese_char(p, pc) then + if has_attr(p, attr_icflag, 0) and is_ucs_in_japanese_char(p, pc) then setfont(p, ltjf_replace_altfont(has_attr(p, attr_curjfnt) or getfont(p), pc)) setlang(p, lang_ja) ltjs_orig_char_table[p] = pc @@ -130,8 +130,12 @@ local ltjf_font_metric_table = ltjf.font_metric_table local font_getfont = font.getfont local function set_box_stack_level(head, mode) local box_set, cl = 0, tex.currentgrouplevel + 1 - for _,p in pairs(wt) do - if mode and getfield(p, 'value')==cl then box_set = 1 end; node_free(p) + if mode then + for _,p in pairs(wt) do + if getfield(p, 'value')==cl then box_set = 1 end; node_free(p) + end + else + for _,p in pairs(wt) do node_free(p) end end ltjs_report_stack_level(tex_getcount('ltj@@stack') + box_set) for _,p in pairs(wtd) do @@ -139,9 +143,8 @@ local function set_box_stack_level(head, mode) end if ltjs.list_dir == dir_tate then for p in node.direct.traverse_id(id_glyph,to_direct(head)) do - if (has_attr(p, attr_icflag) or 0)<=0 and getlang(p)==lang_ja then - local pc = ltjs_orig_char_table[p] - local nf = ltjf_replace_altfont( has_attr(p, attr_curtfnt) or getfont(p) , pc) + if has_attr(p, attr_icflag, 0) and getlang(p)==lang_ja then + local nf = ltjf_replace_altfont( has_attr(p, attr_curtfnt) or getfont(p) , ltjs_orig_char_table[p]) setfont(p, nf) if ltjf_font_metric_table[nf].vert_activated then local pc = getchar(p) diff --git a/src/ltj-setwidth.lua b/src/ltj-setwidth.lua index c128888..56fa1c9 100644 --- a/src/ltj-setwidth.lua +++ b/src/ltj-setwidth.lua @@ -205,7 +205,7 @@ local function capsule_glyph_math(p, met, char_data) setfield(p, 'yoffset', -fshift.down) setfield(p, 'xoffset', getfield(p, 'xoffset') + char_data.align*(fwidth-pwidth) - fshift.left) local box = node_new(id_hlist); - setfield(box, fwidth, fheight, fdepth) + setwhd(box, fwidth, fheight, fdepth) setfield(box, 'head', p) setfield(box, 'shift', y_shift) setdir(box, tex.mathdir) @@ -258,7 +258,7 @@ do end if adj_depth>node_depth then local r = node_new(id_rule,rule_subtype) - setwhd(0, 0, adj_depth); setdir(r, tex_dir) + setwhd(r, 0, 0, adj_depth); setdir(r, tex_dir) set_attr(r, attr_icflag, PROCESSED) if field=='post' then node_insert_after(head, head, r) -- 2.11.0