diff options
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-cbk.lua | 17 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 19 |
2 files changed, 27 insertions, 9 deletions
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 |