From 10fe1c26369e65209c4297f4559298f828d2cb08 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Dec 2013 03:06:10 -0500 Subject: [PATCH] Don't write Format for Coverage, ClassDef, Single/Alternate/LigatureSubst The format values for those are automatically handled in postRead/preWrite to choose optimal format. As such, don't write them in XML. Reduces noise. https://github.com/fonttools/fonttools/pull/2236#issuecomment-804523961 --- Lib/fontTools/ttLib/tables/otTables.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index a65ec7b87..c88bfc7a0 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -558,6 +558,7 @@ class Coverage(FormatSwitchingBaseTable): else: self.glyphs = [] log.warning("Unknown Coverage format: %s", self.Format) + del self.Format # Don't need this anymore def preWrite(self, font): glyphs = getattr(self, "glyphs", None) @@ -739,6 +740,7 @@ class SingleSubst(FormatSwitchingBaseTable): else: assert 0, "unknown format: %s" % self.Format self.mapping = mapping + del self.Format # Don't need this anymore def preWrite(self, font): mapping = getattr(self, "mapping", None) @@ -927,6 +929,7 @@ class ClassDef(FormatSwitchingBaseTable): else: log.warning("Unknown ClassDef format: %s", self.Format) self.classDefs = classDefs + del self.Format # Don't need this anymore def _getClassRanges(self, font): classDefs = getattr(self, "classDefs", None) @@ -1015,6 +1018,7 @@ class AlternateSubst(FormatSwitchingBaseTable): else: assert 0, "unknown format: %s" % self.Format self.alternates = alternates + del self.Format # Don't need this anymore def preWrite(self, font): self.Format = 1 @@ -1085,6 +1089,7 @@ class LigatureSubst(FormatSwitchingBaseTable): else: assert 0, "unknown format: %s" % self.Format self.ligatures = ligatures + del self.Format # Don't need this anymore def preWrite(self, font): self.Format = 1