feat(libSceFreeType): implement FT_Get_PS_Font_Value and FT_Attach_File #10616
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10616"
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 MarcZX10 on 2026-10-24T13:07:29Z.
What
Adds
FT_Get_PS_Font_ValueandFT_Attach_Fileto libSceFreeType, following the bundled FreeType 2.13.3 (ftobjs.c).FT_Get_PS_Font_Valuequeries the Type 1 dictionary through the native call and copies the value into the guest buffer only when it fits, as natively; its value sizes follow the nativeFT_Long, so a host with a 32-bit one (Windows) throws for a registered face.FT_Attach_Fileresolves and reads the guest path likeFT_New_Faceand attaches the bytes through a memory stream, so the native call never sees a guest path. The native argument checks, the unsupported-driver error and the attached metrics (kerning from an AFM file) are the native ones.FT_Attach_Streamis left out because it takes a guestFT_Open_Argsblock.Console signatures and errors are unverified; the debt entries say so.
Commits: for each function in turn (
FT_Get_PS_Font_Value, thenFT_Attach_File), the implementation, its test and its debt entry. The test commit of the first function addsType1Fixture.hpp, which builds a minimal Type 1 font (an encrypted private dictionary with two glyphs) and a matching AFM file at run time.Tested
Linux x86-64, GCC, full CMake build (Ninja, Release).
guest_freetype_ps_font_valuecompares every dictionary key (and a few beyond the last) for two indices and several buffer lengths, byte for byte, plus the size-only query, a TrueType face, and null and unregistered faces.guest_freetype_attach_filewrites the AFM file under a temporaryapp0, attaches it to a Type 1 face through the guest and through the native API, compares the error codes and checks the kerning pair appears (-50) and stays after a second attach; it also covers a missing file, a null path, a TrueType face, and null and unregistered faces. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran both tests with that check disabled in a local, uncommitted edit; both exit 0. The public header audit (test_public_headers.py --audit-only) and all 64public_headers_compile_*batches pass. Windows was not run, and its coverage is limited: a MinGW host has a 32-bitFT_Long, soFT_Get_PS_Font_Valuethrows for a registered face there and the byte-for-byte comparison against the native call only runs whereFT_Longis 64-bit; on Windows only the null and unregistered face checks of that test and theFT_Attach_Filetest apply.tools/check_conventions.pyandgit diff --checkpass. No title or GPU involved.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)