From 32e6c720c4f84f112596c6b4a75193f99e9be158 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 16 Apr 2019 09:53:19 +0200 Subject: 2019-04-16 09:02:00 --- tex/context/base/mkiv/font-dsp.lua | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'tex/context/base/mkiv/font-dsp.lua') diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 0645e7c8a..e6679fda2 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -1525,9 +1525,7 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly classdef1 = readclassdef(f,tableoffset+classdef1,coverage) classdef2 = readclassdef(f,tableoffset+classdef2,nofglyphs) local usedcoverage = { } - -- - local shared = { } -- partial sparse - -- + local shared = { } -- partial sparse, when set also needs to be handled in the packer for g1, c1 in next, classdef1 do if coverage[g1] then local l1 = classlist[c1] @@ -1539,21 +1537,21 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly local first = offsets[1] local second = offsets[2] if first or second then - -- - local s1 = shared[first] - if not s1 then - s1 = { } - shared[first] = s1 - end - local s2 = s1[second] - if not s2 then - s2 = { first, second or nil } - s1[second] = s2 + if shared then + local s1 = shared[first] + if s1 == nil then + s1 = { } + shared[first] = s1 + end + local s2 = s1[second] + if s2 == nil then + s2 = { first, second or nil } + s1[second] = s2 + end + hash[paired] = s2 + else + hash[paired] = { first, second or nil } end - hash[paired] = s2 - -- - -- hash[paired] = { first, second or nil } - -- else -- upto the next lookup for this combination end @@ -1564,6 +1562,7 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly end end return { + shared = shared and true or nil, format = "pair", coverage = usedcoverage, } -- cgit v1.2.3