1
0
Fork 0
mirror of synced 2024-06-26 10:10:35 +12:00
FiraCode/script/build_variable.sh

34 lines
827 B
Bash
Raw Normal View History

#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`/.."
2020-06-18 08:06:57 +12:00
[ -d venv ] && source venv/bin/activate
mkdir -p distr/variable_ttf
rm -rf distr/variable_ttf/*
2020-06-09 02:10:00 +12:00
FILE=FiraCode-VF.ttf
2020-04-10 04:56:19 +12: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
pushd distr/variable_ttf
2020-04-10 04:56:19 +12:00
# fix variable font metadata very important
gftools fix-vf-meta $FILE
mv $FILE.fix $FILE
2020-04-10 04:56:19 +12:00
# other fixes for metadata and hinting
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-10 04:56:19 +12:00
# cleanup of temp files
rm -rf *-gasp.ttf
2020-04-10 04:56:19 +12:00
# TODO (late 2019?): use TTFautohint-VF for variable font (current support is minimal)
popd