summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-oup.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-07-17 01:36:30 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-07-17 01:36:30 +0200
commitf7bfb1deb04d4ad101dbabf4d635d33cd98aa0a1 (patch)
tree2ac61b4da45fc7f989154cd6a60fb075e6bee587 /tex/context/base/mkiv/font-oup.lua
parentf5566ab29fc08e71f6da12003ae49c48461bb70a (diff)
downloadcontext-f7bfb1deb04d4ad101dbabf4d635d33cd98aa0a1.tar.gz
2017-07-17 00:26:00
Diffstat (limited to 'tex/context/base/mkiv/font-oup.lua')
-rw-r--r--tex/context/base/mkiv/font-oup.lua50
1 files changed, 27 insertions, 23 deletions
diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua
index 9f4ded5b5..6084d1941 100644
--- a/tex/context/base/mkiv/font-oup.lua
+++ b/tex/context/base/mkiv/font-oup.lua
@@ -1376,7 +1376,7 @@ function readers.pack(data)
step.coverage = pack_normal(c)
else
for g1, d1 in next, c do
- if d1 ~= true then
+ if d1 and d1 ~= true then
c[g1] = pack_indexed(d1)
end
end
@@ -2383,6 +2383,32 @@ function readers.compact(data)
end
end
+local function mergesteps(t,k)
+ if k == "merged" then
+ local merged = { }
+ for i=1,#t do
+ local step = t[i]
+ local coverage = step.coverage
+ for k in next, coverage do
+ local m = merged[k]
+ if m then
+ m[2] = i
+ -- m[#m+1] = step
+ else
+ merged[k] = { i, i }
+ -- merged[k] = { step }
+ end
+ end
+ end
+ t.merged = merged
+ return merged
+ end
+end
+
+if fonts.helpers then
+ fonts.helpers.mergesteps = mergesteps
+end
+
function readers.expand(data)
if not data or data.expanded then
return
@@ -2429,28 +2455,6 @@ function readers.expand(data)
-- about 15% on arabtype .. then moving the a test also saves a bit (even when
-- often a is not set at all so that one is a bit debatable
- local function mergesteps(t,k)
- if k == "merged" then
- local merged = { }
- for i=1,#t do
- local step = t[i]
- local coverage = step.coverage
- for k in next, coverage do
- local m = merged[k]
- if m then
- m[2] = i
- -- m[#m+1] = step
- else
- merged[k] = { i, i }
- -- merged[k] = { step }
- end
- end
- end
- t.merged = merged
- return merged
- end
- end
-
local function expandlookups(sequences)
if sequences then
-- we also need to do sublookups