|
@@ -7,27 +7,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
TTFAH="$HOME/ttfautohint-build/local/bin/ttfautohint"
|
|
|
+FONTMAKE="pipenv run fontmake"
|
|
|
+PYTHON="pipenv run python"
|
|
|
|
|
|
|
|
|
SFNTWOFF_BUILD="$HOME/sfnt2woff-zopfli-build"
|
|
@@ -79,64 +69,30 @@ BOLDITALIC_WOFF2="hack-bolditalic-subset.woff2"
|
|
|
WEB_BUILD="build/web/fonts"
|
|
|
|
|
|
|
|
|
-if [ $# -gt 0 ]
|
|
|
+if [ $# -gt 1 ]
|
|
|
then
|
|
|
echo "Inappropriate arguments included in your command." 1>&2
|
|
|
- echo "Usage: ./build-subsets.sh" 1>&2
|
|
|
+ echo "Usage: ./build-subsets.sh (--system)" 1>&2
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-INSTALLFLAG=0
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-if ! [ -f "$TTFAH" ]
|
|
|
- then
|
|
|
- if ! which ttfautohint
|
|
|
- then
|
|
|
- echo "ttfautohint was not found. Please install all build dependencies with 'make build-with-dependencies', then attempt your build again." 1>&2
|
|
|
- INSTALLFLAG=1
|
|
|
- else
|
|
|
- TTFAH="ttfautohint"
|
|
|
- echo "ttfautohint executable identified"
|
|
|
- fi
|
|
|
- else
|
|
|
- echo "ttfautohint executable identified"
|
|
|
-fi
|
|
|
-
|
|
|
-
|
|
|
-if ! [ -f "$SFNTWOFF_BIN" ]
|
|
|
- then
|
|
|
- echo "sfnt2woff-zopfli was not found on the path $SFNTWOFF_BIN. Please install all build dependencies with 'make build-with-dependencies', then attempt your build again." 1>&2
|
|
|
- INSTALLFLAG=1
|
|
|
-else
|
|
|
- echo "sfnt2woff-zopfli executable identified"
|
|
|
-fi
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-if ! [ -f "$WOFF2_BIN" ]
|
|
|
- then
|
|
|
- echo "woff2_compress was not found on the path $WOFF2_BIN. Please install all build dependencies with 'make build-with-dependencies', then attempt your build again." 1>&2
|
|
|
- INSTALLFLAG=1
|
|
|
-else
|
|
|
- echo "woff2_compress executable identified"
|
|
|
+if [ "$1" = "--system" ]; then
|
|
|
+ TTFAH="ttfautohint"
|
|
|
+ FONTMAKE="fontmake"
|
|
|
+ PYTHON="python3"
|
|
|
+ SFNTWOFF_BIN="sfnt2woff-zopfli"
|
|
|
+ WOFF2_BIN="woff2_compress"
|
|
|
fi
|
|
|
|
|
|
-
|
|
|
-if [ $INSTALLFLAG -eq 1 ]
|
|
|
- then
|
|
|
- echo "Build canceled." 1>&2
|
|
|
- exit 1
|
|
|
-fi
|
|
|
|
|
|
|
|
|
|
|
@@ -148,7 +104,7 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
-if ! [ -d "$TEMP_SOURCE" ]; then
|
|
|
+if [ -d "$TEMP_SOURCE" ]; then
|
|
|
rm -rf $TEMP_SOURCE
|
|
|
fi
|
|
|
|
|
@@ -185,21 +141,21 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
-if ! pipenv run fontmake --subset -u "$TEMP_SOURCE/Hack-Regular.ufo" -o ttf
|
|
|
+if ! $FONTMAKE --subset -u "$TEMP_SOURCE/Hack-Regular.ufo" -o ttf
|
|
|
then
|
|
|
echo "Unable to build the Hack-Regular variant subset. Build canceled." 1>&2
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
|
|
|
-if ! pipenv run fontmake --subset -u "$TEMP_SOURCE/Hack-Bold.ufo" -o ttf
|
|
|
+if ! $FONTMAKE --subset -u "$TEMP_SOURCE/Hack-Bold.ufo" -o ttf
|
|
|
then
|
|
|
echo "Unable to build the Hack-Bold variant subset. Build canceled." 1>&2
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
|
|
|
-if ! pipenv run fontmake --subset -u "$TEMP_SOURCE/Hack-Italic.ufo" -o ttf
|
|
|
+if ! $FONTMAKE --subset -u "$TEMP_SOURCE/Hack-Italic.ufo" -o ttf
|
|
|
then
|
|
|
echo "Unable to build the Hack-Italic variant subset. Build canceled." 1>&2
|
|
|
exit 1
|
|
@@ -207,7 +163,7 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
-if ! pipenv run fontmake --subset -u "$TEMP_SOURCE/Hack-BoldItalic.ufo" -o ttf
|
|
|
+if ! $FONTMAKE --subset -u "$TEMP_SOURCE/Hack-BoldItalic.ufo" -o ttf
|
|
|
then
|
|
|
echo "Unable to build the Hack-BoldItalic variant subset. Build canceled." 1>&2
|
|
|
exit 1
|
|
@@ -226,7 +182,7 @@ fi
|
|
|
echo " "
|
|
|
echo "Attempting DSIG table fixes with fontbakery..."
|
|
|
echo " "
|
|
|
-if ! pipenv run python postbuild_processing/fixes/fix-dsig.py master_ttf/*.ttf
|
|
|
+if ! $PYTHON postbuild_processing/fixes/fix-dsig.py master_ttf/*.ttf
|
|
|
then
|
|
|
echo "Unable to complete DSIG table fixes on the release files"
|
|
|
exit 1
|
|
@@ -236,7 +192,7 @@ fi
|
|
|
echo " "
|
|
|
echo "Attempting fstype fixes with fontbakery..."
|
|
|
echo " "
|
|
|
-if ! pipenv run python postbuild_processing/fixes/fix-fstype.py master_ttf/*.ttf
|
|
|
+if ! $PYTHON postbuild_processing/fixes/fix-fstype.py master_ttf/*.ttf
|
|
|
then
|
|
|
echo "Unable to complete fstype fixes on the release files"
|
|
|
exit 1
|