Skip to content

Commit

Permalink
Add making OTF into build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben authored and tonsky committed Oct 21, 2024
1 parent caf3e1a commit 3b88c96
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ if [ "${gen_glyphs_file_only}" -ne 0 ]; then
exit 0
fi

./build_otf.sh "${weights[@]}"
./build_ttf.sh "${weights[@]}"
./build_variable.sh
./build_woff2.sh
Expand Down
27 changes: 27 additions & 0 deletions script/build_otf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "$(dirname "$0")/.."
[ -d venv ] && source venv/bin/activate

family_name=${FIRACODE_FAMILY_NAME:-"Fira Code"}
glyphs_file=${FIRACODE_GLYPHS_FILE:-"FiraCode.glyphs"}

dir="distr/otf/${family_name}"

mkdir -p "${dir}"
rm -rf "${dir:?}/"*

args=( "$@" )
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
weights=( "${args[@]:-"${default_weights[@]}"}" )

for weight in "${weights[@]}"; do
file="${dir}/FiraCode-${weight}.otf"

echo "=============="
echo
echo " [i] Creating ${file}"
echo

fontmake -g "${glyphs_file}" -o otf --output-path "${file}" -i ".* ${weight}"
done

0 comments on commit 3b88c96

Please sign in to comment.