2021-11-09 12:02:47 -06:00
|
|
|
#!/usr/bin/env bash
|
2022-08-12 13:37:15 -05:00
|
|
|
set -e
|
2021-11-09 12:02:47 -06:00
|
|
|
|
|
|
|
exts=(otf ttf woff woff2)
|
|
|
|
ext=$1
|
|
|
|
shift
|
|
|
|
fp_args=$@
|
|
|
|
|
2022-03-02 13:36:54 -06:00
|
|
|
if [[ -z $ext ]]; then
|
2021-11-09 12:02:47 -06:00
|
|
|
echo "please provide an extension"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! " ${exts[@]} " =~ " ${ext} " ]]; then
|
|
|
|
echo "$ext is not a valid extension"
|
|
|
|
echo "Please choose one of the below:"
|
|
|
|
printf '%s\n' "${exts[@]}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Patching all fonts with ext -> $ext"
|
|
|
|
echo "Using the following arguments for font-patcher $fp_args"
|
|
|
|
|
|
|
|
for fontfile in MonoLisa/$ext/*.$ext; do
|
|
|
|
|
2022-08-12 13:37:15 -05:00
|
|
|
fontforge -script ./bin/font-patcher $fontfile --glyphdir ./src/glyphs/ -o ./patched/$ext $fp_args
|
2021-11-09 12:02:47 -06:00
|
|
|
|
|
|
|
done
|