pip install fontTools
pip install brotlicffi
(woff need use it)
Last active
June 21, 2021 08:24
-
-
Save CarsonSlovoka/c91df3517a4023e3cb5c6c093e27663e to your computer and use it in GitHub Desktop.
convert TTF to Woff, Woff2,...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fontTools.ttLib import TTFont, woff2 | |
from pathlib import Path | |
sourceTTF = Path('my.ttf') | |
targetFormat = 'woff' | |
f = TTFont(sourceTTF) | |
f.flavor = targetFormat | |
f.save(Path("temp") / Path(sourceTTF.stem + '.' + targetFormat)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment