diff --git a/Lib/fontTools/ttLib/tables/otConverters.py b/Lib/fontTools/ttLib/tables/otConverters.py index d6ac46107..d2b01bde1 100644 --- a/Lib/fontTools/ttLib/tables/otConverters.py +++ b/Lib/fontTools/ttLib/tables/otConverters.py @@ -191,7 +191,7 @@ class Struct(BaseConverter): # If there are attributes (probably index), then # don't drop this even if it's NULL. It will mess # up the array indices of the containing element. - xmlWriter.simpletag(name, attrs + [("empty", True)]) + xmlWriter.simpletag(name, attrs + [("empty", 1)]) xmlWriter.newline() else: pass # NULL table, ignore @@ -199,9 +199,9 @@ class Struct(BaseConverter): value.toXML(xmlWriter, font, attrs, name=name) def xmlRead(self, attrs, content, font): - table = self.tableClass() - if attrs.get("empty"): + if "empty" in attrs and safeEval(attrs["empty"]): return None + table = self.tableClass() Format = attrs.get("Format") if Format is not None: table.Format = int(Format)