From dde854d285360bb3173f0fda9cea284a9d2f1f22 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 13 Apr 2018 11:26:27 +0200 Subject: [PATCH] Allow decompiling bad ClassDef tables with invalid format Fixes https://github.com/fonttools/fonttools/issues/1235 --- Lib/fontTools/ttLib/tables/otTables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index 170e567fb..d00c23361 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -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):