Implement script to generate variable webfonts

This commit is contained in:
Naiyer Asif 2022-03-26 13:07:14 +05:30 committed by GitHub
parent 908603ca44
commit bb8a9cd188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,8 @@
import glob
import os
from fontTools.ttLib import TTFont
for filepath in glob.iglob('fonts/variable/*.ttf'):
f = TTFont(filepath)
f.flavor = 'woff2'
f.save(os.path.splitext(filepath)[0] + '.woff2')