Skip to content

Release 0.1.4: game line metrics for dialog texts and font fallbacks - #6

Merged
nichinichisou0609 merged 2 commits into
mainfrom
dev
Sep 28, 2026
Merged

nichinichisou0609 merged 2 commits into
mainfrom
dev

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Contributor

Summary

This continues the open-font line-metrics fix from 0.1.3. A sweep of the local preview site's eight stories, in every language, found the open font assets that were still laid out with the open face's own line metrics. The gaps were measured against the game's values, all from local data.

Font asset Where Measured This PR
VibeMOPro stand-in (number role) dialog button badges "!" about 3 units lower than the game at 28 px. The badges are inactive in the data and never shown. Now mapped: the fontRole of dialog and chat text nodes counts
A-OTF-ShinGoPr6N stand-in, as a Korean fallback untranslated Japanese labels in the Korean chat window (既読, 事務所, 着信中..., 通知センター) baselines 2.7 to 3.4 canvas units off Now at the game's baselines, through GAME_FONT_LINES (see below)
NotoSansJP stand-in (font2) Japanese chat and frame texts Noto CJK hhea 1160 / -288 / 0 equals the open stand-in (1.448 / 1.16 / -0.288) Unchanged, no difference

GAME_FONT_LINES holds the line metrics that the game's font assets have: ShinGo 2 / 0.88 / -0.12, VibeMOPro 1.2 / 0.83 / -0.17, FZLTH 1.155 / 0.892 / -0.263, Pretendard 1.192871 / 0.95166 / -0.241211, the same values the data's textStyle.roles records. It applies only to an open asset named <open font> (<game font asset>) that no role reaches. The data's own roles still come first.

Test plan

  • npm test (537 pass, StoryFontAssets tests extended)
  • npm run typecheck
  • node scripts/build.mjs --check
  • Opt-in tests/data/story-ui-layout.test.mjs on story 10045: en 167/167, ja 166/166, zh-Hans 166/166, ko 167/167
  • Korean chat labels in story 10045 laid out at the game's baselines (-18.35, -10.66, -14.21, -22.60)
  • Sweep of the 8 local stories: the only unmapped open asset left is NotoSansJP (equal metrics)

🤖 Generated with Claude Code

nichinichisou0609 and others added 2 commits September 28, 2026 09:13
…ine metrics

Open font assets now take the game's line metrics in two more places:

- The fontRole of the dialogs' and chat windows' text nodes maps their
  font assets as the UI's nodes do (the dialog badges' number font).
- An open asset standing in for a game font asset that no role reaches,
  such as the Japanese font behind the untranslated Japanese labels of the
  Korean chat window (既読, 事務所, 着信中..., 通知センター), takes the
  line metrics of that game font from GAME_FONT_LINES (the values the
  game's font assets have: A-OTF-ShinGoPr6N, VibeMOPro, FZLTH_GB18030L2_R,
  Pretendard SemiBold).

Those Korean labels sat 2.7 to 3.4 canvas units off; they are now at the
game's baselines. The Japanese chat and frame font (NotoSansJP) is left as
it is: the Noto CJK vertical metrics (hhea 1160 / -288 / 0) equal the open
stand-in's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nichinichisou0609
nichinichisou0609 merged commit 293c411 into main Sep 28, 2026
3 checks passed
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