Commit c77971ca authored by Sebastian Friedl's avatar Sebastian Friedl
Browse files

Generate Webfonts

parent 81bf45b3
......@@ -19,6 +19,7 @@ build:
- pip install -r dep/dep.pip
script:
- ./scripts/11-slice.py
- ./scripts/21-webfonts.sh
after_script:
- echo "Git commit $CI_COMMIT_SHORT_SHA" > BUILD
- echo "Build finished on `date -R`" >> BUILD
......
git
python3
python3-venv
woff-tools
woff2
#!/usr/bin/env bash
set -e
# get absolute path to root dir
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && cd .. > /dev/null && pwd )"
# copy TrueType font folders
mapfile -t font_folders < <(find "$ROOT_DIR"/out/ -name TTF -type d -printf '%h\n')
for font_folder in "${font_folders[@]}"; do
cp -r "$font_folder/TTF" "$font_folder/WOFF"
cp -r "$font_folder/TTF" "$font_folder/WOFF2"
done
# create WOFF fonts
for file in "$ROOT_DIR"/out/*/WOFF/*.ttf; do
sfnt2woff "$file"
rm "$file"
done
# create WOFF2 files
for file in "$ROOT_DIR"/out/*/WOFF2/*.ttf; do
woff2_compress "$file"
rm "$file"
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment