diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua index e7f483642e5..51b1c248f87 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua @@ -1466,7 +1466,9 @@ function readers.pack(data) end return false elseif nt >= threshold then - local one, two, rest = 0, 0, 0 + local one = 0 + local two = 0 + local rest = 0 if pass == 1 then for k,v in next, c do if v == 1 then @@ -1571,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 |