From e92a01a8876eb52c54d83d54323db89a2be097aa Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Sat, 23 May 2015 13:15:04 +0200 Subject: 2015-05-23 10:16:00 --- tex/generic/context/luatex/luatex-fonts-cbk.lua | 17 +++++++++++++---- tex/generic/context/luatex/luatex-fonts-merged.lua | 19 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-cbk.lua b/tex/generic/context/luatex/luatex-fonts-cbk.lua index 58162b4af..81b5b6e85 100644 --- a/tex/generic/context/luatex/luatex-fonts-cbk.lua +++ b/tex/generic/context/luatex/luatex-fonts-cbk.lua @@ -18,6 +18,7 @@ local nodes = nodes local traverse_id = node.traverse_id local free_node = node.free +local remove_node = node.remove local glyph_code = nodes.nodecodes.glyph local disc_code = nodes.nodecodes.disc @@ -60,6 +61,7 @@ function nodes.handlers.nodepass(head) local prevfont = nil local basefont = nil local variants = nil + local redundant = nil for n in traverse_id(glyph_code,head) do local font = n.font if font ~= prevfont then @@ -104,17 +106,24 @@ function nodes.handlers.nodepass(head) local variant = hash[p.char] if variant then p.char = variant - p.next = n.next - if n.next then - n.next.prev = p + if not redundant then + redundant = { n } + else + redundant[#redundant+1] = n end - node.free(n) end end end end end end + if redundant then + for i=1,#redundant do + local n = redundant[i] + remove_node(head,n) + free_node(n) + end + end for d in traverse_id(disc_code,head) do local r = d.replace if r then diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index c060dc304..fe61b3dcb 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/22/15 19:25:13 +-- merge date : 05/23/15 10:13:59 do -- begin closure to overcome local limits and interference @@ -15211,6 +15211,7 @@ local fonts=fonts local nodes=nodes local traverse_id=node.traverse_id local free_node=node.free +local remove_node=node.remove local glyph_code=nodes.nodecodes.glyph local disc_code=nodes.nodecodes.disc local ligaturing=node.ligaturing @@ -15241,6 +15242,7 @@ function nodes.handlers.nodepass(head) local prevfont=nil local basefont=nil local variants=nil + local redundant=nil for n in traverse_id(glyph_code,head) do local font=n.font if font~=prevfont then @@ -15285,17 +15287,24 @@ function nodes.handlers.nodepass(head) local variant=hash[p.char] if variant then p.char=variant - p.next=n.next - if n.next then - n.next.prev=p + if not redundant then + redundant={ n } + else + redundant[#redundant+1]=n end - node.free(n) end end end end end end + if redundant then + for i=1,#redundant do + local n=redundant[i] + remove_node(head,n) + free_node(n) + end + end for d in traverse_id(disc_code,head) do local r=d.replace if r then -- cgit v1.2.3