font: rasterize glyphs larger than 128 pixels #1214
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!1214
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1214/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?
@Cosmo on GitHub · 2026-10-08 14:56 UTC · original
Cosmo:fix/font-glyph-size→main· +17 −15 · 1 files · 1 commits · merged 2026-10-08 16:03 UTCAstro's Playroom (PPSA01325) shows area names as large title cards, for example PLAYSTATION LABO.
Since
f96a14a0rasterizes glyphs at the size the game asks for, these letters were drawn cut into bands: glyph images were still rendered into a fixed 128x128 buffer, so everything past 128 pixels was missing.Before that commit the title was whole but too small.
Glyph images now grow to the glyph's size.
The VGA fallback font keeps its 128-pixel limit, and scalable glyphs are limited to 4096 pixels only to reject absurd scales.
I left the comments so that the magic numbers are explained.
AI use
Research, implementation and tests were done with Claude Code at my direction.
I reviewed the code, and tested it as described above.
Screen captures
Screenshot of older builds as reference:

Current upstream:

After fix:

@coderabbitai[bot] on GitHub · 2026-10-08 15:00 UTC · original
📝 Walkthrough
Walkthrough
Glyph and fallback image storage now uses dynamically sized vectors instead of fixed-size arrays. TrueType glyph dimensions are limited to 4096 pixels, and buffers are sized to the glyph dimensions with at least one byte for blank glyphs. TrueType rasterization and fallback bitmap writes use the glyph width as the row stride. Fallback glyph selection and scaled dimensions remain unchanged.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🔵 Low · up to
2f8b7Extremely large TrueType glyphs can be cropped instead of using the fallback font. This is a bounded edge case; the PR carries low merge risk, though the oversized-glyph handling should be corrected.
🚥 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.@ -873,2 +873,2 @@const auto width = static_cast<uint32_t>(std::clamp(x1 - x0, 0, FONT_BITMAP_MAX_DIM));const auto height = static_cast<uint32_t>(std::clamp(y1 - y0, 0, FONT_BITMAP_MAX_DIM));const auto width = static_cast<uint32_t>(std::clamp(x1 - x0, 0, FONT_GLYPH_MAX_DIM));const auto height = static_cast<uint32_t>(std::clamp(y1 - y0, 0, FONT_GLYPH_MAX_DIM));@coderabbitai[bot] on GitHub · 2026-10-08 15:00 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject oversized TrueType glyphs instead of cropping them.
If a bitmap box exceeds 4096 pixels, these clamps reduce its dimensions and
init_stb_imagestill returns success. The rasterized glyph is cropped, rather than rejected as intended. Check the original box dimensions before allocation and return a failure for an oversized glyph.@coderabbitai[bot] on GitHub · 2026-10-08 15:00 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
c841d46b-f8f4-4612-83ff-6ce5e02b6195📥 Commits
Reviewing files that changed from the base of the PR and between
aa3b2cd57fand2f8b740fa9.📒 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-08 16:01 UTC · original
@Cosmo Thanks!