Skip to content

HD text: Kaneda's glyph sheets shipped, loaded in the background - #107

Merged
Mango77x merged 1 commit into
mainfrom
feat/kaneda-glyphs
Nov 13, 2026
Merged

Mango77x merged 1 commit into
mainfrom
feat/kaneda-glyphs

Conversation

@Mango77x

Copy link
Copy Markdown
Owner

Summary

Kaneda's glyph sheets ship with MHForever: every character of the font at 8 times its size, one sheet per block of 256 code points (Latin with accents, stars, Japanese punctuation, kana, kanji, full-width forms), in fonts/hd-text/.

  • Stored as greyscale: lossless, the grey is the coverage. The 89 sheets are 27 MB in all (98 MB as delivered in RGBA). The Windows archive grows from 125 to 151 MB.
  • Loaded in the background:
    • Before, a sheet was decoded on the drawing thread and kept whole as RGBA, 64 MB each at 8x. A Japanese screen loading 36 of them would have held over 2 GB.
    • Now a sheet is decoded on a thread of its own when a glyph of its block is first wanted, straight to one byte a texel (decode_coverage), one at a time. The font draws the glyph meanwhile, and the text pages are drawn again once the sheet arrives.
    • Three sheets stay decoded; the glyphs taken from them are kept on their own, cut to their boxes.
  • A player's pack can still bring its own sheets (looked for first). The build copies assets/hd-text/ whole; credits updated.

Testing

  • All four regions build; 24/24 tests pass. The Windows archive carries the 89 sheets.
  • Japanese release, character select (40 s headless, 1920x1080):
Peak memory Game speed
Glyphs from the font only 255 MB 30.0 fps
Sheets, decoded whole on the drawing thread (before) 413 MB
Sheets, this branch 330 MB 30.0 fps
  • The dialog's kana and kanji drawn from the sheets sit in the same places as the font's.

Kaneda drew every character of the font at 8 times its size, a glyph sheet per block of 256 code points (Latin with
accents, stars, Japanese punctuation, kana, kanji, full-width forms). They ship in fonts/hd-text/, saved as greyscale
(lossless, the grey is the coverage: 27 MB for the 89 sheets).

A sheet was decoded on the drawing thread and kept whole as RGBA (64 MB each at 8x). Now it is decoded on a thread of
its own when a glyph of its block is first wanted, straight to one byte a texel (decode_coverage), one at a time; the
font draws the glyph meanwhile, and the text pages are drawn again once it arrives. Three stay decoded, and the glyphs
taken from them are kept on their own, cut to their boxes. Japanese character select: 330 MB at most with the sheets,
against 255 MB drawn from the font alone.
@Mango77x
Mango77x merged commit d793638 into main Nov 13, 2026
8 checks passed
@Mango77x
Mango77x deleted the feat/kaneda-glyphs branch November 13, 2026 11:04
@Mango77x Mango77x mentioned this pull request Nov 13, 2026
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