FiraCode/script/build_woff2.sh

28 wiersze
621 B
Bash

#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "$(dirname "$0")/.."
2020-06-17 20:06:57 +00:00
[ -d venv ] && source venv/bin/activate
family_name=${FIRACODE_FAMILY_NAME:-"Fira Code"}
ttf_dir="distr/ttf/${family_name}"
woff_dir="distr/woff2/${family_name}"
echo "=============="
echo
echo " [i] Creating .woff2 files!"
echo
mkdir -p "${woff_dir}"
rm -rf "${woff_dir:?}/"*
2020-06-08 14:10:00 +00:00
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
2020-04-09 16:56:19 +00:00
for ttf in "${ttf_dir}/"*.ttf; do
echo "woff2_compress ${ttf}"
woff2_compress "${ttf}"
2020-04-09 16:56:19 +00:00
done
mv "${ttf_dir}/"*.woff2 "${woff_dir}"
rm -f "${woff_dir}/FiraCode-Retina.woff2"