refactor(fonts): overhaul native:font with Google catalog metadata and adds to config file - #31
Merged
shanerbaner82 merged 4 commits intoAug 3, 2026
Conversation
Replaces the previous approach with a single-family interactive workflow powered by the Google Fonts metadata catalog (fonts.google.com/metadata/fonts). Key changes: - Fetch available styles from the metadata API (cached 24h) instead of guessing from user flags - Interactive family search and style multiselect via Laravel Prompts - `--reset` flag to clear bundled fonts and restore `fonts.default` to `System` - `--clear-cache`, `--force` flags; `--weights`/`--italic` removed - Atomic font file writes (stage → rename) with rollback on failure - `GoogleFonts` gains catalog parsing, alias key helpers, `findFontsBlock`, `setFontAlias`, `resetFontsBlock`, file I/O utilities, and TTF magic-byte validation - Comprehensive unit tests covering all new helpers
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the previous approach with a multi-step interactive fuzzy search of Google Fonts metadata catalog https://fonts.google.com/metadata/fonts (no API key needed)
Key changes:
--resetflag to clear downloaded fonts and restorefonts.defaulttoSystem--weights/--italicflags removed (covered in interactive flow)--clear-cacheadded to force refresh of Google Fonts catalog,--forceoverwrites existing font files with the same nameGoogleFontsgains catalog parsing, alias key helpers,findFontsBlock,setFontAlias,resetFontsBlock, file I/O utilities, and TTF magic-byte validationExample usage:
php artisan native:fontstarts multi-step interactive font chooserphp artisan native:font Interfinds Inter font and offers stylesphp artisan native:font --resetdeletes font files fromresources/fontsand resets font config to'default' => 'System'