diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-01 09:51:54 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-01 09:51:54 +0200 |
commit | 756fc2f88430875cf623babb1623bd39cb195e4f (patch) | |
tree | 5deac5266d13551e009c0eb640d5ebe0fd6dcf8a /tex/context/base/mkiv/font-otc.lua | |
parent | 0720a3fd156076fc3092927feb0fa0a85122ec6d (diff) | |
download | context-756fc2f88430875cf623babb1623bd39cb195e4f.tar.gz |
2016-04-30 23:55:00
Diffstat (limited to 'tex/context/base/mkiv/font-otc.lua')
-rw-r--r-- | tex/context/base/mkiv/font-otc.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua index d4c98d6fc..871b6f13c 100644 --- a/tex/context/base/mkiv/font-otc.lua +++ b/tex/context/base/mkiv/font-otc.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['font-otc'] = { local format, insert, sortedkeys, tohash = string.format, table.insert, table.sortedkeys, table.tohash local type, next = type, next local lpegmatch = lpeg.match -local utfbyte = utf.byte +local utfbyte, utflen = utf.byte, utf.len -- we assume that the other otf stuff is loaded already @@ -68,6 +68,8 @@ local function addfeature(data,feature,specifications) local splitter = lpeg.splitter(" ",unicodes) local done = 0 local skip = 0 + local aglunicodes = false + if not specifications[1] then -- so we accept a one entry specification specifications = { specifications } @@ -76,11 +78,24 @@ local function addfeature(data,feature,specifications) local function tounicode(code) if not code then return - elseif type(code) == "number" then + end + if type(code) == "number" then return code - else - return unicodes[code] or utfbyte(code) end + local u = unicodes[code] + if u then + return u + end + if utflen(code) == 1 then + u = utfbyte(code) + if u then + return u + end + end + if not aglunicodes then + aglunicodes = fonts.encodings.agl.unicodes -- delayed + end + return aglunicodes[code] end local coverup = otf.coverup |