summaryrefslogtreecommitdiffstats
path: root/scripts/build_fonts.sh
blob: 7d368e7d5e13f19e41a6366859adfcad3dad2ce4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

source "site.defaults.conf"

find "${ASSETS_DIR}fonts" \
    -type f \
    -name "*.ttf" \
    | while read file
        do
            target_file=$(basename "${file%.ttf}.woff2")

            echo -e "\033[0;32m[MINIFY  ]\033[0m $file -> $OUTPUT_DIR$target_file"

            pyftsubset "$file" \
                --text-file="${ASSETS_DIR}fonts/glyphs.txt" \
                --layout-features+=ss02,ss09,dlig \
                --flavor="woff2" \
                --output-file="$OUTPUT_DIR$target_file"
        done