Merge pull request #535 from naiyerasif/feat/vwebfonts

Generate variable webfonts
This commit is contained in:
philippnurullin 2023-01-18 11:08:59 +01:00 committed by GitHub
commit 2a2595ada7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -38,7 +38,9 @@ jobs:
update-wheel: "true"
update-setuptools: "true"
- name: Build fonts
run: gftools builder sources/config.yaml
run: |
gftools builder sources/config.yaml
python scripts/generate_variable_webfonts.py
- name: Upload Fonts
uses: actions/upload-artifact@v3
with:

View File

@ -1 +1,2 @@
gftools
gftools
fonttools[woff]

View File

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