diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-08-15 09:54:36 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-08-15 09:54:36 +0200 |
commit | 36a37da721032b8d02fad41f22ad717ee8136f34 (patch) | |
tree | 6481c1e6fca21c63679c03ad66800d505334c7b8 /tex/context/base/mkiv/font-map.lua | |
parent | 1ef7a093aaf03b6327b3da94d47f53760c868c60 (diff) | |
download | context-36a37da721032b8d02fad41f22ad717ee8136f34.tar.gz |
2018-08-14 23:17:00
Diffstat (limited to 'tex/context/base/mkiv/font-map.lua')
-rw-r--r-- | tex/context/base/mkiv/font-map.lua | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua index 140702ec8..a7fbfe49e 100644 --- a/tex/context/base/mkiv/font-map.lua +++ b/tex/context/base/mkiv/font-map.lua @@ -214,7 +214,51 @@ local unknown = f_single(0xFFFD) -- end -- end -local hash = table.setmetatableindex(function(t,k) +-- local hash = table.setmetatableindex(function(t,k) +-- local v +-- if k >= 0x00E000 and k <= 0x00F8FF then +-- v = unknown +-- elseif k >= 0x0F0000 and k <= 0x0FFFFF then +-- v = unknown +-- elseif k >= 0x100000 and k <= 0x10FFFF then +-- v = unknown +-- elseif k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then +-- v = f_single(k) +-- else +-- k = k - 0x10000 +-- v = f_double(rshift(k,10)+0xD800,k%1024+0xDC00) +-- end +-- t[k] = v +-- return v +-- end) +-- +-- table.makeweak(hash) +-- +-- local function tounicode(unicode) +-- if type(unicode) == "table" then +-- local t = { } +-- for l=1,#unicode do +-- t[l] = hash[unicode[l]] +-- end +-- return concat(t) +-- else +-- return hash[unicode] +-- end +-- end + +local hash = { } +local conc = { } + +-- table.makeweak(hash) + +table.setmetatableindex(hash,function(t,k) + if type(k) == "table" then + local n = #k + for l=1,n do + conc[l] = hash[k[l]] + end + return concat(conc,"",1,n) + end local v if k >= 0x00E000 and k <= 0x00F8FF then v = unknown @@ -232,18 +276,8 @@ local hash = table.setmetatableindex(function(t,k) return v end) -table.makeweak(hash) - -local function tounicode(unicode,name) - if type(unicode) == "table" then - local t = { } - for l=1,#unicode do - t[l] = hash[unicode[l]] - end - return concat(t) - else - return hash[unicode] - end +local function tounicode(unicode) + return hash[unicode] end local function fromunicode16(str) |