woff2_test: add test with CBDT/CBLC font without glyf/loca tables

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

View File

@ -1199,6 +1199,24 @@ class WOFF2RoundtripTest(object):
assert tmp.getvalue() == tmp2.getvalue()
assert ttFont2.reader.flavorData.transformedTables == {"hmtx"}
def test_roundtrip_no_glyf_and_loca_tables(self):
ttx = os.path.join(
os.path.dirname(current_dir), "subset", "data", "google_color.ttx"
)
ttFont = ttLib.TTFont()
ttFont.importXML(ttx)
assert "glyf" not in ttFont
assert "loca" not in ttFont
ttFont.flavor = "woff2"
tmp = BytesIO()
ttFont.save(tmp)
tmp2, ttFont2 = self.roundtrip(tmp)
assert tmp.getvalue() == tmp2.getvalue()
assert ttFont.flavor == "woff2"
class MainTest(object):