diff --git a/sources/build.sh b/sources/build.sh new file mode 100644 index 0000000..f95d536 --- /dev/null +++ b/sources/build.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e +#source ../env/bin/activate + +echo "Build VF" + +gftools builder config.yaml + +echo "Remove italic instances in FVAR" + +python3 remove-FVAR-italics.py ../fonts/variable/HubotSans[slnt,wdth,wght].ttf + +echo "Complete" diff --git a/sources/config.yaml b/sources/config.yaml new file mode 100644 index 0000000..a1a0d0a --- /dev/null +++ b/sources/config.yaml @@ -0,0 +1,10 @@ +sources: + - HubotSans.glyphs +# buildOTF: False +# buildWebfont: False +# buildTTF: false +axisOrder: + - slnt + - wdth + - wght +familyName: "Hubot Sans" diff --git a/sources/remove-FVAR-italics.py b/sources/remove-FVAR-italics.py new file mode 100644 index 0000000..5e34ba3 --- /dev/null +++ b/sources/remove-FVAR-italics.py @@ -0,0 +1,18 @@ +from axisregistry import AxisRegistry +from fontTools.ttLib import TTFont +import sys +import copy + +registry = AxisRegistry() + +font = TTFont(sys.argv[-1]) + +allowed = [weight.name for weight in registry["wght"].fallback] + +for instance in copy.copy(font["fvar"].instances): + name = font["name"].getName(instance.subfamilyNameID, 3, 1, 1033).toUnicode() + print(name) + if name not in allowed: + font["fvar"].instances.remove(instance) + +font.save(sys.argv[-1]) \ No newline at end of file