summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-02 22:24:44 +0000
committerKarl Berry <karl@freefriends.org>2017-05-02 22:24:44 +0000
commitced65a4c1daa9985de131a295943b6568df35e43 (patch)
tree01115172f4197c33173dd19ab08eea84d56a415b /Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
parente836e85e085cd03de13f7f95250d8178b2b8ae18 (diff)
context/beta/cont-tmf.zip Apr 27 01:08
git-svn-id: svn://tug.org/texlive/trunk@44160 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua99
1 files changed, 59 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
index 1ea6a490822..d43348cdfb1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
@@ -889,7 +889,13 @@ local function readlookuparray(f,noflookups,nofcurrent)
if index > length then
length = index
end
- lookups[index] = readushort(f) + 1
+ local lookup = readushort(f) + 1
+ local list = lookups[index]
+ if list then
+ list[#list+1] = lookup
+ else
+ lookups[index] = { lookup }
+ end
end
for index=1,length do
if not lookups[index] then
@@ -2185,50 +2191,63 @@ do
report_issue(i,what,sequence,"empty")
rule.lookups = nil
else
- -- we can have holes in rlookups
+ -- we can have holes in rlookups flagged false and we can have multiple lookups
+ -- applied (first time seen in seguemj)
local length = #rlookups
for index=1,length do
- local lookupid = rlookups[index]
- if lookupid then
- local h = sublookuphash[lookupid]
- if not h then
- -- here we have a lookup that is used independent as well
- -- as in another one
- local lookup = lookups[lookupid]
- if lookup then
- local d = lookup.done
- if d then
- nofsublookups = nofsublookups + 1
- -- report("registering %i as sublookup %i",lookupid,nofsublookups)
- h = {
- index = nofsublookups, -- handy for tracing
- name = f_lookupname(lookupprefix,"d",lookupid+lookupidoffset),
- derived = true, -- handy for tracing
- steps = d.steps,
- nofsteps = d.nofsteps,
- type = d.lookuptype or "gsub_single", -- todo: check type
- markclass = d.markclass or nil,
- flags = d.flags,
- -- chain = d.chain,
- }
- sublookuplist[nofsublookups] = copy(h) -- we repack later
- sublookuphash[lookupid] = nofsublookups
- sublookupcheck[lookupid] = 1
- h = nofsublookups
+ local lookuplist = rlookups[index]
+ if lookuplist then
+ local length = #lookuplist
+ local found = { }
+ local noffound = 0
+ for index=1,length do
+ local lookupid = lookuplist[index]
+ if lookupid then
+ local h = sublookuphash[lookupid]
+ if not h then
+ -- here we have a lookup that is used independent as well
+ -- as in another one
+ local lookup = lookups[lookupid]
+ if lookup then
+ local d = lookup.done
+ if d then
+ nofsublookups = nofsublookups + 1
+ -- report("registering %i as sublookup %i",lookupid,nofsublookups)
+ h = {
+ index = nofsublookups, -- handy for tracing
+ name = f_lookupname(lookupprefix,"d",lookupid+lookupidoffset),
+ derived = true, -- handy for tracing
+ steps = d.steps,
+ nofsteps = d.nofsteps,
+ type = d.lookuptype or "gsub_single", -- todo: check type
+ markclass = d.markclass or nil,
+ flags = d.flags,
+ -- chain = d.chain,
+ }
+ sublookuplist[nofsublookups] = copy(h) -- we repack later
+ sublookuphash[lookupid] = nofsublookups
+ sublookupcheck[lookupid] = 1
+ h = nofsublookups
+ else
+ report_issue(i,what,sequence,"missing")
+ rule.lookups = nil
+ break
+ end
+ else
+ report_issue(i,what,sequence,"bad")
+ rule.lookups = nil
+ break
+ end
else
- report_issue(i,what,sequence,"missing")
- rule.lookups = nil
- break
+ sublookupcheck[lookupid] = sublookupcheck[lookupid] + 1
+ end
+ if h then
+ noffound = noffound + 1
+ found[noffound] = h
end
- else
- report_issue(i,what,sequence,"bad")
- rule.lookups = nil
- break
end
- else
- sublookupcheck[lookupid] = sublookupcheck[lookupid] + 1
end
- rlookups[index] = h or false
+ rlookups[index] = noffound > 0 and found or false
else
rlookups[index] = false
end
@@ -3388,7 +3407,7 @@ function readers.fvar(f,fontdata,specification)
default = readfixed(f), -- idem
maximum = readfixed(f), -- idem
flags = readushort(f),
- name = lower(extras[readushort(f)]),
+ name = lower(extras[readushort(f)] or "bad name"),
}
local n = sizeofaxis - 20
if n > 0 then