summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-14 10:15:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-14 10:15:07 +0100
commitb0a00d3509297a53ffb5618cee122e1b1d995f42 (patch)
tree15a62bf4f76f3d9717eea2b81d56730b13879264 /tex/generic
parenteb827e1f7e0b7c69fb4f5ac106be63e346f06de5 (diff)
downloadcontext-b0a00d3509297a53ffb5618cee122e1b1d995f42.tar.gz
2016-01-14 09:57:00
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua34
1 files changed, 14 insertions, 20 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 5f138d407..c1e2902c6 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 01/13/16 15:10:24
+-- merge date : 01/14/16 09:55:22
do -- begin closure to overcome local limits and interference
@@ -5489,25 +5489,22 @@ end
local f_single=formatters["%04X"]
local f_double=formatters["%04X%04X"]
local function tounicode16(unicode,name)
- if unicode<0x10000 then
+ if unicode<0xD7FF or (unicode>0xDFFF and unicode<=0xFFFF) then
return f_single(unicode)
- elseif unicode<0x1FFFFFFFF then
- return f_double(floor(unicode/1024),unicode%1024+0xDC00)
else
- report_fonts("can't convert %a in %a into tounicode",unicode,name)
+ unicode=unicode-0x10000
+ return f_double(floor(unicode/1024)+0xD800,unicode%1024+0xDC00)
end
end
local function tounicode16sequence(unicodes,name)
local t={}
for l=1,#unicodes do
local u=unicodes[l]
- if u<0x10000 then
+ if u<0xD7FF or (u>0xDFFF and u<=0xFFFF) then
t[l]=f_single(u)
- elseif unicode<0x1FFFFFFFF then
- t[l]=f_double(floor(u/1024),u%1024+0xDC00)
else
- report_fonts ("can't convert %a in %a into tounicode",u,name)
- return
+ u=u-0x10000
+ t[l]=f_double(floor(u/1024)+0xD800,u%1024+0xDC00)
end
end
return concat(t)
@@ -5517,23 +5514,20 @@ local function tounicode(unicode,name)
local t={}
for l=1,#unicode do
local u=unicode[l]
- if u<0x10000 then
+ if u<0xD7FF or (u>0xDFFF and u<=0xFFFF) then
t[l]=f_single(u)
- elseif u<0x1FFFFFFFF then
- t[l]=f_double(floor(u/1024),u%1024+0xDC00)
else
- report_fonts ("can't convert %a in %a into tounicode",u,name)
- return
+ u=u-0x10000
+ t[l]=f_double(floor(u/1024)+0xD800,u%1024+0xDC00)
end
end
return concat(t)
else
- if unicode<0x10000 then
+ if unicode<0xD7FF or (unicode>0xDFFF and unicode<=0xFFFF) then
return f_single(unicode)
- elseif unicode<0x1FFFFFFFF then
- return f_double(floor(unicode/1024),unicode%1024+0xDC00)
else
- report_fonts("can't convert %a in %a into tounicode",unicode,name)
+ unicode=unicode-0x10000
+ return f_double(floor(unicode/1024)+0xD800,unicode%1024+0xDC00)
end
end
end
@@ -5542,7 +5536,7 @@ local function fromunicode16(str)
return tonumber(str,16)
else
local l,r=match(str,"(....)(....)")
- return (tonumber(l,16))*0x400+tonumber(r,16)-0xDC00
+ return 0x10000+(tonumber(l,16)-0xD800)*0x400+tonumber(r,16)-0xDC00
end
end
mappings.makenameparser=makenameparser