Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

Font license terms require licenses to be visible to users. This adds font license display to the acknowledgments page, with a test-driven approach to generate the font bill of materials.

Font directory restructure

  • Enforced one directory per font containing .ttf files and LICENSE
  • Moved NotoSansSC and PinyinlyComponents into their own directories
  • Added SIL OFL license for NotoSansSC

Font BOM generation via snapshot test

  • test/data/fontBom.test.ts scans fonts/*/LICENSE and generates fontBillOfMaterials.asset.json
  • Uses toMatchFileSnapshot() so regeneration is just vitest -u
// test/data/fontBom.test.ts
const fontDirs = await glob(`*/LICENSE`, { cwd: fontsDir });
// ... generates JSON array of {name, license} entries
await expect(JSON.stringify(fontBom, null, 2)).toMatchFileSnapshot(outputPath);

Data layer

  • Added loadFontBillOfMaterials() and fontBillOfMaterialsQuery() in bom.ts / query.ts

Acknowledgments page

  • New "Fonts used in Pinyinly" section with expandable license text per font
  • Existing libraries section unchanged
Original prompt

I want to add font licenses to the acknowledgments page in the app, because it's part of the license terms that the license is included in a user-visible way in the app. I have already written some code to do this for javascript libraries that are used, but it doesn't do any handling of fonts. Because fonts are used across all platforms, i think it's fine to make a new .asset.json with the font bill of materials data rather than copying it 3 times into the different billOfMaterials.*.asset.json files.

To make this easier I think in the src/assets/fonts a convention should be enforced to have a directory for each font, and inside the directory is the .ttf and a LICENSE file. And then this can be automatically compiled into a .asset.json file that can be bundled into the app. To build this file I'd like to write it as a vitest test that uses .toMatchSnapshotFile() so that it can be updated by running vitest -u to update snapshots.

On the acknowledges page there should be another section for fonts, and the font name and license should be shown.

The user has attached the following file paths as relevant context:

  • projects/app/src/data/bom.ts
  • projects/app/src/assets/fonts/MiSans/LICENSE
  • .github/instructions/app.instructions.md
  • .github/instructions/code-conventions.instructions.md
  • .github/instructions/curriculum.instructions.md
  • .github/instructions/design-decisions.instructions.md
  • .github/instructions/learning-graph.instructions.md
  • .github/instructions/skill-kinds.instructions.md
  • .github/instructions/srs-algorithm.instructions.md
  • .github/instructions/wiki.instructions.md
  • .github/instructions/word-representation.instructions.md
  • .github/copilot-instructions.md

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Reorganize fonts directory to have one directory per font with LICENSE file
- Create test to generate fontBillOfMaterials.asset.json via snapshot
- Add loadFontBillOfMaterials and fontBillOfMaterialsQuery
- Update acknowledgements page to show fonts section with expandable licenses

Co-authored-by: bradleyayers <[email protected]>
Base automatically changed from dev to main November 27, 2025 22:09
- Add validation for font LICENSE files to fail if none found
- Add accessibility props to font license Pressable

Co-authored-by: bradleyayers <[email protected]>
Copilot AI changed the title [WIP] Add font licenses handling to acknowledgments page Add font licenses to acknowledgments page Nov 27, 2025
Copilot AI requested a review from bradleyayers November 27, 2025 22:17
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.

2 participants