Skip to content

Commit 3b88c96

Browse files
Bentonsky
authored andcommitted
Add making OTF into build pipeline
1 parent caf3e1a commit 3b88c96

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

script/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ if [ "${gen_glyphs_file_only}" -ne 0 ]; then
9494
exit 0
9595
fi
9696

97+
./build_otf.sh "${weights[@]}"
9798
./build_ttf.sh "${weights[@]}"
9899
./build_variable.sh
99100
./build_woff2.sh

script/build_otf.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -o errexit -o nounset -o pipefail
3+
cd "$(dirname "$0")/.."
4+
[ -d venv ] && source venv/bin/activate
5+
6+
family_name=${FIRACODE_FAMILY_NAME:-"Fira Code"}
7+
glyphs_file=${FIRACODE_GLYPHS_FILE:-"FiraCode.glyphs"}
8+
9+
dir="distr/otf/${family_name}"
10+
11+
mkdir -p "${dir}"
12+
rm -rf "${dir:?}/"*
13+
14+
args=( "$@" )
15+
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )
16+
weights=( "${args[@]:-"${default_weights[@]}"}" )
17+
18+
for weight in "${weights[@]}"; do
19+
file="${dir}/FiraCode-${weight}.otf"
20+
21+
echo "=============="
22+
echo
23+
echo " [i] Creating ${file}"
24+
echo
25+
26+
fontmake -g "${glyphs_file}" -o otf --output-path "${file}" -i ".* ${weight}"
27+
done

0 commit comments

Comments
 (0)