Skip to content

Commit

Permalink
Merge pull request JetBrains#535 from naiyerasif/feat/vwebfonts
Browse files Browse the repository at this point in the history
Generate variable webfonts
  • Loading branch information
philippnurullin authored Jan 18, 2023
2 parents cd5227b + 7c4d534 commit 2a2595a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-fonts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gftools
gftools
fonttools[woff]
9 changes: 9 additions & 0 deletions scripts/generate_variable_webfonts.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 2a2595a

Please sign in to comment.