[woff2] Add fvar to glyf dependencies

Since the VarComposites added fvar to glyf dependencies in ttLib.

Add test for VarComposite to woff2 tests.
This commit is contained in:
Behdad Esfahbod 2023-01-31 12:46:17 -07:00
parent 7db21cd197
commit 6755acceee
2 changed files with 17 additions and 2 deletions

View File

@ -294,8 +294,9 @@ class WOFF2Writer(SFNTWriter):
if self.sfntVersion == "OTTO":
return
for tag in ("maxp", "head", "loca", "glyf"):
self._decompileTable(tag)
for tag in ("maxp", "head", "loca", "glyf", "fvar"):
if tag in self.tables:
self._decompileTable(tag)
self.ttFont["glyf"].padding = padding
for tag in ("glyf", "loca"):
self._compileTable(tag)

View File

@ -1491,6 +1491,20 @@ class UShort255Test(unittest.TestCase):
)
class VarCompositeTest(unittest.TestCase):
def test_var_composite(self):
input_path = os.path.join(data_dir, "varc-ac00-ac01.ttf")
ttf = ttLib.TTFont(input_path)
ttf.flavor = "woff2"
out = BytesIO()
ttf.save(out)
ttf = ttLib.TTFont(out)
ttf.flavor = None
out = BytesIO()
ttf.save(out)
if __name__ == "__main__":
import sys