neuralglitch/google-fonts
Laravel package for self-hosting Google Fonts: download font files locally, generate CSS, and serve them from your app. Avoid external Google requests, improve privacy and GDPR compliance, and boost performance with cached local assets.
when@prod / when@dev; in Laravel, map those values to config/*.php and .env instead.gfonts:status to confirm configuration, cache settings, and locked fonts. This is the quickest way to verify the package is wired correctly.google_fonts() in your Blade layout for a critical font, using the new text subset parameter and preload flag:
google_fonts('Inter', text: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', preload: true)
gfonts:lock --dry-run and inspect the new CLI tables showing requested vs downloaded weights.gfonts:import --dry-run if you are importing local or catalog fonts, then run without --dry-run once the plan looks correct.text parameter with only the characters needed for hero headings, navigation, or branding. For body text with dynamic content, either use a broader subset or accept the full font file.preload: true for the one or two fonts used in the initial viewport. Preloading many fonts delays other critical assets.gfonts:lock --dry-run in pull requests and gfonts:lock during deployment. Commit the resulting manifest and font files if your deployment does not persist generated assets.gfonts:status, then gfonts:prune --dry-run, then gfonts:prune. This keeps the locked fonts directory from growing stale.--no-interaction and quiet output in CI. The new progress bars and detailed tables are helpful interactively; scripts should avoid ANSI noise.assets/ and uses relative ./font.woff2 URLs. In Laravel with Vite, you will likely need to adjust CSS url() paths or copy fonts into public/ and reference them with asset().text subset, those glyphs may fall back or render incorrectly. Use subsetting only for known static text, or generate multiple subsets.preload.gfonts:prune removes fonts from the locked directory. If the manifest is stale, pruning can delete fonts still referenced by templates. Run gfonts:status and --dry-run first.when@prod and when@dev are Symfony container features. In Laravel, use environment-specific config files or env() checks cached via config:cache.Filesystem::readFile() when available and falls back to file_get_contents(). Ensure allow_url_fopen is enabled if remote reads go through the fallback, and check error handling if you run on older Symfony components.How can I help you explore Laravel packages today?