[ttLib] allow the glyf table to be incomplete when dumping to XML (#1681)

[ttLib] Allow the glyf table to be incomplete (to not contain everything from the glyph order) when writing to XML. This partially addresses #684 in that it will allow the font Ambrosia.otb to be dumped with ttx (but not recompiled). Log a warning when a glyph is not present.
This commit is contained in:
Just van Rossum 2019-08-15 18:46:14 +02:00 committed by GitHub
parent 848b37c48a
commit 0ea19f3bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,6 +137,9 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
path, ext = os.path.splitext(writer.file.name)
existingGlyphFiles = set()
for glyphName in glyphNames:
if glyphName not in self:
log.warning("glyph '%s' does not exist in glyf table", glyphName)
continue
glyph = self[glyphName]
if glyph.numberOfContours:
if splitGlyphs: