diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/node-fnt.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/node-fnt.lua | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/context/base/node-fnt.lua b/Master/texmf-dist/tex/context/base/node-fnt.lua index 66cd9916fe5..54359117e81 100644 --- a/Master/texmf-dist/tex/context/base/node-fnt.lua +++ b/Master/texmf-dist/tex/context/base/node-fnt.lua @@ -3,7 +3,7 @@ if not modules then modules = { } end modules ['node-fnt'] = { comment = "companion to font-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" + license = "see context related readme files", } if not context then os.exit() end -- generic function in node-dum @@ -24,7 +24,6 @@ local fontdata = fonthashes.identifiers local otf = fonts.handlers.otf local traverse_id = node.traverse_id -local has_attribute = node.has_attribute local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming local nodecodes = nodes.nodecodes @@ -41,7 +40,7 @@ local setmetatableindex = table.setmetatableindex -- potential speedup: check for subtype < 256 so that we can remove that test -- elsewhere, danger: injected nodes will not be dealt with but that does not --- happen often; we could consider processing sublists but that might need mor +-- happen often; we could consider processing sublists but that might need more -- checking later on; the current approach also permits variants local run = 0 @@ -85,9 +84,10 @@ function handlers.characters(head) report_fonts() local n = head while n do - if n.id == glyph_code then + local id = n.id + if id == glyph_code then local font = n.font - local attr = has_attribute(n,0) or 0 + local attr = n[0] or 0 report_fonts("font %03i, dynamic %03i, glyph %s",font,attr,utf.char(n.char)) else report_fonts("[%s]",nodecodes[n.id]) @@ -96,9 +96,9 @@ function handlers.characters(head) end end for n in traverse_id(glyph_code,head) do --- if n.subtype<256 then + -- if n.subtype<256 then -- all are 1 local font = n.font - local attr = has_attribute(n,0) or 0 -- zero attribute is reserved for fonts in context + local attr = n[0] or 0 -- zero attribute is reserved for fonts in context if font ~= prevfont or attr ~= prevattr then if attr > 0 then local used = attrfonts[font] @@ -133,7 +133,7 @@ function handlers.characters(head) prevfont = font prevattr = attr end --- end + -- end end if trace_fontrun then report_fonts() @@ -141,8 +141,9 @@ function handlers.characters(head) report_fonts("dynamics: %s",(a > 0 and concat(keys(attrfonts)," ")) or "none") report_fonts() end - -- we could combine these and just make the attribute nil - if u == 1 then + if u == 0 then + -- skip + elseif u == 1 then local font, processors = next(usedfonts) local n = #processors if n > 0 then @@ -157,7 +158,7 @@ function handlers.characters(head) end end end - elseif u > 0 then + else for font, processors in next, usedfonts do local n = #processors local h, d = processors[1](head,font,0) @@ -172,7 +173,9 @@ function handlers.characters(head) end end end - if a == 1 then + if a == 0 then + -- skip + elseif a == 1 then local font, dynamics = next(attrfonts) for attribute, processors in next, dynamics do -- attr can switch in between local n = #processors @@ -191,7 +194,7 @@ function handlers.characters(head) end end end - elseif a > 0 then + else for font, dynamics in next, attrfonts do for attribute, processors in next, dynamics do -- attr can switch in between local n = #processors |