|
@@ -0,0 +1,145 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+if [ $# -gt 1 ]
|
|
|
+ then
|
|
|
+ echo "Inappropriate arguments included in your command." 1>&2
|
|
|
+ echo "Usage: ./build.sh (--install-dependencies)" 1>&2
|
|
|
+ exit 1
|
|
|
+elif [ "$1" = "--install-dependencies" ]
|
|
|
+ then
|
|
|
+
|
|
|
+ pip install fontmake
|
|
|
+
|
|
|
+ pip install fonttools
|
|
|
+
|
|
|
+ curl -L https://sourceforge.net/projects/freetype/files/ttfautohint/1.6/ttfautohint-1.6.tar.gz/download -o ttfautohint.tar.gz
|
|
|
+ tar -xvzf ttfautohint.tar.gz
|
|
|
+ ttfautohint-1.6/configure
|
|
|
+ sudo ttfautohint-1.6/make && sudo ttfautohint-1.6/make install
|
|
|
+ if [ -f "ttfautohint-1.6.tar.gz" ]
|
|
|
+ then
|
|
|
+ rm ttfautohint-1.6.tar.gz
|
|
|
+ fi
|
|
|
+ if [ -d "ttfautohint-1.6"]
|
|
|
+ then
|
|
|
+ rm -rf ttfautohint-1.6
|
|
|
+ fi
|
|
|
+
|
|
|
+
|
|
|
+ installflag = 0
|
|
|
+ which fontmake
|
|
|
+ if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to install fontmake with 'pip install fontmake'. Please attempt manual install and repeat build without the --install-dependencies flag." 1>&2
|
|
|
+ $installflag = 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ python -c "import fontTools"
|
|
|
+ if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to install fontTools with 'pip install fonttools'. Please attempt manual install and repeat build without the --install-dependencies flag." 1>&2
|
|
|
+ $installflag = 1
|
|
|
+ fi
|
|
|
+
|
|
|
+ which ttfautohint
|
|
|
+ if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to install ttfautohint from source. Please attempt manual install and repeat build without the --install-dependencies flag." 1>&2
|
|
|
+ $installflag = 1
|
|
|
+ fi
|
|
|
+
|
|
|
+
|
|
|
+ if [ $installflag -eq 1 ]
|
|
|
+ then
|
|
|
+ echo "Build canceled." 1>&2
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+if [ -f "build/ttf/Hack-Regular.ttf" ]; then
|
|
|
+ rm build/ttf/Hack-Regular.ttf
|
|
|
+fi
|
|
|
+
|
|
|
+if [ -f "build/ttf/Hack-Italic.ttf" ]; then
|
|
|
+ rm build/ttf/Hack-Italic.ttf
|
|
|
+fi
|
|
|
+
|
|
|
+if [ -f "build/ttf/Hack-Bold.ttf" ]; then
|
|
|
+ rm build/ttf/Hack-Bold.ttf
|
|
|
+fi
|
|
|
+
|
|
|
+if [ -f "build/ttf/Hack-BoldItalic.ttf" ]; then
|
|
|
+ rm build/ttf/Hack-BoldItalic.ttf
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+fontmake -u "source/Hack-Regular.ufo" -o ttf
|
|
|
+if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to build the Hack regular variant set. Build canceled." 1>&2
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+fontmake -u "source/Hack-Bold.ufo" -o ttf
|
|
|
+if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to build the Hack bold variant set. Build canceled." 1>&2
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+fontmake -u "source/Hack-Italic.ufo" -o ttf
|
|
|
+if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to build the Hack italic variant set. Build canceled." 1>&2
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+fontmake -u "source/Hack-BoldItalic.ufo" -o ttf
|
|
|
+if [ $? -ne 0 ]
|
|
|
+ then
|
|
|
+ echo "Unable to build the Hack bold italic variant set. Build canceled." 1>&2
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+mv master_ttf/Hack-Regular.ttf build/ttf/Hack-Regular.ttf
|
|
|
+echo "Hack-Regular.ttf was moved to release directory on path build/ttf/Hack-Regular.ttf"
|
|
|
+mv master_ttf/Hack-Italic.ttf build/ttf/Hack-Italic.ttf
|
|
|
+echo "Hack-Italic.ttf was moved to release directory on path build/ttf/Hack-Italic.ttf"
|
|
|
+mv master_ttf/Hack-Bold.ttf build/ttf/Hack-Bold.ttf
|
|
|
+echo "Hack-Bold.ttf was moved to release directory on path build/ttf/Hack-Bold.ttf"
|
|
|
+mv master_ttf/Hack-BoldItalic.ttf build/ttf/Hack-BoldItalic.ttf
|
|
|
+echo "Hack-BoldItalic.ttf was moved to release directory on path build/ttf/Hack-BoldItalic.ttf"
|
|
|
+
|
|
|
+
|
|
|
+rm -rf master_ttf
|