Release 0.1.4: game line metrics for dialog texts and font fallbacks - #6
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
GAME_FONT_LINES(see below)GAME_FONT_LINESholds 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'stextStyle.rolesrecords. 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,StoryFontAssetstests extended)npm run typechecknode scripts/build.mjs --checktests/data/story-ui-layout.test.mjson story 10045: en 167/167, ja 166/166, zh-Hans 166/166, ko 167/167🤖 Generated with Claude Code