feat(libSceFreeType): expose PostScript font information #9924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9924"
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 santhoshkumar-dev on 2026-10-22T22:00:37Z.
What
Add
FT_Get_PS_Font_Info(JQyLCevN3aM) andFT_Has_PS_Glyph_Names(x8y0qzLiYOU) to the guest FreeType bridge. Font information is copied field by field into an explicit 56-byte LP64 guest record; this preserves the 64-bit italic-angle field and the following byte/16-bit fields on Windows. Strings remain borrowed from the face. Errors preserve the output and neither query refreshes unrelated guest face/slot state. The reliability query uses the font driver's PostScript service, rather than the face flag for merely having glyph names.Names/NIDs match the PS5 3.20 inventory. The record and behavior follow bundled FreeType 2.13.3 t1tables.h and fttype1.c. Console ABI/backend equivalence remains unverified and is recorded in debt.
Each implemented export is declared once in the canonical public API, included by the implementation and tests. The branch preserves the latest upstream PFR APIs and all merged FreeType features.
The named OT-provider import-resolution helpers also have one declaration each in the shared public API already reachable from the OT umbrella. Export.cpp includes that header. Their existing zero-argument placeholder signatures, explicit NID aliases and throwing behavior are unchanged; this does not establish the console prototypes.
The adapter belongs to physical
libSceFreeType. Same-NID inventory stubs in the distinct physicallibSceFreeTypeOlandlibSceFreeTypeOtproviders remain throwing helpers. The entries introduced by #9453/#9462 are those provider stubs, rather than another implementation of this adapter.Tested
Submitted and tested head
b2a5fccfb1f8748cd4ae155fcf7c7527796edff0, including upstream main5d52b06ff3de0b2ce640dd296db465295c80e7fa.Windows 11 x64 / WinLibs GCC 15.2.0 r7 and local Ubuntu 24.04.1 x86-64 under WSL2 / GCC 13.3.0 / glibc 2.39: Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF. On each platform the completelibstarget and selected test executables build, and 70/70 CTests pass, zero skips: the public-header audit, all 64 public-header compilation batches and 5 focused runtime tests. Dependencies use the pinned submodule revisions. The feature, existing base/charmap APIs and packaged-library loader are covered. Both normal-symbol and actual packaged-NID modes run for the feature.Final upstream recheck:
801d5b9bc11049e6274daca09d70690bd5b8d0a9merges cleanly, and no files changed by this contribution have changed after the tested base. Results remain pinned to the exact submitted head and its stated base.Conventions, whitespace and all six pairwise merge checks across the four currently open contributions pass. Open/closed/merged history was rechecked; no replacement implementation was found. No title or physical-console execution is claimed.
The earlier macOS report by @jotitadev used Apple M2 Max, macOS 27.2, Xcode 27 and x86-64 under Rosetta on #8658 at
fa063d8b07plus the original diff and conditional libc-link fix. That host-support PR was closed for splitting. It remains attributed historical evidence; no fresh macOS runtime host is available here, so validation on the current macOS stack remains outstanding. No title or physical-console execution is claimed.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 MarcZX10 on 2026-10-23T05:47:38Z.
Review: COMMENTED
The explicit guest record and field-by-field mapping are well tested against bundled FreeType; current-main conventions and whitespace pass. Current
check_main_sync.pyreports a conflict indocs/dev/debt/libSceFreeType.mdplus sharedcore/libs/CMakeLists.txt, while the implementation/test paths remain unchanged since the base. Please refresh the debt/CMake changes and retain the documentation ordering with #9933 and the already-merged entries.\n\nThe live overlap checker also flags NIDsJQyLCevN3aMandx8y0qzLiYOUin open #9453/#9462. Those are pending declarations inlibSceFreeTypeOl/libSceFreeTypeOt, whereas this PR implements inlibSceFreeType; I found no duplicate implementation. Please mention that library-scoped distinction in the overlap notes so the checklist claim is unambiguous.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:47:40Z.
Review: CHANGES_REQUESTED
Please refresh onto current main and resolve the reported conflict in
docs/dev/debt/libSceFreeType.mdwhile preserving the sharedcore/libs/CMakeLists.txtregistration and required debt ordering. The implementation/tests otherwise look sound, and the author-reported Windows build and 5/5 focused CTests are strong. Also clarify the overlap detector’s same-NID entries in open #9453/#9462: those are stubs in the distinctlibSceFreeTypeOl/libSceFreeTypeOtmodules, while this PR implementslibSceFreeType; recording that module distinction makes the no-duplicate checklist auditable.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-23T06:14:09Z.
Review: COMMENTED
macOS test:
guest_freetype_postscript_info_nidloads the unpatched libcApple M2 Max, macOS 27.2, Apple clang (Xcode 27), x86-64 Release build under Rosetta 2,
BUILD_TESTING=ON, full default build. Head7f4475e595.maindoes not build on macOS, so the platform is #8658 (feat/macos-port) @fa063d8b07with this PR's diff applied (3-way, no conflicts there; GitHub reports a conflict with currentmain).guest_freetype_postscript_infopasses.guest_freetype_postscript_info_nidaborts:guest_freetype_postscript_info_testslinkslibcon every platform, so the process starts withunpatched/libc.prxloaded. Both libc builds have the install name@rpath/libc.prx, so when the patchedlibSceFreeType.prxasks for@rpath/libc.prx, dyld reuses the unpatched image that is already loaded, and it has no NID exports.Linking
libconly on Windows inPostScriptInfo.cmake, asguest_jxr_lookup_testsin #9954 does, fixes it here:With that change both tests pass 3/3 (
--repeat until-fail:3). I did not run Linux here, but the same pattern failed on Linux in #9646 (patched tests could not resolve NIDs untillibcwas linked only on Windows), so this is likely not macOS-only. #9785 has the same pattern.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T06:17:04Z.
Review: CHANGES_REQUESTED
Follow-up on exact head
7f4475e5952532219815234d8810f26cb9b42b5d: a focused Apple Clang/macOS run now confirms the newguest_freetype_postscript_info_nidtest fails for the same loader collision found in #9933.PostScriptInfo.cmakelinkslibcunconditionally, causing dyld to load unpatchedlibc.prxbefore the patched FreeType PRX resolves its libc dependency;_QuRm8bUpMP0is then missing. Please linklibconly for Windows (or provide another platform-correct patched-library resolution) and rerun both focused CTests on macOS. The reported conditional-link change passes 3/3. Current-main sync still reports thedocs/dev/debt/libSceFreeType.mdconflict and sharedcore/libs/CMakeLists.txt, so also retain the previously requested refresh and overlap distinction for #9453/#9462. The implementation tests reported on Windows do not cover this macOS test setup.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:27:13Z.
Review: CHANGES_REQUESTED
Re-reviewed exact submitted head
b2a5fccfb1f8748cd4ae155fcf7c7527796edff0. The author’s Windows and WSL/Linux report is comprehensive: completelibsbuilds, public-header audit and 64 header batches, plus 5 focused runtime cases (70/70 selected CTests on each platform). The prior macOS loader issue is addressed in the test CMake by linking the unpatchedlibconly on Windows; the remaining Mac/console limits are stated. I independently checked the current-main merge preview (git merge-treeis clean),git diff --checkandtools/check_conventions.pyagainst livemainba5b5330b37724bca4b99f30faab504653635a04; both checks pass.The tested base in the description is
5d52b06ff3, and the claimed final recheck801d5b9bc1predates live main. Since that base, main has changed this contribution’s shared integration paths:core/libs/CMakeLists.txt, the FreeType module CMake/API/guest headers, andlibSceFreeTypeOt/Export.cpp. These affect target registration, public declarations and the corresponding same-NID throwing helper. Please merge live main while retaining the PostScript API and loader fix, then rerun the focused FreeType tests, public-header check and conventions on that integrated head. The current clean merge preview and the earlier 70-test report do not validate those later shared-path changes; I did not rerun the C++ suite locally.