2021-08-09 03:26:47 +03:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
2020-06-08 02:04:36 +03:00
|
|
|
|
cd "`dirname $0`/.."
|
2020-06-17 23:06:57 +03:00
|
|
|
|
[ -d venv ] && source venv/bin/activate
|
2021-08-09 03:26:47 +03:00
|
|
|
|
mkdir -p distr/variable_ttf
|
|
|
|
|
rm -rf distr/variable_ttf/*
|
2020-06-08 17:10:00 +03:00
|
|
|
|
|
2020-06-08 02:04:36 +03:00
|
|
|
|
FILE=FiraCode-VF.ttf
|
2020-04-09 19:56:19 +03:00
|
|
|
|
|
2021-08-09 03:26:47 +03:00
|
|
|
|
awk '/name = Retina;/ { print; print "exports = 0;"; next }1' FiraCode.glyphs > FiraCode_VF.glyphs
|
|
|
|
|
fontmake -g FiraCode_VF.glyphs -o variable --output-dir distr/variable_ttf
|
|
|
|
|
rm FiraCode_VF.glyphs
|
2020-06-08 02:04:36 +03:00
|
|
|
|
|
2021-08-09 03:26:47 +03:00
|
|
|
|
pushd distr/variable_ttf
|
2020-04-09 19:56:19 +03:00
|
|
|
|
|
|
|
|
|
# fix variable font metadata – very important
|
2020-06-08 02:04:36 +03:00
|
|
|
|
gftools fix-vf-meta $FILE
|
|
|
|
|
mv $FILE.fix $FILE
|
2020-04-09 19:56:19 +03:00
|
|
|
|
|
|
|
|
|
# other fixes for metadata and hinting
|
2020-06-08 02:04:36 +03:00
|
|
|
|
gftools fix-nonhinting $FILE $FILE.fix
|
|
|
|
|
mv $FILE.fix $FILE
|
|
|
|
|
|
|
|
|
|
gftools fix-gasp --autofix $FILE
|
|
|
|
|
mv $FILE.fix $FILE
|
|
|
|
|
|
|
|
|
|
gftools fix-dsig --autofix $FILE
|
2020-04-09 19:56:19 +03:00
|
|
|
|
|
|
|
|
|
# cleanup of temp files
|
2020-06-08 02:04:36 +03:00
|
|
|
|
rm -rf *-gasp.ttf
|
2020-04-09 19:56:19 +03:00
|
|
|
|
|
|
|
|
|
# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)
|
2021-08-09 03:26:47 +03:00
|
|
|
|
|
|
|
|
|
popd
|