Skip to content

feat(fonts): read the game font settings from a built-in table in open-font exports - #34

Merged
nichinichisou0609 merged 1 commit into
mainfrom
feat/open-fonts-builtin-settings
Oct 13, 2026
Merged

nichinichisou0609 merged 1 commit into
mainfrom
feat/open-fonts-builtin-settings

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Collaborator

Summary

  • With --fonts open (the default) the story, start canvas, host and chat exports take the game font assets' point size, padding, render mode, style settings, line metrics, fallback chains, character coverage and text materials from a table shipped with nnnotes (src/nnnotes/fontsettings.json, format nnnotes.font-settings/1). They no longer load any game font asset, font material or font bundle; the game's fonts are read only with --fonts game.
  • fontsettings.FontSettings looks characters up through the fallback chains as TextMeshPro does; AssetFontSettings reads the same values from the game's font assets.
  • scripts/gen_font_settings.py regenerates the table for a new game version.

Verification

  • The full test suite and pyflakes.
  • One story episode exported with open fonts before and after the change: every manifest entry is byte-identical and no font bundle is fetched.

🤖 Generated with Claude Code

…n-font exports

With `--fonts open` (the default) the story, start canvas, host and chat
exports now take the game font assets' point size, padding, render mode,
style settings, line metrics, fallback chains, character coverage and text
materials from a table shipped with nnnotes (src/nnnotes/fontsettings.json,
format nnnotes.font-settings/1). These exports no longer load any game font
asset, font material or font bundle: references into font bundles resolve
through the table's object index, and catalog closures leave those bundles
out. The game's fonts are only read with `--fonts game`.

- fontsettings.FontSettings looks characters up through the fallback chains
  as TextMeshPro does and gives the missing glyph, glyph-variant check,
  underline glyph and material records the open font assets need;
  AssetFontSettings reads the same values from the game's font assets.
- scripts/gen_font_settings.py regenerates the table for a new game version.
- Exporter takes `font_stubs`; Catalog.fetch_key takes bundles to skip and
  Catalog.bundle_of names the bundle of a key.

Verified with the full test suite and pyflakes, and by exporting one story
episode with open fonts before and after the change: every manifest entry is
byte-identical and no font bundle is fetched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit dfe3c86 into main Oct 13, 2026
7 checks passed
@nichinichisou0609
nichinichisou0609 deleted the feat/open-fonts-builtin-settings branch October 13, 2026 12:48
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