- local a, ic = get_stretched(q, go, gs), get_attr_icflag(q)
- if type(res[ic]) == 'number' then
- -- kanjiskip, xkanjiskip は段落内で spec を共有しているが,
- -- それはここでは望ましくないので,各 glue ごとに異なる spec を使う.
- -- (この仮定でメモリリークを起こしている!)
- -- JFM グルーはそれぞれ異なる glue_spec を用いているので,問題ない.
- res[ic] = res[ic] + a
- if (ic == KANJI_SKIP or ic == XKANJI_SKIP) and getsubtype(q)==0 then
- local qs = getfield(q, 'spec')
- if is_skip_normal[ic] and qs ~= spec_zero_glue then
- setfield(q, 'spec', node_copy(qs))
- end
- end
- else
- res[0] = res[0] + a
+ local a = getfield(q, 'stretch_order')
+ if a>0 then a=a*65536 else
+ total_st[0] = total_st[0]+getfield(q, 'stretch')
+ a = get_attr_icflag(q)
+ if a == KANJI_SKIP_JFM then a = KANJI_SKIP
+ elseif a == XKANJI_SKIP_JFM then a = XKANJI_SKIP
+ elseif type(total_st[a])~='number' then a = -1 end
+ end
+ total_st[a] = total_st[a]+getfield(q, 'stretch')
+ local a = getfield(q, 'shrink_order')
+ if a>0 then a=a*65536 else
+ total_sh[0] = total_sh[0]+getfield(q, 'shrink')
+ a = get_attr_icflag(q)
+ if a == KANJI_SKIP_JFM then a = KANJI_SKIP
+ elseif a == XKANJI_SKIP_JFM then a = XKANJI_SKIP
+ elseif type(total_sh[a])~='number' then a = -1 end