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

source "site.defaults.conf"

if [ -f "site.conf" ]; then
    source "site.conf"
fi

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+=ss09,dlig \
                --flavor="woff2" \
                --output-file="$OUTPUT_DIR$target_file"
        done