Repository navigation
feat(font): implement sceFontGetRenderScaledKerning - #584
Merged
oneandonlydean merged 1 commit intoOct 5, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
Return the kerning between two character codes at the render scale of the font, the one set by sceFontSetupRenderScalePixel and sceFontSetupRenderScalePoint, and fail with NOT_BOUND_RENDERER when no renderer is bound. sceFontGetKerning keeps its behaviour and shares the FreeType lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Thanks. The NID recomputes (ryPlnDDI3rU is sceFontGetRenderScaledKerning), the shared
PPSA21564 doesn't import this function. Ready to merge from my side. |
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.
What
Implements
sceFontGetRenderScaledKerning, which was a throwing stub.It returns the kerning between two character codes at the render scale of the font: the cached style that
sceFontSetupRenderScalePixel/sceFontSetupRenderScalePointwrite and that a bind copies from the font style. Without a bound renderer it returnsSCE_FONT_ERROR_NOT_BOUND_RENDERER. This is the same split assceFontGetCharGlyphMetrics/sceFontGetRenderCharGlyphMetrics.Render.cpp: the FreeType lookup ofsceFontGetKerningmoves into a helper shared by both functions;sceFontGetKerningbehaves as before.kerninggivesINVALID_PARAMETER, a bad handleINVALID_FONT_HANDLE, no rendererNOT_BOUND_RENDERER. The output is cleared on every path except the null one. A pair without kerning or a code without a glyph returns zeros andSCE_FONT_OK, assceFontGetKerningdoes.Source of the behaviour: shadPS4, which this library is ported from, has the function as a stub with no signature. The arguments, the cleared output and the renderer check come from
cellFontGetRenderScaledKerningin RPCS3 (the PS3 predecessor of the library, wherecellFontGetKerninghas the same arguments assceFontGetKerning). The kerning value itself is thesceFontGetKerningone at the render scale. None of this is confirmed on a title; it is recorded in TechnicalDebt.Does not overlap #461 (no shared source or test file; one separate line in
TechnicalDebt.md).Tested
Windows 11, MinGW-w64 GCC 15.2.0,
ctest: 217/217 pass.guest_fontis extended. The test builds a three-glyph TrueType font with acmapand akernpair of -200 units at 1000 units per em, then checks:sceFontSetupRenderScalePixel(50), -8 px aftersceFontSetupRenderScalePoint(20)at 144 dpi;sceFontGetKerningstill returns the font scale value (-20 px) after the render scale changes;Before the change the test stops at the first call with
sceFontGetRenderScaledKerning not implemented.Not tested on a title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code