19 Commits
Author SHA1 Message Date
AdriàandClaude Sonnet 5.5 35f854562e test(libSceFont): pin horizontal writing steps on a single baseline
Test adapted from JAB-dev's comment on #5209.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 12:51:02 +01:00
Adrià 63d5eb00e4 Merge pull request #10892 from EagleBearerYS/feat/scefont-glyph-render-image-v2
feat(libSceFont): render generated glyphs with sceFontGlyphRenderImage
2026-10-27 07:59:02 +01:00
Yunus Shaikh 7d86f79ebe fix(libSceFont): follow the module's frame order and leave vertical glyph renders unimplemented
BunnyFl ran firmware 13.42's libSceFont natively against this PR's
checks. With both set, the surface's style frame wins over the argument,
so it is now taken first. A frame that sets no scale, zeroed or only
initialised, is accepted and keeps the glyph's generation scale instead
of returning SCE_FONT_ERROR_INVALID_PARAMETER. A valid
sceFontGlyphRenderImageVertical call, and sceFontGlyphRenderImage on a
vertical font, throw again: the module draws the char call's pixels
there but reports a different advance and stride (40/40 against 90/90
at 40 px), and one case doesn't name the rule.

The test drops the vertical comparison and the non-renderer pointer
check, whose result in the module depends on memory past the pointer,
and checks the frame order and the unscaled frames.
2026-10-26 05:05:24 -07:00
Dean fd450a5b9b Merge pull request #8997 from HQasper/claude/project-thread-wjykmu
fix(libSceFont): select the Hangul Light system font
2026-10-26 11:08:35 +13:00
Yunus Shaikh 380803b26d test(libSceFont): compare glyph image surface offsets as checked integers
SameImage subtracted each render output's surface address from its own
pixel buffer's pointer. Convert both to integers instead, check that the
update rectangle starting at that address lies inside the buffer, and
compare the offsets.
2026-10-25 07:17:07 -07:00
Yunus Shaikh 68820535b9 feat(libSceFont): render generated glyphs with sceFontGlyphRenderImage
Draw a glyph from sceFontGenerateCharGlyph through the sceFontRenderCharGlyphImage rasterizer at the glyph's own scale, with the renderer argument checked as sceFontBindRenderer checks it and the style frame argument, else the surface's frame, applied as surface frames are. The horizontal and vertical forms place the image like their character forms. The three functions build on RenderCodeWithStyle and ApplyStyleFrame from the previous commit and move out of Unimplemented.cpp.
2026-10-25 07:27:44 +00:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
xandClaude Sonnet 5.5 c0024158db fix(libSceFont): measure glyphs through a zero-extent render surface
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

Claude-Session: https://claude.ai/code/session_01QLz9JYSXCPssYHgRW1CxJH
2026-10-22 22:16:45 -05:00
Dean a661d12e30 Merge pull request #8375 from orezraey/fix/font-system-fonts-wide-env
fix(libSceFont): open fonts and the system font directory under non-ASCII paths on Windows
2026-10-23 08:54:15 +13:00
maximaxi01 a4079e9d4c fix(libSceFont): select the Hangul Light system font 2026-10-21 08:26:13 +00:00
Dean 083a3be61c Merge pull request #8058 from HQasper/claude/project-thread-md0z38
feat(libSceFont): open the other script files of a system font set
2026-10-21 06:26:24 +13:00
orezraeyandClaude Opus 5.5 162a705447 fix(libSceFont): open fonts and the system font directory under non-ASCII paths on Windows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 08:42:54 -03:00
Claude bff194647a feat(libSceFont): open the other script files of a system font set
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-19 18:31:56 +00:00
milescovielloandClaude Opus 5.5 41c75d2658 fix(libSceFont): say once where system fonts were looked for when a set has none
Without system font files, sceFontOpenFontSet returns
SCE_FONT_ERROR_FONT_OPEN_FAILED and logs `file=(none)` for each call.
Some titles then fail far from the cause: Astro's Playroom (PPSA01325)
lays out text with the failed set and stops on an out-of-heap or invalid
texture assertion (#7714). The first such open now prints the font set
and the directory searched to stderr, with how to supply the fonts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 02:54:37 +00:00
Yassine a44e70957a fix(libSceFont): report vertical glyph metrics
sceFontGetCharGlyphMetrics and sceFontGetRenderCharGlyphMetrics set the
vertical bearing and advance to zero although the glyph is loaded with
FT_LOAD_VERTICAL_LAYOUT. The library's own text writing steps the pen by
that vertical advance, so every character of vertical text was placed on
the previous one.

The vertical metrics now follow the FreeType driver's metrics of a
rendered glyph: FreeType's vertical advance, and for a face without
vertical metrics a bearing of half the horizontal advance left of the
horizontal bearing and of half the advance left over by the glyph height.

guest_system_font checks every metric of a square glyph at 100 pixels.

(cherry picked from commit 04dd69f806379df8b52cfdeb2979f2595973a9b3)
(cherry picked from commit 11f6f9e954756ee8d4a3fc2be574ab3b57ecd7c5)
2026-10-10 21:23:19 +13:00
boykopovar e5cd1c6079 test(font): avoid deleting an open system font on windows 2026-10-08 17:37:40 +03:00
Adrià FranchandClaude 25000541ad test: give fixed temp files a random suffix so parallel runs don't collide
Co-Authored-By: Claude <[email protected]>
2026-10-08 08:31:16 +02:00
Edgar MaurelandClaude Opus 5.5 241299bf01 test(font): move the console font aside instead of deleting it while its face is mapped
On Windows 10 a file with a mapped view cannot be deleted, and FreeType's
Windows stream keeps the face's file mapped, so removing SST-Bold.otf threw
and ended guest_system_font. Moving it out of the font directory leaves
nothing at the original path and works on every host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 18:26:20 +02:00
Dean Galvin 9d4e6d2f28 feat(font): open system font sets from a font directory
sceFontOpenFontSet failed for every set type, so PPSA21564 drew no text
in system fonts (the title screen copyright line, credits, button
guides). It now loads the set's primary font file from
ANYPS5_SYSTEM_FONTS, or anyps5-fonts beside the executable: console
files under their own names first, then openly licensed substitutes
(Noto Sans, Noto Sans Mono, Noto Sans Thai, Noto Sans CJK). The
PS5-only JG2 set types are accepted.

System font handles use the system font context. Their faces are
loaded by FreeType in host memory: about 1 MiB per CJK face does not
fit the font memory the title sizes for the console's fonts, and
sceFontCreateRenderer then failed with ALLOCATION_FAILED. Handles of
the same font file share one copy of its bytes.
2026-10-06 10:27:09 +13:00