summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-dsp.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-07-27 17:53:52 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-07-27 17:53:52 +0200
commitab56ea38d2f4f5b521ef097bac92812f6070ef55 (patch)
treee5f2ba9e66f1b1ef8f7b32f91aed0d744a14a0da /tex/context/base/mkiv/font-dsp.lua
parentf7bfb1deb04d4ad101dbabf4d635d33cd98aa0a1 (diff)
downloadcontext-ab56ea38d2f4f5b521ef097bac92812f6070ef55.tar.gz
2017-07-27 16:23:00
Diffstat (limited to 'tex/context/base/mkiv/font-dsp.lua')
-rw-r--r--tex/context/base/mkiv/font-dsp.lua20
1 files changed, 17 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua
index 2d3dce2fb..afeeacb3f 100644
--- a/tex/context/base/mkiv/font-dsp.lua
+++ b/tex/context/base/mkiv/font-dsp.lua
@@ -1497,8 +1497,6 @@ 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.
--- !!!!! this needs checking: when both false, we have no hit so then we might need to fall through
-
function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
local tableoffset = lookupoffset + offset
setposition(f,tableoffset)
@@ -1511,6 +1509,7 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly
local sets = readarray(f)
sets = readpairsets(f,tableoffset,sets,format1,format2,mainoffset,getdelta)
coverage = readcoverage(f,tableoffset + coverage)
+ -- local allzero = 0
for index, newindex in next, coverage do
local set = sets[newindex+1]
local hash = { }
@@ -1520,15 +1519,22 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly
local other = value[1]
local first = value[2]
local second = value[3]
+ -- if first == true and second == true then
+ -- -- upto the next lookup for this combination
+ -- allzero = allzero + 1
+ -- end
if first or second then
hash[other] = { first, second or nil } -- needs checking
else
- hash[other] = nil
+ hash[other] = nil -- what if set, maybe warning
end
end
end
coverage[index] = hash
end
+ -- if allzero > 0 then
+ -- report("%s allzero pairs in %a positioning lookup %a subtype %a",allzero,"pair",lookupid,subtype)
+ -- end
return {
format = "pair",
coverage = coverage,
@@ -1546,6 +1552,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 allzero = 0
for g1, c1 in next, classdef1 do
if coverage[g1] then
local l1 = classlist[c1]
@@ -1556,6 +1563,10 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly
if offsets then
local first = offsets[1]
local second = offsets[2]
+ -- if first == true and second == true then
+ -- -- upto the next lookup for this combination
+ -- allzero = allzero + 1
+ -- end
if first or second then
hash[paired] = { first, second or nil }
else
@@ -1567,6 +1578,9 @@ function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofgly
end
end
end
+ -- if allzero > 0 then
+ -- report("%s allzero pairs in %a positioning lookup %a subtype %a",allzero,"pair",lookupid,subtype)
+ -- end
return {
format = "pair",
coverage = usedcoverage,