diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-25 15:40:51 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-25 15:40:51 +0200 |
commit | b2a2304cbb0c65040d7b118ac9b857d304e333e6 (patch) | |
tree | ed5212e37a91ec78c12d9f72ca1186a59c139b40 /tex/context/base/mkiv/node-fnt.lua | |
parent | b2276ae7a04a9f9c35403e508670049d8c3e4b3e (diff) | |
download | context-b2a2304cbb0c65040d7b118ac9b857d304e333e6.tar.gz |
2016-06-25 14:42:00
Diffstat (limited to 'tex/context/base/mkiv/node-fnt.lua')
-rw-r--r-- | tex/context/base/mkiv/node-fnt.lua | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua index c130f86ca..84c45d4b0 100644 --- a/tex/context/base/mkiv/node-fnt.lua +++ b/tex/context/base/mkiv/node-fnt.lua @@ -166,17 +166,17 @@ function handlers.characters(head) -- either next or not, but definitely no already processed list starttiming(nodes) - local usedfonts = { } - local attrfonts = { } - local basefonts = { } - local a, u, b = 0, 0, 0 - local basefont = nil - local prevfont = nil - local prevattr = 0 - local mode = nil - local done = false - local variants = nil - local redundant = nil + local usedfonts = { } + local attrfonts = { } + local basefonts = { } + local a, u, b, r = 0, 0, 0, 0 + local basefont = nil + local prevfont = nil + local prevattr = 0 + local mode = nil + local done = false + local variants = nil + local redundant = nil if trace_fontrun then run = run + 1 @@ -213,6 +213,7 @@ function handlers.characters(head) variants = fontvariants[font] if mode == "none" then -- skip + -- variants = false protect_glyph(n) else if basefont then @@ -231,7 +232,7 @@ function handlers.characters(head) a = a + 1 elseif force_basepass then b = b + 1 - basefont = { n, nil } + basefont = { n, false } basefonts[b] = basefont end end @@ -244,7 +245,7 @@ function handlers.characters(head) u = u + 1 elseif force_basepass then b = b + 1 - basefont = { n, nil } + basefont = { n, false } basefonts[b] = basefont end end @@ -265,19 +266,23 @@ function handlers.characters(head) report_fonts("replacing %C by %C",char,variant) end setchar(p,variant) - if not redundant then - redundant = { n } + if redundant then + r = r + 1 + redundant[r] = n else - redundant[#redundant+1] = n + r = 1 + redundant = { n } end end end elseif keep_redundant then -- go on, can be used for tracing - elseif not redundant then - redundant = { n } + elseif redundant then + r = r + 1 + redundant[r] = n else - redundant[#redundant+1] = n + r = 1 + redundant = { n } end end end @@ -292,8 +297,10 @@ function handlers.characters(head) for b in traverse_id(boundary_code,nuthead) do if getsubtype(b) == word_boundary then if redundant then - redundant[#redundant+1] = b + r = r + 1 + redundant[r] = b else + r = 1 redundant = { b } end end @@ -302,7 +309,7 @@ function handlers.characters(head) end if redundant then - for i=1,#redundant do + for i=1,r do local r = redundant[i] local p, n = getboth(r) if r == nuthead then |