#!/usr/bin/env bash
# Fetch the three SIL Open Font License fonts used by the cast sign pattern maker, pinned to upstream commits.
# Each font ships with its own OFL.txt. Run from anywhere; files land in assets/tools/fonts/.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUT="$ROOT/assets/tools/fonts"
mkdir -p "$OUT"
get() { # name repo commit font-path license-path
  curl -fsSL "https://raw.githubusercontent.com/$2/$3/$4" -o "$OUT/$1.ttf"
  curl -fsSL "https://raw.githubusercontent.com/$2/$3/$5" -o "$OUT/$1-OFL.txt"
}
get Oswald-Bold googlefonts/OswaldFont 89795261ac9eeb9aa8cd99f43982c4e4b0e53261 fonts/ttf/Oswald-Bold.ttf OFL.txt
get Cinzel-Bold NDISCOVER/Cinzel dd598495b0fb2ad84270d5cc75d642d2f1e8eabf fonts/ttf/Cinzel-Bold.ttf OFL.txt
get BebasNeue-Regular dharmatype/Bebas-Neue 46e72cec95ee599f72c0de4a12cfe64828949236 "fonts/BebasNeue(2018)ByDhamraType/ttf/BebasNeue-Regular.ttf" OFL.txt
ls -l "$OUT"
