fix(graphics): decode Japanese text as glyph codes #472

Merged
jqueuniet merged 2 commits from feat/glyph-text into main 2026-11-01 13:22:03 +01:00
Owner

Japanese text indexes the ports' own glyph sheets (0x1c), not Shift-JIS.

  • glyph_codes, Archive::glyph_sheets, find_glyph, Archive::decode_glyphs_png: sheet layout as the engine's font loader and QUERY_CHAR_METRICS (later sheet wins on overlap, Sega CD JP sheet 3).
  • Text::to_display_string: codes below 0x78 stay characters (ASCII, runes), kana and kanji become U+F0000 + code. encoding_rs dropped.
  • GraphicsArchive::text_image (wasm textImage, FFI, Python): draws a glyph_text / glyph_name with the archive's font.
  • Every glyph code in the six Japanese ports' text resolves on its own sheets; rendered Mac JP / Sega CD JP names read 時の眼, 稲妻リング, たいまつ, マント.

Step 1 of #438; Unicode tables per glyph set follow.

Refs #438

https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7

Japanese text indexes the ports' own glyph sheets (0x1c), not Shift-JIS. - `glyph_codes`, `Archive::glyph_sheets`, `find_glyph`, `Archive::decode_glyphs_png`: sheet layout as the engine's font loader and `QUERY_CHAR_METRICS` (later sheet wins on overlap, Sega CD JP sheet 3). - `Text::to_display_string`: codes below `0x78` stay characters (ASCII, runes), kana and kanji become `U+F0000 + code`. `encoding_rs` dropped. - `GraphicsArchive::text_image` (wasm `textImage`, FFI, Python): draws a `glyph_text` / `glyph_name` with the archive's font. - Every glyph code in the six Japanese ports' text resolves on its own sheets; rendered Mac JP / Sega CD JP names read 時の眼, 稲妻リング, たいまつ, マント. Step 1 of #438; Unicode tables per glyph set follow. Refs #438 https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
Japanese strings index the ports' own glyph sheets (0x1c), not
Shift-JIS. Kana and kanji become U+F0000 + code; glyph_sheets,
find_glyph and decode_glyphs_png draw them as the engine does.

Refs #438

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
feat(bindings): GraphicsArchive.text_image
All checks were successful
CI / msrv (1.90) (pull_request) Successful in 46s
CI / audit (pull_request) Successful in 13s
CI / stable (pull_request) Successful in 1m32s
CI / python bindings (3.11) (pull_request) Successful in 34s
CI / msrv (1.90) (push) Successful in 46s
CI / audit (push) Successful in 14s
CI / stable (push) Successful in 1m31s
CI / python bindings (3.11) (push) Successful in 34s
e22a485c7d
Draws a glyph_text or glyph_name with a Japanese archive's font.

Refs #438

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
jqueuniet deleted branch feat/glyph-text 2026-11-01 13:22:04 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!472
No description provided.