2019-03-26 11:06:24 +13:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source venv/bin/activate
|
|
|
|
|
|
|
|
# variable font
|
2019-04-03 10:48:33 +13:00
|
|
|
fontmake -g FiraCode.glyphs -o variable --output-dir distr/variable_ttf
|
2019-03-26 11:06:24 +13:00
|
|
|
|
2019-04-03 09:43:19 +13:00
|
|
|
# statics
|
2019-04-03 10:48:33 +13:00
|
|
|
fontmake -g FiraCode.glyphs -o ttf --output-dir distr/ttf
|
|
|
|
fontmake -g FiraCode.glyphs -o otf --output-dir distr/otf
|
2019-03-26 11:06:24 +13:00
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
# Autohinting ================================================================
|
|
|
|
|
|
|
|
statics=$(ls distr/ttf/*.ttf)
|
|
|
|
for file in $statics; do
|
|
|
|
echo "fix DSIG in " ${file}
|
|
|
|
gftools fix-dsig --autofix ${file}
|
|
|
|
|
|
|
|
echo "TTFautohint " ${file}
|
|
|
|
# autohint with detailed info
|
|
|
|
hintedFile=${file/".ttf"/"-hinted.ttf"}
|
|
|
|
ttfautohint -I ${file} ${hintedFile} --stem-width-mode nnn
|
|
|
|
cp ${hintedFile} ${file}
|
|
|
|
rm -rf ${hintedFile}
|
2019-04-03 09:43:19 +13:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
# Build woff2 fonts ==========================================================
|
|
|
|
|
|
|
|
# requires https://github.com/google/woff2
|
|
|
|
|
|
|
|
rm -rf distr/woff2
|
|
|
|
|
|
|
|
ttfs=$(ls distr/*/*.ttf)
|
|
|
|
for ttf in $ttfs; do
|
|
|
|
woff2_compress $ttf
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p distr/woff2
|
|
|
|
woff2s=$(ls distr/*/*.woff2)
|
|
|
|
for woff2 in $woff2s; do
|
|
|
|
mv $woff2 distr/woff2/$(basename $woff2)
|
2019-03-26 11:06:24 +13:00
|
|
|
done
|