diff options
Diffstat (limited to 'tex/context/base/mkiv/font-hsh.lua')
-rw-r--r-- | tex/context/base/mkiv/font-hsh.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/font-hsh.lua b/tex/context/base/mkiv/font-hsh.lua index 7e90e1502..89b0dc823 100644 --- a/tex/context/base/mkiv/font-hsh.lua +++ b/tex/context/base/mkiv/font-hsh.lua @@ -37,6 +37,7 @@ local italics = hashes.italics or allocate() local lastmathids = hashes.lastmathids or allocate() local dynamics = hashes.dynamics or allocate() local unicodes = hashes.unicodes or allocate() +local unislots = hashes.unislots or allocate() local originals = hashes.originals or allocate() local modes = hashes.modes or allocate() local variants = hashes.variants or allocate() @@ -59,12 +60,13 @@ hashes.italics = italics hashes.lastmathids = lastmathids hashes.dynamics = dynamics hashes.unicodes = unicodes +hashes.unislots = unislots hashes.originals = originals hashes.modes = modes hashes.variants = variants -local nodepool = nodes and nodes.pool -local dummyglyph = nodepool and nodepool.register(nodepool.glyph()) +local nodepool = nodes and nodes.pool +local dummyglyph = nodepool and nodepool.register(nodepool.glyph()) local nulldata = allocate { name = "nullfont", @@ -343,6 +345,22 @@ setmetatableindex(originals, function(t,k) -- always a unicode end end) +setmetatableindex(unislots, function(t,k) + if k == true then + return unislots[currentfont()] + else + local characters = identifiers[k].characters + local resolved = setmetatableindex(function(t,k) + local c = characters[k] + local v = c and c.unicode or 0xFFFD + t[k] = v + return v -- can be a table ! + end) + t[k] = resolved + return resolved + end +end) + setmetatableindex(modes, function(t,k) if k == true then return modes[currentfont()] |