Convert from Homebrew Formulae to Casks for font installation

Formulae can't install to ~/Library/Fonts/ due to Homebrew sandboxing.
Casks have a built-in `font` artifact that handles this automatically.

- Replace Formula/ with Casks/ directory
- Rewrite generator to produce cask files instead of formulae
- Add .ttc (TrueType Collection) support
- Update all tests for cask format
- Update CLI and documentation
- Fonts with no installable files (TTF/OTF/TTC) are skipped

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Troutman 2026-03-07 21:38:59 -06:00
parent cb1918c30f
commit 76743cdc4d
No known key found for this signature in database
273 changed files with 2509 additions and 10048 deletions

View file

@ -3,10 +3,10 @@ from pathlib import Path
import pytest
# Repo root: directory containing font_files/ and Formula/
# Repo root: directory containing font_files/ and Casks/
REPO_ROOT = Path(__file__).resolve().parent.parent
FONT_FILES_DIR = REPO_ROOT / "font_files"
FORMULA_DIR = REPO_ROOT / "Formula"
CASKS_DIR = REPO_ROOT / "Casks"
REQUIRED_SUBDIRS = ("ttf", "otf", "web", "other_files")
WEB_EXTENSIONS = (".woff", ".woff2", ".eot", ".svg")
@ -35,8 +35,8 @@ def font_dir_names():
@pytest.fixture(scope="session")
def formula_paths():
"""All Formula/font-*.rb paths that exist."""
if not FORMULA_DIR.exists():
def cask_paths():
"""All Casks/font-*.rb paths that exist."""
if not CASKS_DIR.exists():
return []
return sorted(FORMULA_DIR.glob("font-*.rb"))
return sorted(CASKS_DIR.glob("font-*.rb"))