add script to fetch fonts from github:google/fonts
This commit is contained in:
parent
c731f79f81
commit
3f545cc74d
1
assets/fonts/.gitignore
vendored
Normal file
1
assets/fonts/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
*.ttf
|
||||
28
assets/fonts/fetch.sh
Executable file
28
assets/fonts/fetch.sh
Executable 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
|
||||
Loading…
Reference in a new issue