From 171f7b525a5f7ddfb1631501cbc2d09722de4018 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 12 Apr 2019 18:03:49 +0200 Subject: 2019-04-12 17:51:00 --- tex/context/base/mkiv/font-dsp.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (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 f8bf6f2c8..3285c689c 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -1473,6 +1473,11 @@ end -- ValueFormat1 applies to the ValueRecord of the first glyph in each pair. ValueRecords for all first glyphs must use ValueFormat1. If ValueFormat1 is set to zero (0), the corresponding glyph has no ValueRecord and, therefore, should not be repositioned. -- ValueFormat2 applies to the ValueRecord of the second glyph in each pair. ValueRecords for all second glyphs must use ValueFormat2. If ValueFormat2 is set to null, then the second glyph of the pair is the “next” glyph for which a lookup should be performed. +-- local simple = { +-- [true] = { [true] = { true, true }, [false] = { true } }, +-- [false] = { [true] = { false, true }, [false] = { false } }, +-- } + function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs) local tableoffset = lookupoffset + offset setposition(f,tableoffset) @@ -1520,6 +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 for g1, c1 in next, classdef1 do if coverage[g1] then local l1 = classlist[c1] @@ -1531,7 +1537,18 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly local first = offsets[1] local second = offsets[2] if first or second then - hash[paired] = { first, second or nil } +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 +end +hash[paired] = s2 +-- hash[paired] = { first, second or nil } else -- upto the next lookup for this combination end -- cgit v1.2.3