Allow specifying table type as converter
Needed for upcoming MATH table.
diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py
index 77f954c..cf4a662 100644
--- a/Lib/fontTools/ttLib/tables/otBase.py
+++ b/Lib/fontTools/ttLib/tables/otBase.py
@@ -627,8 +627,8 @@
def preWrite(self, font):
return self.__dict__.copy()
- def toXML(self, xmlWriter, font, attrs=None):
- tableName = self.__class__.__name__
+ def toXML(self, xmlWriter, font, attrs=None, name=None):
+ tableName = name if name else self.__class__.__name__
if attrs is None:
attrs = []
if hasattr(self, "Format"):
@@ -701,6 +701,9 @@
def writeFormat(self, writer):
writer.writeUShort(self.Format)
+ def toXML(self, xmlWriter, font, attrs=None, name=None):
+ BaseTable.toXML(self, xmlWriter, font, attrs, name=self.__class__.__name__)
+
#
# Support for ValueRecords