diff options
Diffstat (limited to 'tex/context/base/node-fnt.lua')
-rw-r--r-- | tex/context/base/node-fnt.lua | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/tex/context/base/node-fnt.lua b/tex/context/base/node-fnt.lua index 336164c48..93b467f52 100644 --- a/tex/context/base/node-fnt.lua +++ b/tex/context/base/node-fnt.lua @@ -13,11 +13,11 @@ local concat, keys = table.concat, table.keys local nodes, node, fonts = nodes, node, fonts -local trace_characters = false trackers .register("nodes.characters", function(v) trace_characters = v end) -local trace_fontrun = false trackers .register("nodes.fontrun", function(v) trace_fontrun = v end) +local trace_characters = false trackers .register("nodes.characters", function(v) trace_characters = v end) +local trace_fontrun = false trackers .register("nodes.fontrun", function(v) trace_fontrun = v end) -local force_discrun = true directives.register("nodes.discrun", function(v) force_discrun = v end) -local force_basepass = true directives.register("nodes.basepass", function(v) force_basepass = v end) +local force_discrun = true directives.register("nodes.discrun", function(v) force_discrun = v end) +local force_basepass = true directives.register("nodes.basepass", function(v) force_basepass = v end) local report_fonts = logs.reporter("fonts","processing") @@ -126,6 +126,18 @@ fonts.hashes.processes = fontprocesses local ligaturing = node.ligaturing local kerning = node.kerning +local expanders + +function fonts.setdiscexpansion(v) + if v == nil or v == true then + expanders = languages and languages.expanders + elseif type(v) == "table" then + expanders = v + else + expanders = false + end +end + function handlers.characters(head) -- either next or not, but definitely no already processed list starttiming(nodes) @@ -239,6 +251,8 @@ function handlers.characters(head) -- could be an optional pass : seldom needed, only for documentation as a discretionary -- with pre/post/replace will normally not occur on it's own + local e = 0 + if force_discrun then -- basefont is not supported in disc only runs ... it would mean a lot of @@ -286,6 +300,14 @@ function handlers.characters(head) end break end + elseif expanders then + local subtype = getsubtype(d) + if subtype == discretionary_code then + -- already done when replace + else + expanders[subtype](d) + e = e + 1 + end end end @@ -296,6 +318,9 @@ function handlers.characters(head) report_fonts("statics : %s",u > 0 and concat(keys(usedfonts)," ") or "none") report_fonts("dynamics: %s",a > 0 and concat(keys(attrfonts)," ") or "none") report_fonts("built-in: %s",b > 0 and b or "none") + if expanders then + report_fonts("expanded: %s",e > 0 and e or "none") + end report_fonts() end -- in context we always have at least 2 processors |