Fix corrupt class-based pair kerning table merging

This commit is contained in:
Nikolaus Waxweiler 2019-06-12 14:00:54 +01:00
parent bcb0761202
commit f48051af23

View File

@ -2,6 +2,7 @@
Merge OpenType Layout tables (GDEF / GPOS / GSUB). Merge OpenType Layout tables (GDEF / GPOS / GSUB).
""" """
from __future__ import print_function, division, absolute_import from __future__ import print_function, division, absolute_import
import copy
from fontTools.misc.py23 import * from fontTools.misc.py23 import *
from fontTools.misc.fixedTools import otRound from fontTools.misc.fixedTools import otRound
from fontTools.misc import classifyTools from fontTools.misc import classifyTools
@ -455,7 +456,7 @@ def _PairPosFormat2_align_matrices(self, lst, font, transparent=False):
exemplarGlyph = next(iter(classSet)) exemplarGlyph = next(iter(classSet))
klass = classDef2.get(exemplarGlyph, 0) klass = classDef2.get(exemplarGlyph, 0)
rec2 = oldClass2Records[klass] rec2 = oldClass2Records[klass]
class2Records.append(rec2) class2Records.append(copy.deepcopy(rec2))
class1Records.append(rec1new) class1Records.append(rec1new)
new_matrices.append(class1Records) new_matrices.append(class1Records)
matrices = new_matrices matrices = new_matrices