feat(libSceFreeType): expose raw SFNT name records #9054

Merged
santhoshkumar-dev merged 2 commits from upstream-pr/9054 into main 2026-10-22 23:13:40 +00:00
santhoshkumar-dev commented 2026-10-21 11:07:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-21T11:07:50Z.


What

Implement FT_Get_Sfnt_Name_Count and FT_Get_Sfnt_Name through the existing guest face bridge. The output uses an explicit 24-byte guest record, preserves raw bytes and byte lengths, and borrows the native face's cached strings. Failed queries leave the caller's record untouched.

This follow-up builds on #9045's Names.cpp; merge #9045 first. Its dependency on #8286 also orders the shared debt edits. The two new exports are distinct from #9045's glyph/PostScript-name APIs and from #8558's kerning work. Open, closed and merged PR searches found no existing implementation of these two functions.

Names and NIDs come from the PS5 3.20 inventory. Behavior and ownership follow bundled FreeType 2.13.3 and its public record definition. Console signatures, layout and error compatibility remain unverified and are recorded in technical debt. FT_Get_Sfnt_LangTag is absent from that inventory and is not added here.

Tested

Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON, based on upstream 0a5080477f plus #9045.

  • cmake --build build --target libs guest_freetype_sfnt_names_tests guest_freetype_names_tests guest_freetype_tests guest_freetype_charmap_tests -j6 passed, rebuilding all system libraries after the latest main changes.
  • ctest --test-dir build --output-on-failure -R '^guest_freetype(_charmap|_names|_sfnt_names)?$': 4 passed (0.08 / 0.07 / 0.07 / 0.06 s).
  • Generated TrueType fixtures check platform/encoding/language/name IDs, raw ASCII and UTF-16 bytes, embedded NULs, byte lengths, guarded output bounds, stable borrowed pointers across other queries and another face's destruction, absent name tables, null arguments and high unsigned indices. Failed queries preserve the complete output record.
  • Standalone runtime probe passed. Compiled mutations that overwrite output on an error or narrow the query index to 16 bits fail the regression.
  • Strict -Wall -Wextra -Werror source checks and repository conventions passed. The patched PRX contains B4-zPp0EATE and fbRv4M+XzL8.

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.

No title, PS5 hardware or Linux runtime was tested.

Compatibility validation (2026-10-21): temporarily combined this PR with #8247, #8286, #8289, #9045, #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: #9045, #9924, #9933
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4950560959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9054). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-21T11:07:50Z. --- ### What Implement `FT_Get_Sfnt_Name_Count` and `FT_Get_Sfnt_Name` through the existing guest face bridge. The output uses an explicit 24-byte guest record, preserves raw bytes and byte lengths, and borrows the native face's cached strings. Failed queries leave the caller's record untouched. This follow-up builds on #9045's `Names.cpp`; merge #9045 first. Its dependency on #8286 also orders the shared debt edits. The two new exports are distinct from #9045's glyph/PostScript-name APIs and from #8558's kerning work. Open, closed and merged PR searches found no existing implementation of these two functions. Names and NIDs come from the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). Behavior and ownership follow [bundled FreeType 2.13.3](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftsnames.c) and its [public record definition](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/include/freetype/ftsnames.h). Console signatures, layout and error compatibility remain unverified and are recorded in technical debt. `FT_Get_Sfnt_LangTag` is absent from that inventory and is not added here. ### Tested Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, based on upstream `0a5080477f` plus #9045. - `cmake --build build --target libs guest_freetype_sfnt_names_tests guest_freetype_names_tests guest_freetype_tests guest_freetype_charmap_tests -j6` passed, rebuilding all system libraries after the latest main changes. - `ctest --test-dir build --output-on-failure -R '^guest_freetype(_charmap|_names|_sfnt_names)?$'`: 4 passed (0.08 / 0.07 / 0.07 / 0.06 s). - Generated TrueType fixtures check platform/encoding/language/name IDs, raw ASCII and UTF-16 bytes, embedded NULs, byte lengths, guarded output bounds, stable borrowed pointers across other queries and another face's destruction, absent name tables, null arguments and high unsigned indices. Failed queries preserve the complete output record. - Standalone runtime probe passed. Compiled mutations that overwrite output on an error or narrow the query index to 16 bits fail the regression. - Strict `-Wall -Wextra -Werror` source checks and repository conventions passed. The patched PRX contains `B4-zPp0EATE` and `fbRv4M+XzL8`. 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. 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, #9045, #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: #9045, #9924, #9933 <!-- #PR, or none --> - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
github-actions[bot] commented 2026-10-21 11:08:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T11:08:29Z.


Progress report (2f161d4 → 091dc1d)

📈 System libraries: 42.44% (+0.02%, +5 implemented functions)

✅ 5 implemented
Library Name
libSceFreeType FT_Get_Glyph_Name_nid_postfix
libSceFreeType FT_Get_Name_Index_nid_postfix
libSceFreeType FT_Get_Postscript_Name_nid_postfix
libSceFreeType FT_Get_Sfnt_Name_Count_nid_postfix
libSceFreeType FT_Get_Sfnt_Name_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314448892 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9054#issuecomment-6314448892). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T11:08:29Z. --- <!-- progress-report --> ### Progress report (2f161d4 → 091dc1d) 📈 **System libraries**: 42.44% (+0.02%, +5 implemented functions) <details> <summary>✅ 5 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` | | libSceFreeType | `FT_Get_Sfnt_Name_Count_nid_postfix` | | libSceFreeType | `FT_Get_Sfnt_Name_nid_postfix` | </details>
Ondra97 commented 2026-10-22 02:20:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T02:20:25Z.


I opened #9560, which adds FT_Outline_Decompose. I declared #9054 for merge order because the patches add different source files at the same CMake source-list insertion. Retain both Names.cpp and OutlineDecompose.cpp. The implementations are independent.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331121067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9054#issuecomment-6331121067). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-22T02:20:25Z. --- I opened #9560, which adds FT_Outline_Decompose. I declared #9054 for merge order because the patches add different source files at the same CMake source-list insertion. Retain both Names.cpp and OutlineDecompose.cpp. The implementations are independent.
santhoshkumar-dev commented 2026-10-22 07:37:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T07:37:36Z.


Confirmed the merge order with #9560. This PR retains Names.cpp; the independent outline-decomposition implementation can retain OutlineDecompose.cpp alongside it when the shared source-list insertion is resolved. No export is being replaced or duplicated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6335410988 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9054#issuecomment-6335410988). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-22T07:37:36Z. --- Confirmed the merge order with #9560. This PR retains `Names.cpp`; the independent outline-decomposition implementation can retain `OutlineDecompose.cpp` alongside it when the shared source-list insertion is resolved. No export is being replaced or duplicated.
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!9054
No description provided.