From 3f545cc74d68b36ee3d3b3c566643a754b27bac1 Mon Sep 17 00:00:00 2001 From: janis Date: Fri, 10 Apr 2026 20:29:34 +0200 Subject: [PATCH] add script to fetch fonts from github:google/fonts --- assets/fonts/.gitignore | 1 + assets/fonts/fetch.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 assets/fonts/.gitignore create mode 100755 assets/fonts/fetch.sh diff --git a/assets/fonts/.gitignore b/assets/fonts/.gitignore new file mode 100644 index 0000000..d259f05 --- /dev/null +++ b/assets/fonts/.gitignore @@ -0,0 +1 @@ +*.ttf diff --git a/assets/fonts/fetch.sh b/assets/fonts/fetch.sh new file mode 100755 index 0000000..f64a534 --- /dev/null +++ b/assets/fonts/fetch.sh @@ -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