1
1
mirror of https://github.com/i-tu/Hasklig.git synced 2024-09-11 02:25:46 +03:00
Hasklig/build.sh

54 lines
1.2 KiB
Bash
Raw Normal View History

#!/usr/bin/env sh
set -e
2020-12-22 22:08:57 +03:00
family=Hasklig
2019-06-10 08:36:44 +03:00
roman_weights=(Black Bold ExtraLight Light Medium Regular Semibold)
italic_weights=(BlackIt BoldIt ExtraLightIt LightIt MediumIt It SemiboldIt)
# get absolute path to bash script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# clean existing build artifacts
rm -rf $DIR/target/
2019-06-10 08:36:44 +03:00
otf_dir="$DIR/target/OTF"
ttf_dir="$DIR/target/TTF"
mkdir -p $otf_dir $ttf_dir
2019-06-10 08:36:44 +03:00
function build_font {
# $1 is Roman or Italic
# $2 is weight name
font_dir=$DIR/$1/Instances/$2
font_ufo=$font_dir/font.ufo
2019-06-10 08:36:44 +03:00
ps_name=$family-$2
echo $ps_name
echo "Building OTF ..."
# -r is for "release mode" (subroutinization + applied glyph order)
# -gs is for filtering the output font to contain only glyphs in the GOADB
makeotf -f $font_ufo -r -gs -omitMacNames
2019-06-10 08:36:44 +03:00
echo "Building TTF ..."
otf2ttf $font_dir/$ps_name.otf
echo "Componentizing TTF ..."
ttfcomponentizer $font_dir/$ps_name.ttf
2019-06-10 08:36:44 +03:00
# move font files to target directory
mv $font_dir/$ps_name.otf $otf_dir
mv $font_dir/$ps_name.ttf $ttf_dir
2019-06-10 08:36:44 +03:00
echo "Done with $ps_name"
echo ""
echo ""
}
for w in ${roman_weights[@]}
do
build_font Roman $w
done
2015-06-05 03:59:51 +03:00
2019-06-10 08:36:44 +03:00
for w in ${italic_weights[@]}
2015-06-05 03:59:51 +03:00
do
build_font Italic $w
2015-06-05 03:59:51 +03:00
done