-- (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
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
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
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)
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)
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)