diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-04-16 09:53:19 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-04-16 09:53:19 +0200 |
commit | 32e6c720c4f84f112596c6b4a75193f99e9be158 (patch) | |
tree | 9a673cc26aa02f8a9e74d18fc821fb5f3cda5380 /tex/context/base/mkiv/font-oup.lua | |
parent | ba81502d685bdba367e2a8f0bdff0f8ecc0cf7f6 (diff) | |
download | context-32e6c720c4f84f112596c6b4a75193f99e9be158.tar.gz |
2019-04-16 09:02:00
Diffstat (limited to 'tex/context/base/mkiv/font-oup.lua')
-rw-r--r-- | tex/context/base/mkiv/font-oup.lua | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua index d1faadbf7..51b1c248f 100644 --- a/tex/context/base/mkiv/font-oup.lua +++ b/tex/context/base/mkiv/font-oup.lua @@ -1573,16 +1573,34 @@ function readers.pack(data) if kind == "gpos_pair" then local c = step.coverage if c then - if step.format == "pair" then + if step.format ~= "pair" then + for g1, d1 in next, c do + c[g1] = pack_normal(d1) + end + elseif step.shared then + -- This branch results from classes. We already share at the reader end. Maybe + -- the sharing should be moved there altogether but it becomes kind of messy + -- then. Here we're still wasting time because in the second pass we serialize + -- and hash. So we compromise. We could merge the two passes ... + local shared = { } for g1, d1 in next, c do for g2, d2 in next, d1 do - local f = d2[1] if f and f ~= true then d2[1] = pack_indexed(f) end - local s = d2[2] if s and s ~= true then d2[2] = pack_indexed(s) end + if not shared[d2] then + local f = d2[1] if f and f ~= true then d2[1] = pack_indexed(f) end + local s = d2[2] if s and s ~= true then d2[2] = pack_indexed(s) end + shared[d2] = true + end end end + if pass == 2 then + step.shared = nil -- weird, so dups + end else for g1, d1 in next, c do - c[g1] = pack_normal(d1) + for g2, d2 in next, d1 do + local f = d2[1] if f and f ~= true then d2[1] = pack_indexed(f) end + local s = d2[2] if s and s ~= true then d2[2] = pack_indexed(s) end + end end end end |