diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-01 22:54:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-01 22:54:03 +0000 |
commit | 71774e4fd4b0773da3641446dad4d62e15615a60 (patch) | |
tree | 9269923ee159b1aeafb0258ef352510a76bad6c8 /Master/texmf-dist/tex/context/base/mkiv/font-otc.lua | |
parent | b87702fb17fe8db3fca90083c7b5bc5ffd065d60 (diff) |
context (30apr16)
git-svn-id: svn://tug.org/texlive/trunk@40821 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/font-otc.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/font-otc.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua index d4c98d6fcc5..871b6f13c97 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua +++ b/Master/texmf-dist/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 |