Sanity-check ValueRecord fields

This commit is contained in:
Behdad Esfahbod 2015-12-08 22:22:33 +01:00
parent e717b1f157
commit 941d735760

View File

@ -9,7 +9,7 @@
from __future__ import print_function, division, absolute_import from __future__ import print_function, division, absolute_import
from fontTools import ttLib from fontTools import ttLib
from fontTools.ttLib.tables import otTables as ot from fontTools.ttLib.tables import otTables as ot
from fontTools.ttLib.tables.otBase import ValueRecord from fontTools.ttLib.tables.otBase import ValueRecord, valueRecordFormatDict
import re import re
debug = print debug = print
@ -149,6 +149,7 @@ def parseSinglePos(self, lines, font):
for line in lines: for line in lines:
assert len(line) == 3, line assert len(line) == 3, line
w = line[0].title().replace(' ', '') w = line[0].title().replace(' ', '')
assert w in valueRecordFormatDict
g = parseGlyph(line[1]) g = parseGlyph(line[1])
v = int(line[2]) v = int(line[2])
if g not in values: if g not in values: