1
0
Fork 0
mirror of https://github.com/adobe-fonts/source-sans.git synced 2024-12-26 14:16:03 +01:00
adobe-source-sans/build.sh

54 lines
1.3 KiB
Bash
Raw Normal View History

2017-07-26 09:01:04 +02:00
#!/usr/bin/env sh
2012-10-02 08:11:04 +02:00
set -e
family=SourceSans3
upright_weights=(Black Bold ExtraLight Light Medium Regular Semibold)
italic_weights=(BlackIt BoldIt ExtraLightIt LightIt MediumIt It SemiboldIt)
2018-09-27 09:09:09 +02:00
# get absolute path to bash script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
2012-10-02 08:11:04 +02:00
# clean existing build artifacts
2018-09-27 09:09:09 +02:00
rm -rf $DIR/target/
otf_dir="$DIR/target/OTF"
ttf_dir="$DIR/target/TTF"
mkdir -p $otf_dir $ttf_dir
function build_font {
# $1 is Upright or Italic
# $2 is weight name
2018-09-27 09:09:09 +02:00
font_dir=$DIR/$1/Instances/$2
font_ufo=$font_dir/font.ufo
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
echo "Building TTF ..."
otf2ttf $font_dir/$ps_name.otf
echo "Componentizing TTF ..."
ttfcomponentizer $font_dir/$ps_name.ttf
2012-10-02 08:11:04 +02:00
2018-09-27 09:09:09 +02:00
# move font files to target directory
mv $font_dir/$ps_name.otf $otf_dir
mv $font_dir/$ps_name.ttf $ttf_dir
echo "Done with $ps_name"
echo ""
echo ""
}
for w in ${upright_weights[@]}
2012-10-02 08:11:04 +02:00
do
build_font Upright $w
2012-10-02 08:11:04 +02:00
done
2018-09-27 09:09:09 +02:00
for w in ${italic_weights[@]}
2012-10-02 08:11:04 +02:00
do
2018-09-27 09:09:09 +02:00
build_font Italic $w
2012-10-02 08:11:04 +02:00
done