[varLib] Fix bug with recombining PairPosClass2 subtables that don't

Ouch.  I have no idea why I made two separate if's to begin with, but the
continue should have also been aligned with the inner block...

Fixes root cause of https://github.com/fonttools/fonttools/issues/914
but now we hit an unimplemented feature there...
This commit is contained in:
Behdad Esfahbod 2017-05-20 23:03:25 -07:00
parent 462b7f8683
commit 81498e5baf

View File

@ -581,13 +581,13 @@ def _Lookup_PairPos_subtables_canonicalize(lst, font):
for subtable in it:
oldtable = tail[-1]
if oldtable.Format == 2 and subtable.Format == 2:
if (oldtable.Class2Count == subtable.Class2Count and
oldtable.ClassDef2.classDefs == subtable.ClassDef2.classDefs and
oldtable.ValueFormat1 == subtable.ValueFormat1 and
oldtable.ValueFormat2 == subtable.ValueFormat2):
newtable = _Lookup_PairPosFormat2_subtables_recombine(oldtable, subtable, font)
tail[-1] = newtable
if (oldtable.Format == 2 and subtable.Format == 2 and
oldtable.Class2Count == subtable.Class2Count and
oldtable.ClassDef2.classDefs == subtable.ClassDef2.classDefs and
oldtable.ValueFormat1 == subtable.ValueFormat1 and
oldtable.ValueFormat2 == subtable.ValueFormat2):
newtable = _Lookup_PairPosFormat2_subtables_recombine(oldtable, subtable, font)
tail[-1] = newtable
continue
tail.append(subtable)