From 8cac7ad6429ae3dfe3ea3d710d9e4f134badef8e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 30 Dec 2020 11:50:56 +0100 Subject: More generic font compression script --- scripts/build_fonts.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/build_fonts.sh b/scripts/build_fonts.sh index 292cef2..9823fcf 100755 --- a/scripts/build_fonts.sh +++ b/scripts/build_fonts.sh @@ -6,18 +6,18 @@ if [ -f "site.conf" ]; then source "site.conf" fi -echo -e "\033[0;32m[MINIFY ]\033[0m ${ASSETS_DIR}fonts/iosevka-term-ss09-regular.ttf -> ${OUTPUT_DIR}iosevka-term-ss09-regular.woff2" +find "${ASSETS_DIR}fonts" \ + -type f \ + -name "*.ttf" \ + | while read file + do + target_file=$(basename "${file%.ttf}.woff2") -pyftsubset ${ASSETS_DIR}fonts/iosevka-term-ss09-regular.ttf \ - --text-file="${ASSETS_DIR}fonts/glyphs.txt" \ - --layout-features+=ss09,dlig \ - --flavor="woff2" \ - --output-file="${OUTPUT_DIR}iosevka-term-ss09-regular.woff2" + echo -e "\033[0;32m[MINIFY ]\033[0m $file -> $OUTPUT_DIR$target_file" -echo -e "\033[0;32m[MINIFY ]\033[0m ${ASSETS_DIR}fonts/iosevka-term-ss09-bold.ttf -> ${OUTPUT_DIR}iosevka-term-ss09-bold.woff2" - -pyftsubset ${ASSETS_DIR}fonts/iosevka-term-ss09-bold.ttf \ - --text-file="${ASSETS_DIR}fonts/glyphs.txt" \ - --layout-features+=ss09,dlig \ - --flavor="woff2" \ - --output-file="${OUTPUT_DIR}iosevka-term-ss09-bold.woff2" + pyftsubset "$file" \ + --text-file="${ASSETS_DIR}fonts/glyphs.txt" \ + --layout-features+=ss09,dlig \ + --flavor="woff2" \ + --output-file="$OUTPUT_DIR$target_file" + done -- cgit v1.2.3-70-g09d2