add script to fetch fonts from github:google/fonts

This commit is contained in:
janis 2026-04-10 20:29:34 +02:00
parent c731f79f81
commit 3f545cc74d
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8
2 changed files with 29 additions and 0 deletions

1
assets/fonts/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.ttf

28
assets/fonts/fetch.sh Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
FORCE=0
if [[ "${1:-}" == "--force" ]]; then
FORCE=1
fi
BASE_URL="https://github.com/google/fonts/raw/refs/heads/main/"
declare -A FONTS=(
["Roboto.ttf"]="ofl/roboto/Roboto%5Bwdth,wght%5D.ttf"
["NotoSans.ttf"]="ofl/notosans/NotoSans%5Bwdth,wght%5D.ttf"
["NotoSansSC.ttf"]="ofl/notosanssc/NotoSansSC%5Bwdth,wght%5D.ttf"
)
for filename in "${!FONTS[@]}"; do
font_path="${FONTS[$filename]}"
url="${BASE_URL}${font_path}"
if [[ -f "$filename" && $FORCE -eq 0 ]]; then
echo "Skipping $filename (already exists)"
fi
echo "Fetching $filename from $url"
curl -L "$url" -o "$filename"
done