diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-10-02 23:41:59 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-10-02 23:41:59 +0200 |
commit | 551c89289d267c2d8901f3375e57ed1fe2508de5 (patch) | |
tree | 937be4d873b1762d93fcce75ecca3cfea07b2ca4 /tex/context/base/mkiv/font-ctx.lua | |
parent | e3ad6b783e6162de6dad5531299e69c3d3079b9c (diff) | |
download | context-551c89289d267c2d8901f3375e57ed1fe2508de5.tar.gz |
2018-10-02 23:25:00
Diffstat (limited to 'tex/context/base/mkiv/font-ctx.lua')
-rw-r--r-- | tex/context/base/mkiv/font-ctx.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index 37ce96ee8..73d39d036 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -1903,7 +1903,11 @@ implement { -- => commands -local function nametoslot(name) +local pattern = P("P") + * (lpeg.patterns.hexdigit^4 / function(s) return tonumber(s,16) end) + * P(-1) + +local function nametoslot(name) -- also supports PXXXXX (4+ positions) local t = type(name) if t == "string" then local unic = unicodes[true] @@ -1924,7 +1928,11 @@ local function nametoslot(name) end local char = characters[true] local slot = aglunicodes[name] - if char[slot] then + if slot and char[slot] then + return slot + end + local slot = lpegmatch(pattern,name) + if slot and char[slot] then return slot end -- not in font |