forked from kalapi/OswaldFont
/
build.sh
49 lines (39 loc) · 1.04 KB
/
build.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
set -e
echo "Generating Static fonts"
mkdir -p ../fonts
fontmake -g Oswald.glyphs -i -o ttf --output-dir ../fonts/ttf/
fontmake -g Oswald.glyphs -i -o otf --output-dir ../fonts/otf/
fontmake -g Oswald_Heavy.glyphs -o ttf --output-dir ../fonts/ttf/
fontmake -g Oswald_Heavy.glyphs -o otf --output-dir ../fonts/ttf/
echo "Generating VFs"
fontmake -g Oswald.glyphs -o variable --output-path ../fonts/ttf/Oswald-VF.ttf
rm -rf master_ufo/ instance_ufo/
echo "Post processing"
ttfs=$(ls ../fonts/ttf/*.ttf)
for ttf in $ttfs
do
gftools fix-dsig -f $ttf;
./ttfautohint-vf $ttf "$ttf.fix";
mv "$ttf.fix" $ttf;
done
echo "Post processing VFs"
vfs=$(ls ../fonts/ttf/*-VF.ttf)
for vf in $vfs
do
gftools fix-dsig -f $vf;
./ttfautohint-vf --stem-width-mode nnn $vf "$vf.fix";
mv "$vf.fix" $vf;
done
echo "Fixing VF Meta"
gftools fix-vf-meta $vfs;
for vf in $vfs
do
mv "$vf.fix" $vf;
ttx -f -x "MVAR" $vf; # Drop MVAR. Table has issue in DW
rtrip=$(basename -s .ttf $vf)
new_file=../fonts/ttf/$rtrip.ttx;
rm $vf;
ttx $new_file
rm $new_file
done