diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-10-17 15:43:08 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-10-17 15:43:08 +0200 |
commit | e5f189d9965a70c8f3043c07c7b07d41ef268e93 (patch) | |
tree | ea192c431e2762fbae01fdd44cb3a48278b06fc0 /tex/context/base/mkiv/font-otc.lua | |
parent | 9f36318b0e571bcbc93dc2112d01bbf2178ed020 (diff) | |
download | context-e5f189d9965a70c8f3043c07c7b07d41ef268e93.tar.gz |
2018-10-17 15:14:00
Diffstat (limited to 'tex/context/base/mkiv/font-otc.lua')
-rw-r--r-- | tex/context/base/mkiv/font-otc.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua index c2e89599a..595778e34 100644 --- a/tex/context/base/mkiv/font-otc.lua +++ b/tex/context/base/mkiv/font-otc.lua @@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['font-otc'] = { } local insert, sortedkeys, sortedhash, tohash = table.insert, table.sortedkeys, table.sortedhash, table.tohash -local type, next = type, next +local type, next, tonumber = type, next, tonumber local lpegmatch = lpeg.match local utfbyte, utflen = utf.byte, utf.len local sortedhash = table.sortedhash @@ -174,6 +174,10 @@ local function addfeature(data,feature,specifications) return end + local p = lpeg.P("P") + * (lpeg.patterns.hexdigit^1/function(s) return tonumber(s,16) end) + * lpeg.P(-1) + local function tounicode(code) if not code then return @@ -183,6 +187,7 @@ local function addfeature(data,feature,specifications) end local u = unicodes[code] if u then + -- unicodes[code] = u return u end if utflen(code) == 1 then @@ -191,10 +196,19 @@ local function addfeature(data,feature,specifications) return u end end + local u = lpegmatch(p,code) + if u then + -- unicodes[code] = u + return u + end if not aglunicodes then aglunicodes = fonts.encodings.agl.unicodes -- delayed end - return aglunicodes[code] + local u = aglunicodes[code] + if u then + -- unicodes[code] = u + return u + end end local coverup = otf.coverup |