woff2: don't attempt to normalize glyf/loca if missing (e.g. CBDT/CBLC fonts like NotoColorEmoji.ttf)

This commit is contained in:
Cosimo Lupo 2020-02-26 18:14:31 +00:00
parent f20736690d
commit be147e965d
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642

View File

@ -226,7 +226,11 @@ class WOFF2Writer(SFNTWriter):
# See:
# https://github.com/khaledhosny/ots/issues/60
# https://github.com/google/woff2/issues/15
if isTrueType and "glyf" in self.flavorData.transformedTables:
if (
isTrueType
and "glyf" in self.flavorData.transformedTables
and "glyf" in self.tables
):
self._normaliseGlyfAndLoca(padding=4)
self._setHeadTransformFlag()