feat(libSceFreeType): expose font and glyph names #9045

Merged
santhoshkumar-dev merged 1 commit from upstream-pr/9045 into main 2026-10-22 23:13:43 +00:00
santhoshkumar-dev commented 2026-10-21 10:42:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-21T10:42:29Z.


What

Add FT_Get_Glyph_Name, FT_Get_Name_Index and FT_Get_Postscript_Name to the existing LP64 FreeType guest bridge. A caller can retrieve glyph names, look up their glyph indices and read the face's cached PostScript name through guest-safe entry points.

Glyph-name writes hold GuestArena::HostWrite. Invalid indices are checked as nonnegative 64-bit values before entering the host routine: on Windows, narrowing a high FT_UInt to signed 32-bit FT_Long would otherwise change error precedence for fonts without glyph names. PostScript names retain the native borrowed lifetime.

Names and NIDs are present in the PS5 3.20 inventory. Signatures, output writes, lookup and ownership follow bundled FreeType 2.13.3. Console signatures and behavior remain unverified and are recorded with the existing adapter assumptions in the library's debt file.

The overlap checker reports #8286 for the shared debt paragraph only. Both PRs are ours; merge #8286 first, then rebase this documentation change. No other proposal was found for these three entry points in open, closed or merged PR history.

Tested

Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON, based on upstream b6fe513b9a.

  • All system libraries built with cmake --build build --target libs guest_freetype_names_tests guest_freetype_tests guest_freetype_charmap_tests -j 6. The three registered FreeType tests passed (0.19 s / 0.08 s / 0.07 s).
  • The new regression generates two named TrueType fonts and an unnamed font. It compares native errors and complete guarded output buffers across valid/missing glyphs and capacities 0/1/2/5/24, checks indices at and above the signed-32-bit limit, verifies reverse lookup and case sensitivity, and keeps one face's borrowed PostScript pointer while querying the others. Null faces, null strings and null output arguments are covered.
  • Compiled source mutations fail when high-index precedence is skipped for unnamed fonts or the caller's output capacity is changed.
  • Temporarily combined #8247, #8286 and #8289 with this feature: all four FreeType targets built and guest_freetype_bitmap, guest_freetype, guest_freetype_charmap and guest_freetype_names passed (0.07 s / 0.08 s / 0.07 s / 0.06 s). Only the expected debt-paragraph conflict required resolution; the temporary merge is not part of this branch.
  • Strict -Wall -Wextra -Werror source checks and repository conventions passed.
  • After restoring the independent branch, all three FreeType tests passed again (0.15 s / 0.17 s / 0.12 s). The packaged PRX exports tGmYdLIYT98, sZzliEQrICM and GVnNjpJWCXM.

Historical build limitation (2026-10-21): the default Windows build on the stated base failed at ImageArrayWindowPastLayerLimit.cpp because static alignment 65536 exceeded MinGW COFF's maximum 8192. Merged #8310 fixes that declaration; this is no longer a current-main blocker. The library/test results above retain their stated PR head and base.

Rebased onto main 0a5080477f. With the SFNT-name follow-up present, all system libraries rebuilt and the existing guest_freetype, guest_freetype_charmap and guest_freetype_names tests passed (0.08 / 0.07 / 0.07 s). The unrelated alignment failure was reproduced again through its actual CMake test target.

No title, PS5 hardware or Linux runtime was tested.

Compatibility validation (2026-10-21): temporarily combined this PR with #8247, #8286, #8289, #9054, #9064 and the charmap-metadata follow-up on main 3e91c8edf5. All system libraries built and all seven FreeType tests passed. The C++ changes merged cleanly; temporary CMake/debt resolutions were used only for this local compatibility check and are not published.

Rebase audit (2026-10-21): rebased onto main d099bc6cd8, including the now-merged #8247 and #8289. All system libraries built. A temporary combination of the seven remaining FreeType branches passed all nine tests (0.07 / 0.07 / 0.06 / 0.06 / 0.16 / 0.04 / 0.06 / 0.06 / 0.05 s); all seven branches passed conventions. Temporary integration commits were not published.

Merge coordination update (2026-10-23): new #9848 shares the test-registration insertion, with distinct source and tests. Proposed order is #8286 -> #9045 -> #9054 before #9848, retaining all registrations and its Apple import tests. Author confirmation is pending; this is not an implementation dependency.

Agreed documentation order (2026-10-23): #9924 -> #9933 -> #9045 -> #9054, preserving all PostScript metadata and naming entries. The existing #8286 prerequisite is retained. These implementations build independently; this order resolves the shared debt insertion.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #8286, #9924, #9933
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4950267071 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9045). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-21T10:42:29Z. --- ### What Add `FT_Get_Glyph_Name`, `FT_Get_Name_Index` and `FT_Get_Postscript_Name` to the existing LP64 FreeType guest bridge. A caller can retrieve glyph names, look up their glyph indices and read the face's cached PostScript name through guest-safe entry points. Glyph-name writes hold `GuestArena::HostWrite`. Invalid indices are checked as nonnegative 64-bit values before entering the host routine: on Windows, narrowing a high `FT_UInt` to signed 32-bit `FT_Long` would otherwise change error precedence for fonts without glyph names. PostScript names retain the native borrowed lifetime. Names and NIDs are present in the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). Signatures, output writes, lookup and ownership follow [bundled FreeType 2.13.3](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftobjs.c). Console signatures and behavior remain unverified and are recorded with the existing adapter assumptions in the library's debt file. The overlap checker reports #8286 for the shared debt paragraph only. Both PRs are ours; merge #8286 first, then rebase this documentation change. No other proposal was found for these three entry points in open, closed or merged PR history. ### Tested Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, based on upstream `b6fe513b9a`. - All system libraries built with `cmake --build build --target libs guest_freetype_names_tests guest_freetype_tests guest_freetype_charmap_tests -j 6`. The three registered FreeType tests passed (0.19 s / 0.08 s / 0.07 s). - The new regression generates two named TrueType fonts and an unnamed font. It compares native errors and complete guarded output buffers across valid/missing glyphs and capacities 0/1/2/5/24, checks indices at and above the signed-32-bit limit, verifies reverse lookup and case sensitivity, and keeps one face's borrowed PostScript pointer while querying the others. Null faces, null strings and null output arguments are covered. - Compiled source mutations fail when high-index precedence is skipped for unnamed fonts or the caller's output capacity is changed. - Temporarily combined #8247, #8286 and #8289 with this feature: all four FreeType targets built and `guest_freetype_bitmap`, `guest_freetype`, `guest_freetype_charmap` and `guest_freetype_names` passed (0.07 s / 0.08 s / 0.07 s / 0.06 s). Only the expected debt-paragraph conflict required resolution; the temporary merge is not part of this branch. - Strict `-Wall -Wextra -Werror` source checks and repository conventions passed. - After restoring the independent branch, all three FreeType tests passed again (0.15 s / 0.17 s / 0.12 s). The packaged PRX exports `tGmYdLIYT98`, `sZzliEQrICM` and `GVnNjpJWCXM`. Historical build limitation (2026-10-21): the default Windows build on the stated base failed at `ImageArrayWindowPastLayerLimit.cpp` because static alignment 65536 exceeded MinGW COFF's maximum 8192. Merged #8310 fixes that declaration; this is no longer a current-main blocker. The library/test results above retain their stated PR head and base. Rebased onto main `0a5080477f`. With the SFNT-name follow-up present, all system libraries rebuilt and the existing `guest_freetype`, `guest_freetype_charmap` and `guest_freetype_names` tests passed (0.08 / 0.07 / 0.07 s). The unrelated alignment failure was reproduced again through its actual CMake test target. No title, PS5 hardware or Linux runtime was tested. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Compatibility validation (2026-10-21): temporarily combined this PR with #8247, #8286, #8289, #9054, #9064 and the charmap-metadata follow-up on main `3e91c8edf5`. All system libraries built and all seven FreeType tests passed. The C++ changes merged cleanly; temporary CMake/debt resolutions were used only for this local compatibility check and are not published. Rebase audit (2026-10-21): rebased onto main `d099bc6cd8`, including the now-merged #8247 and #8289. All system libraries built. A temporary combination of the seven remaining FreeType branches passed all nine tests (0.07 / 0.07 / 0.06 / 0.06 / 0.16 / 0.04 / 0.06 / 0.06 / 0.05 s); all seven branches passed conventions. Temporary integration commits were not published. Merge coordination update (2026-10-23): new #9848 shares the test-registration insertion, with distinct source and tests. Proposed order is #8286 -> #9045 -> #9054 before #9848, retaining all registrations and its Apple import tests. [Author confirmation is pending](https://github.com/boykopovar/AnyPS5/pull/9848#issuecomment-6350286837); this is not an implementation dependency. Agreed documentation order (2026-10-23): #9924 -> #9933 -> #9045 -> #9054, preserving all PostScript metadata and naming entries. The existing #8286 prerequisite is retained. These implementations build independently; this order resolves the shared debt insertion. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #8286, #9924, #9933 <!-- #PR, or none --> - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 10:43:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T10:43:15Z.


Progress report (2f161d4 → 1bf9429)

📈 System libraries: 42.43% (+0.01%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceFreeType FT_Get_Glyph_Name_nid_postfix
libSceFreeType FT_Get_Name_Index_nid_postfix
libSceFreeType FT_Get_Postscript_Name_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314015221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9045#issuecomment-6314015221). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T10:43:15Z. --- <!-- progress-report --> ### Progress report (2f161d4 → 1bf9429) 📈 **System libraries**: 42.43% (+0.01%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceFreeType | `FT_Get_Glyph_Name_nid_postfix` | | libSceFreeType | `FT_Get_Name_Index_nid_postfix` | | libSceFreeType | `FT_Get_Postscript_Name_nid_postfix` | </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9045
No description provided.