From a5867a77a11af6061a2bd2e539dbf61fb18e77cb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 8 Aug 2020 22:18:16 +0000 Subject: luatexja (9aug20) git-svn-id: svn://tug.org/texlive/trunk@56076 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luatexja/ltj-direction.lua | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua') diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua index 523397d804c..4c6c3b6bd7a 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua @@ -900,8 +900,7 @@ do local sd = to_direct(s) local box_dir = get_box_dir(sd, dir_yoko) if box_dir%dir_math_mod ~= list_dir then - setbox( - 'ltj@afbox', + setbox('ltj@afbox', to_node(copy_list(make_dir_whatsit(sd, sd, list_dir, 'box_move'))) -- copy_list しないとリストの整合性が崩れる……? ) @@ -1059,8 +1058,7 @@ do local finalize_inner local function finalize_dir_node(db,new_dir) local b = getlist(db) - if getid(b)==id_whatsit and getsubtype(b)==sid_user - and getfield(b, 'user_id')==DIR then + while b and ((getid(b)~=id_hlist) and (getid(b)~=id_vlist)) do local ob = b; b = node_remove(b,b); setfield(db, 'head', b); node_free(ob) end @@ -1115,19 +1113,21 @@ do end end end - local getbox = tex.getbox + local getbox, shipout = tex.getbox, tex.shipout local setbox, copy = node.direct.setbox, node.direct.copy - local lua_mem_kb = 0 - function luatexja.direction.finalize() - local a = to_direct(tex.getbox("AtBeginShipoutBox")) + local afbox + function luatexja.direction.shipout() + start_time_measure 'box_primitive_hook' + if (not afbox) and luatexja.afbox_number then afbox = luatexja.afbox_number end + local a = to_direct(getbox 'ltj@afbox') local a_dir = get_box_dir(a, dir_yoko) if a_dir~=dir_yoko then local b = create_dir_node(a, a_dir, dir_yoko, false) setfield(b, 'head', a); a = b end - setfield(shipout_temp, 'head', a) - finalize_inner(shipout_temp) - setbox('global', "AtBeginShipoutBox", copy(getlist(shipout_temp))) - setfield(shipout_temp, 'head',nil) + setfield(shipout_temp, 'head', a); finalize_inner(shipout_temp) + setbox(afbox, copy(getlist(shipout_temp))); setfield(shipout_temp, 'head',nil) + shipout(afbox) + stop_time_measure 'box_primitive_hook' end end -- cgit v1.2.3