From: Hironori Kitagawa Date: Wed, 30 Sep 2015 04:25:10 +0000 (+0900) Subject: Fix a bug in ltj-adjust.lua X-Git-Tag: 20151025.0~10 X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=fc4b29c6ec1742c8cdbf46e804baf98d91c68ca3;p=luatex-ja%2Fluatexja.git Fix a bug in ltj-adjust.lua --- diff --git a/src/ltj-adjust.lua b/src/ltj-adjust.lua index 1bceda3..84f75b9 100644 --- a/src/ltj-adjust.lua +++ b/src/ltj-adjust.lua @@ -107,6 +107,9 @@ local function get_total_stretched(p, line) local total = 0 for q in node_traverse_id(id_glue, getlist(p)) do local a, ic = get_stretched(q, go, gs), get_attr_icflag(q) + if ic == KANJI_SKIP_JFM then ic = KANJI_SKIP + elseif ic == XKANJI_SKIP_JFM then ic = XKANJI_SKIP + end if type(res[ic]) == 'number' then -- kanjiskip, xkanjiskip は段落内で spec を共有しているが, -- それはここでは望ましくないので,各 glue ごとに異なる spec を使う. @@ -124,8 +127,6 @@ local function get_total_stretched(p, line) gs_used_line[qs] = line end end - elseif ic == KANJI_SKIP_JFM then ic = KANJI_SKIP - elseif ic == XKANJI_SKIP_JFM then ic = XKANJI_SKIP end res[ic], total = res[ic] + a, total + a else @@ -137,7 +138,9 @@ end local function clear_stretch(p, ic, name) for q in node_traverse_id(id_glue, getlist(p)) do - if get_attr_icflag(q) == ic then + local f = get_attr_icflag(q) + if (f == ic) or ((ic ==KANJI_SKIP) and (f == KANJI_SKIP_JFM)) + or ((ic ==XKANJI_SKIP) and (f == XKANJI_SKIP_JFM)) then local qs = getfield(q, 'spec') if getfield(qs, 'writable') then setfield(qs, name..'_order', 0)