- if type(res[ic]) == 'number' then
- -- kanjiskip, xkanjiskip は段落内で spec を共有しているが,
- -- それはここでは望ましくないので,各 glue ごとに異なる spec を使う.
- -- 本当は各行ごとに glue_spec を共有させたかったが,安直にやると
- -- ref_count が 0 なので Double-free が発生する.どうする?
- -- JFM グルーはそれぞれ異なる glue_spec を用いているので,問題ない.
- if (ic == KANJI_SKIP or ic == XKANJI_SKIP) and getsubtype(q)==0 then
- local qs = getfield(q, 'spec')
- if qs ~= spec_zero_glue then
- if (gs_used_line[qs] or 0)<line then
- setfield(q, 'spec', node_copy(qs))
- local f = node_new(id_glue); setfield(f, 'spec', qs); node_free(f)
- -- decrese qs's reference count
- else
- gs_used_line[qs] = line
- end
- end
- end
- res[ic], total = res[ic] + a, total + a
- else
- res[0], total = res[0] + a, total + a
+ 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