summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-ini.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-11-04 21:21:43 +0200
committerMarius <mariausol@gmail.com>2013-11-04 21:21:43 +0200
commit40cef722559ffbe3c6ca930f0212f2038eb99d32 (patch)
tree138729b3625932209f5ae600958af6237334cb41 /tex/context/base/lpdf-ini.lua
parentd767ce40051233332a45103bfbd6cae977d1b411 (diff)
downloadcontext-40cef722559ffbe3c6ca930f0212f2038eb99d32.tar.gz
beta 2013.11.04 20:03
Diffstat (limited to 'tex/context/base/lpdf-ini.lua')
-rw-r--r--tex/context/base/lpdf-ini.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/tex/context/base/lpdf-ini.lua b/tex/context/base/lpdf-ini.lua
index cd601f21f..23fe6c177 100644
--- a/tex/context/base/lpdf-ini.lua
+++ b/tex/context/base/lpdf-ini.lua
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['lpdf-ini'] = {
local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset
local char, byte, format, gsub, concat, match, sub, gmatch = string.char, string.byte, string.format, string.gsub, table.concat, string.match, string.sub, string.gmatch
local utfchar, utfvalues = utf.char, utf.values
-local sind, cosd = math.sind, math.cosd
+local sind, cosd, floor = math.sind, math.cosd, math.floor
local lpegmatch, P, C, R, S, Cc, Cs = lpeg.match, lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs
local formatters = string.formatters
@@ -49,7 +49,8 @@ local function tosixteen(str) -- an lpeg might be faster (no table)
if b < 0x10000 then
r[n] = format("%04x",b)
else
- r[n] = format("%04x%04x",b/1024+0xD800,b%1024+0xDC00)
+ -- r[n] = format("%04x%04x",b/1024+0xD800,b%1024+0xDC00)
+ r[n] = format("%04x%04x",floor(b/1024),b%1024+0xDC00)
end
end
n = n + 1