font: kerning and requested-scale glyph metrics (My First Gran Turismo menu text) #1030
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1030
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1030/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@defektu on GitHub · 2026-10-04 01:02 UTC · original
defektu:pr/mfgt-font→main· +59 −0 · 1 files · 3 commits · closed without mergingThis is one of a few PRs that together get My First Gran Turismo (PPSA24156) running: #1030 (font), #1031 (hle), #1032 (tess), #1033 (host), #1034 (shader), and the draft #1035 (mixed sample counts), which the game also needs to get past the loading screen after "Start" (without it the game stops with "mixed color/depth sample counts are unsupported"). Each PR builds and passes the tests on its own; the title only works with all of them.
Checked by hand on a combined branch (all of the above) on an RTX 5060 Ti, Windows 11, clean save data: intro, title screen (car, lighting, reflections), main menu and the License Center screen. The individual PRs were not run in the game on their own.
Note: on current
mainthis title waits at the "Sign in to PlayStation Network" dialog untilCancelis pressed; that comes from the sign-in dialog change, not from this PR.Commits
Body
Menu text in My First Gran Turismo (PPSA24156) was wrong in two ways:
FontGetCharGlyphMetricsanswered with the clamped bitmap size instead of the size at the requested scale.FontGetKerningwas missing, so strings were laid out with spaced letters ("S a v i n g").Adds
FontGetKerning(writes the stb_truetype kern advance into theFontKerningstruct) andFontDettachDeviceCacheBuffer.Testing: builds, 23 test executables pass. Text checked on the My First Gran Turismo title screen (combined branch).
🤖 Generated with Claude Code
Without kerning the menu text was rendered with spaced letters ("S a v i n g"). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> (cherry picked from commit 821004ac64e9fa2c937f4f653d50eabc5fc9a581)@coderabbitai[bot] on GitHub · 2026-10-04 01:04 UTC · original · edited 2026-10-04 01:50 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
b29b9e3b-7fdf-42e4-ab8b-f71f4884fcda📥 Commits
Reviewing files that changed from the base of the PR and between
555f501ec0anddd8fc6058e.📒 Files selected for processing (1)
src/libs/libFont.cpp🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
📝 Walkthrough
Walkthrough
FontGetCharGlyphMetricsandFontGetKerninguse the font’s requested pixel scale for TTF metric calculations. The change adds and registersFontGetKerningandFontDettachDeviceCacheBuffer. Kerning results are initialized to zero, and the horizontal offset is calculated when supported TTF data is available.Priority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
dd8fcThis change fixes spaced-out menu text by returning glyph metrics at the requested scale and adding kerning. No merge-blocking risk was identified.
Security Architecture Review
Security architecture risk: 🟡 Moderate · up to
555f5Requested-scale metrics bypass the former size cap but still convert scaled glyph bounds to signed integers. Large caller-supplied sizes can exceed that representation. Bitmap storage remains bounded, and no privilege gain or memory-corruption exploit was demonstrated.
Retained concerns
Security review details
Security Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -2084,0 +2126,4 @@auto* font = static_cast<FontState*>(font_handle);if (font != nullptr && ensure_stb_font(font)) {const float scale = stb_font_scale(font);@coderabbitai[bot] on GitHub · 2026-10-04 01:04 UTC · original · edited 2026-10-04 01:50 UTC
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use the requested scale for kerning.
If
FontSetScalePixelsets a height above 128,FontGetCharGlyphMetricsuses that height, butFontGetKerninguses the 128-pixel clamp. At the reported height of 10,000, the pair adjustment is therefore much smaller than the corresponding glyph metrics. Calculate kerning with the same requested-scale rule so the title can place the next glyph correctly.✅ Addressed in commit
dd8fc60@coderabbitai[bot] on GitHub · 2026-10-04 01:04 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
352cd811-a35b-4501-97c4-d822a491c538📥 Commits
Reviewing files that changed from the base of the PR and between
db17585277and555f501ec0.📒 Files selected for processing (1)
src/libs/libFont.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@Nmzik on GitHub · 2026-10-04 22:53 UTC · original
@defektu credited
Pull request closed