-
Notifications
You must be signed in to change notification settings - Fork 475
[ttLib] allow the glyf table to be incomplete when dumping to XML #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ttLib] allow the glyf table to be incomplete when dumping to XML #1681
Conversation
… from the glyph order) when writing to XML. Partially addresses fonttools#684.
hm.. instead of |
what happens when loading fromXML where not all glyphs from GlyphOrder are actually present in the glyf table dump? You end up with an incomplete glyf table? |
oh I see now, you want to support #684... |
Well, to some extent. It allows the font from #684 to be dumped, but not recompiled. I'm not sure we need to support either, actually. I was just thinking it doesn't harm us if we allow an incomplete glyf table to be dumped, even if it's broken according to the spec. |
ok. how about at least logging a warning for the missing glyphs? |
Good idea, done. Let me know if you want the warning to be worded differently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wording is ok
@@ -138,6 +138,10 @@ def toXML(self, writer, ttFont, splitGlyphs=False): | |||
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) | |||
log.warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a duplicate "log.warning"
Allow the glyf table to be incomplete — to not contain all glyphs listed in the glyph order — when writing to XML. Partially addresses #684.