feat(libSceFreeTypeOt): implement FT_Select_Metrics, FT_Request_Metrics and FT_Match_Size #15053
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15053"
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 noamroger on 2026-11-02T12:35:41Z.
What
libSceFreeTypeOt exports three
sceFreeTypeOtUnknown_*stubs whose NIDs are the FreeType size helpers:Z8KG6700sw4FT_Select_Metrics,z9Wsaf34JA4FT_Request_Metrics andzE0V+0aouZ4FT_Match_Size (checked withtools/nid_names.py compute_nid). They only read and write publicFT_FaceRec/FT_SizeRecfields, so this PR ports them from FreeType 2.4.12ftobjs.c, the version the module is already dated to in its debt file (the three functions are identical in 2.4.11), and removes the three stubs.src/SizeMetrics.cppandinclude/SizeMetrics.hpp, on the existingGuestFaceRec,GuestSizeRequestRecandGuestBitmapSizelayouts from libSceFreeType.GRID_FIT_METRICS), the five request types, the CELL rule, the SCALES shortcut, the resolution rounding ofFT_REQUEST_WIDTH/HEIGHT, and the 0x07 / 0x17 / 0x23 errors ofFT_Match_Size.FT_Request_Metrics, zero-size rejection inFT_Match_Size).Tested
Linux x86-64, GCC 13, full build. The new
guest_freetype_ot_size_metricstest covers each request type, the resolution path, a negative width, faces without outlines, scalable and bitmap strikes, everyFT_Match_Sizeresult, and that a throwing request leaves the metrics untouched. Expected values come from FreeType 2.4.12 (tag VER-2-4-12,src/base/ftbase.c) compiled on the same machine. Outside the repository, a differential run fed 3 000 000 random faces and requests to this code and to that FreeType build, once in the default 32-bit mode and once with FT_LONG64: the 2 634 957 non-throwing cases match exactly in both builds, and none of the 164 897 throwing cases writes the metrics. All 47guest_freetype*tests pass, and the patchedlibSceFreeTypeOt.prxexports the three NIDs.tools/check_conventions.py --base origin/mainpasses. Not tested on a PS5.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)Generated with Claude Code