Skip to content

papercut:fonts:install saves the family's licence - #7

Open
serpentblade wants to merge 1 commit into
mainfrom
fonts-install-licence
Open

serpentblade wants to merge 1 commit into
mainfrom
fonts-install-licence

Conversation

@serpentblade

Copy link
Copy Markdown
Contributor

Summary

papercut:fonts:install downloaded only the TrueType files, so anyone installing an OFL font ended up without the licence the OFL asks to travel with the fonts. The command now saves the licence beside them.

  • Looks up the family in Google's fonts repository, trying ofl/<family>/OFL.txt, then apache/<family>/LICENSE.txt, then ufl/<family>/UFL.txt. The folder name is the family name lowercased with spaces removed.
  • Saves only plain text of a sensible size, so an error page isn't saved as a licence.
  • If no licence can be fetched, the command warns and still installs the fonts. An existing licence file is kept unless you pass --force, as with the fonts.
  • The closing message now names the licence file to keep with the fonts. It replaces the old "check the licence before you ship" note.

Checks

  • Four new tests: OFL saved, Apache fallback, a warning when no licence is found, and an existing copy kept unless forced. The Laravel suite and PHPStan pass.
  • Live run: installed Open Sans (got OFL.txt) and Roboto Slab (no OFL, so it got the Apache LICENSE.txt).

Docs: the Laravel README, the fonts guide and the CHANGELOG's Unreleased section are updated.

🤖 Generated with Claude Code

The command downloaded only the TrueType files, so an app that installed
an OFL font shipped it without the licence the OFL asks to travel with
it. It now fetches the family's OFL.txt, LICENSE.txt (Apache) or UFL.txt
from Google's fonts repository and saves it beside the fonts. A licence
that can't be fetched is a warning, not a failure; an existing copy is
kept unless --force.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant