forked from JetBrains/JetBrainsMono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-vf.sh
executable file
·48 lines (38 loc) · 1.12 KB
/
build-vf.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
[ -r env/bin/activate ] && . env/bin/activate
set -e
thisFont="JetBrainsMono" #must match the name in the font file
VF_DIR=./fonts/variable
#Generating fonts ==========================================================
#Requires fontmake https://github.com/googlefonts/fontmake
echo "CLEAN FONTS FOLDERS"
rm -rf $VF_DIR
mkdir -p $VF_DIR
echo ".
GENERATING VARIABLE
."
fontmake -g ./sources/$thisFont.glyphs -o variable --output-path $VF_DIR/$thisFont[wght].ttf
fontmake -g ./sources/$thisFont-Italic.glyphs -o variable --output-path $VF_DIR/$thisFont-Italic[wght].ttf
#Post-processing fonts ======================================================
#Requires gftools https://github.com/googlefonts/gftools
echo ".
POST-PROCESSING VF
."
vfs=$(ls $VF_DIR/*.ttf)
for font in $vfs
do
gftools fix-dsig --autofix $font
gftools fix-nonhinting $font $font.fix
mv $font.fix $font
gftools fix-unwanted-tables --tables MVAR $font
done
rm $VF_DIR/*gasp*
gftools fix-vf-meta $VF_DIR/$thisFont[wght].ttf $VF_DIR/$thisFont-Italic[wght].ttf
for font in $vfs
do
mv $font.fix $font
done
rm -rf ./master_ufo/ ./instance_ufo/
echo ".
COMPLETE!
."