diff --git a/Lib/fontTools/otlLib/builder.py b/Lib/fontTools/otlLib/builder.py index 5a1379f5e..f95fdfd5c 100644 --- a/Lib/fontTools/otlLib/builder.py +++ b/Lib/fontTools/otlLib/builder.py @@ -2190,8 +2190,8 @@ def buildPairPosGlyphsSubtable(pairs, glyphMap, valueFormat1=None, valueFormat2= for glyph2, val1, val2 in sorted(p[glyph], key=lambda x: glyphMap[x[0]]): pvr = ot.PairValueRecord() pvr.SecondGlyph = glyph2 - pvr.Value1 = val1 if valueFormat1 else None - pvr.Value2 = val2 if valueFormat2 else None + pvr.Value1 = ValueRecord(src=val1, valueFormat=valueFormat1) if valueFormat1 else None + pvr.Value2 = ValueRecord(src=val2, valueFormat=valueFormat2) if valueFormat2 else None ps.PairValueRecord.append(pvr) ps.PairValueCount = len(ps.PairValueRecord) self.PairSetCount = len(self.PairSet) diff --git a/Tests/otlLib/builder_test.py b/Tests/otlLib/builder_test.py index 797f15953..2d2b88d80 100644 --- a/Tests/otlLib/builder_test.py +++ b/Tests/otlLib/builder_test.py @@ -922,6 +922,7 @@ class BuilderTest(object): }, self.GLYPHMAP, ) + assert getXML(subtable.toXML) == [ '', " ", @@ -935,11 +936,12 @@ class BuilderTest(object): " ", ' ', ' ', - ' ', + ' ', ' ', " ", ' ', ' ', + ' ', ' ', " ", " ",