Merge pull request #1236 from anthrotype/bad-classdef-fmt

Allow decompiling bad ClassDef tables with invalid format
This commit is contained in:
Cosimo Lupo 2018-04-16 13:55:47 +02:00 committed by GitHub
commit 63c86b4db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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):