feat(libSceFreeType): support per-face x-height limits #12668
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12668"
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?
Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-29T01:09:58Z.
What
Implement
autofitter/increase-x-heightin the existingFT_Property_Get/FT_Property_Setbridge. These calls currently throw despite the bundled backend supporting the property. Translate the carrier's guest face through the existing face bridge, forward to native FreeType, and copy only the 32-bit limit back after a successful getter.The carrier and behavior follow bundled FreeType 2.13.3. This lets callers configure auto-hinter x-height rounding per face. Other unsupported properties still throw; console ABI and property availability remain documented as unverified.
Tested
Windows, GCC 15.2.0, Release full-runtime configuration:
libSceFreeTypeandnid_patcher; rebuilt the dynamic guest test executable and required runtime artifacts with their CMake-generated recipes.ctest --test-dir build -R '^guest_freetype_module_properties(_nid)?$' --output-on-failure: 2/2 passed, using normal symbols and NIDs.FT_Property_Get_nid_postfix not implementedexception before the adapter was added.pr_overlap.py --branch codex/freetype-increase-x-heightchecked 1,392 open PRs. Manually checked shared headers/debt for #9419, #9465 and #10897, whose unrelated conflicts prevent automatic comparison; those shared files merge cleanly with this change and contain no duplicate property implementation.No title or console hardware validation.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T03:58:50Z.
Review: APPROVED
Checked
d2ce672d13on macOS arm64 (Apple clang, ASan+UBSan). This is the first run outside Windows.Differential against bundled FreeType. I built FreeType from the submodule commit 42608f77f2 and linked the PR's
ModuleProperties.cppunmodified into a standalone harness, with a realFaceOfand aGuestFacewrapping a host face. For each of the 370 system faces in/System/Library/Fontsand/Library/Fonts:FT_LOAD_FORCE_AUTOHINTon the first 64 glyphs at 16 px, comparing the error, height/bearing and outline points against a native face given the same property.Across those faces the harness also checks byte-exact carrier buffers (0xA5/0xCC fill, so only bytes 8..11 change on a successful get, and the setter input is untouched), plus null-face and orphan-face (
internal == nullptr) gets. Result: 185,021 calls, 0 diffs, 0 sanitizer reports, 3.9 s. Main'sModuleProperties.cppstops atFT_Property_Get_nid_postfixnot implemented, as the body says.Mutants (applied to the PR source):
face = nullptrQueryIncreaseXHeight(nullptr)storage comparison should catch it, but I did not run the guest testThe forwarding matches
afmodule.cL185/L334:af_property_get_face_globalsreturns Invalid_Face_Handle for a null face and builds the globals lazily, so passingface->hostand copying back only on!erroris right.merge-treeagainst mainb433c40f2fis clean, andcheck_conventions --base upstream/mainpasses.Non-blocking:
FaceOftrustsinternal, as the other face-taking exports do, so a stale guest face behaves the same here as it does elsewhere.