summaryrefslogtreecommitdiff
path: root/otfl-font-map.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-11-03 03:45:20 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-11-03 03:52:31 +0200
commit430e36b5a723b307678070fd5b8597ab7c57a935 (patch)
tree486f1ad2035cea6698c0c550790e87bcd5d3ff13 /otfl-font-map.lua
parentf089d7c2866791b5b48c07fe6a6c001727ca50c1 (diff)
downloadluaotfload-430e36b5a723b307678070fd5b8597ab7c57a935.tar.gz
Sync with context 2010.11.01
Not tested, yet.
Diffstat (limited to 'otfl-font-map.lua')
-rw-r--r--otfl-font-map.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/otfl-font-map.lua b/otfl-font-map.lua
index 46e84ad..569f3df 100644
--- a/otfl-font-map.lua
+++ b/otfl-font-map.lua
@@ -219,21 +219,23 @@ fonts.map.addtounicode = function(data,filename)
originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1
end
else
- local t = { }
+ local t, n = { }, 0
for l=1,nplit do
local base = split[l]
local u = unicodes[base] or (aglmap and aglmap[base])
if not u then
break
elseif type(u) == "table" then
- t[#t+1] = u[1]
+ n = n + 1
+ t[n] = u[1]
else
- t[#t+1] = u
+ n = n + 1
+ t[n] = u
end
end
- if #t == 0 then -- done then
+ if n == 0 then -- done then
-- nothing
- elseif #t == 1 then
+ elseif n == 1 then
originals[index], tounicode[index], nl, unicode = t[1], tounicode16(t[1]), nl + 1, true
else
originals[index], tounicode[index], nl, unicode = t, tounicode16sequence(t), nl + 1, true