summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2019-10-24 04:45:22 +0300
committerRasmus Andersson <rasmus@notion.se>2019-10-24 04:45:22 +0300
commit067b9689a3f2110f5279caa8c595668b094fa911 (patch)
tree494156a9a4f24e78bac3633559e433a0c30e50fc
parent0ea81677797e2f4df5e514b791c96feb40318756 (diff)
downloadinter-067b9689a3f2110f5279caa8c595668b094fa911.tar.xz
adds googlefonts build script (WIP)
-rwxr-xr-xmisc/googlefonts/build.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/misc/googlefonts/build.sh b/misc/googlefonts/build.sh
new file mode 100755
index 000000000..cfee2f49f
--- /dev/null
+++ b/misc/googlefonts/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -e
+cd "$(dirname $0)"
+# GFDIR=$PWD # may be useful to save path to the misc/googlefonts-qa directory.
+# move to repository root directory
+cd ../..
+
+# parse CLI options
+CLEAN=false
+if [[ "$1" == "-h"* ]] || [[ "$1" == "--h"* ]]; then
+ echo "usage: $0 [--clean | --help]"
+ echo "--clean Clean \"from scratch\" build. Clears any previous build products."
+ exit
+elif [[ "$1" == "--clean" ]]; then
+ CLEAN=true ; shift
+fi
+
+# make sure that make and venv is up-to-date
+./init.sh
+source init.sh
+
+# make sure there are no left-over build products
+if $CLEAN; then
+ make clean >/dev/null
+fi
+
+# compile multi-axis variable font
+make build/fonts/var/Inter.var.otf
+
+# change file type to TTF and change style names to Google Fonts standard.
+rm -rf build/googlefonts
+mkdir -p build/googlefonts
+misc/fontbuild rename --google-style \
+ build/fonts/var/Inter.var.otf \
+ -o build/googlefonts/Inter.var.ttf