Allow decompiling bad ClassDef tables with invalid format

Fixes https://github.com/fonttools/fonttools/issues/1235
This commit is contained in:
Cosimo Lupo 2018-04-13 11:26:27 +02:00
parent c5c161c055
commit dde854d285
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -482,7 +482,7 @@ class Coverage(FormatSwitchingBaseTable):
glyphs.extend(glyphOrder[glyphID] for glyphID in range(startID, endID))
else:
self.glyphs = []
log.warning("Unknown Coverage format: %s" % self.Format)
log.warning("Unknown Coverage format: %s", self.Format)
def preWrite(self, font):
glyphs = getattr(self, "glyphs", None)
@ -830,7 +830,7 @@ class ClassDef(FormatSwitchingBaseTable):
if cls:
classDefs[glyphOrder[glyphID]] = cls
else:
assert 0, "unknown format: %s" % self.Format
log.warning("Unknown ClassDef format: %s", self.Format)
self.classDefs = classDefs
def _getClassRanges(self, font):