How to translate the ttf to woff ?

44 views
Skip to first unread message

so菲玛索

unread,
Oct 29, 2021, 1:50:47 AM10/29/21
to fonttools
I want to know whether the library have the feature which be able to tranlate ttf to woff.
If  have this function, please tell me how to use it or the address of relevant documents. I will thank you very much for your answer.

so菲玛索

unread,
Oct 29, 2021, 2:40:51 AM10/29/21
to fonttools
I have find the soultion form  fonts fonttools将ttf转换为woff2 - 糯米PHP (nuomiphp.com)

$ python
 >>> from fontTools.ttLib import TTFont 
>>> f = TTFont('path/to/your/file.otf') 
>>> f.flavor='woff2' 
>>> f.save('path/to/your/file.woff2')
Reply all
Reply to author
Forward
0 new messages