summaryrefslogtreecommitdiff
path: root/misc/googlefonts/build.sh
blob: d46259a29b5a7961e6740ebfe1cc1cb8b6fef526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.ttf

# 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.ttf \
  -o build/googlefonts/Inter.var.ttf