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.
Part of https://github.com/behdad/fonttools/issues/73
diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py
index 7005c71..44d69c4 100644
--- a/Lib/fontTools/ttLib/tables/otTables.py
+++ b/Lib/fontTools/ttLib/tables/otTables.py
@@ -74,6 +74,7 @@
glyphs.extend(glyphOrder[glyphID] for glyphID in range(startID, endID))
else:
assert 0, "unknown format: %s" % self.Format
+ del self.Format # Don't need this anymore
def preWrite(self, font):
glyphs = getattr(self, "glyphs", None)
@@ -159,6 +160,7 @@
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)
@@ -263,6 +265,7 @@
else:
assert 0, "unknown format: %s" % self.Format
self.classDefs = classDefs
+ del self.Format # Don't need this anymore
def preWrite(self, font):
classDefs = getattr(self, "classDefs", None)
@@ -342,6 +345,7 @@
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
@@ -408,8 +412,10 @@
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
ligatures = getattr(self, "ligatures", None)
if ligatures is None:
ligatures = self.ligatures = {}