feat(libSceFreeTypeOt): implement the FT_Vector polar calls, FT_Outline_Transform and FT_Outline_Embolden #16122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16122"
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-05T17:51:37Z.
What
libSceFreeTypeOt exports seven
sceFreeTypeOtUnknown_*stubs whose NIDs are FreeType vector and outline calls (checked withtools/nid_names.py --name):1jmC2QcpRl0FT_Vector_Length,HMcNe70D9TIFT_Vector_Polarize,2rmvbvOCyjYFT_Vector_From_Polar,6wJwUIVwAxgFT_Vector_Rotate,0Lv6K1d47jgFT_Outline_Transform,l6Cf9rb9fZQFT_Outline_Embolden andBgUMBGvhATUFT_Outline_EmboldenXY. This PR ports them and removes the seven stubs, in three commits.c6a66b49e64e), the versionFT_Library_Versionreported on a console in #15865. 2.4.12 rewrote the CORDIC (constants, 29-bit normalization, rounding) and the emboldening (normalized vectors, shifted orientation area), so the version matters for every result here.src/Polar.cpp(CORDIC fromfttrigon.c) andsrc/OutlineTransform.cpp(ftoutln.c), on the existing LP64GuestVector,GuestMatrixandGuestOutlinelayouts. Counts and contour ends are read as signedshort, as in 2.4.11.FT_LONG64is defined and not in the 32-bit build the stock configuration selects under__STDC__; results that depend on that throw, the same rule as the module's existing FT_MulDiv_No_Round. Components above 32 bits, FT_MulFix / FT_MulDiv inputs where the two builds can disagree, signed overflow, contour ends outside the points and null pointers that 2.4.11 dereferences also throw, before anything is written.FT_Outline_Get_Orientation.Tested
Linux x86-64, GCC 13, full build. The new
guest_freetype_ot_polarandguest_freetype_ot_outline_transformtests cover lengths, polar angles, rotations in every quadrant, whole-turn reduction, TrueType and PostScript contours, separate X/Y strengths, nested contours, a sharp corner, the Invalid_Argument cases, and that every throwing case leaves its outputs untouched. Expected values come from FreeType 2.4.11 (tag VER-2-4-11) compiled on the same machine. Outside the repository, a differential run fed 3 000 000 random vectors and 400 000 random outlines to this code and to that FreeType build, once in the default 32-bit mode and once withFT_CONFIG_OPTION_FORCE_INT64: every non-throwing result matches both builds exactly, and no throwing case writes anything. The 10guest_freetype_ot*,guest_freetype_cornerandguest_freetype_stream*tests pass.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