feat(libSceFreeType): expose charmap metadata #9069

Merged
santhoshkumar-dev merged 2 commits from upstream-pr/9069 into main 2026-10-23 06:25:15 +00:00
santhoshkumar-dev commented 2026-10-21 11:36:00 +00:00 (Migrated from github.com)

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


What

Add FT_Get_Charmap_Index, FT_Get_CMap_Language_ID and FT_Get_CMap_Format to the guest bridge. Each query maps the original guest charmap record to the native face's corresponding charmap, without changing the selection. Language IDs return as unsigned 64-bit values and formats as signed 64-bit values under the existing LP64 guest model.

Null handles follow native FreeType. A copied or unregistered record with a non-null face throws: its private native cmap state cannot be reconstructed from a public guest snapshot. This limitation and the unverified console signatures/returns are recorded in debt.

This branch builds on #9064's shared build/test configuration and debt edits; merge it first. #8247 is merged; the remaining shared CMake edits with #8286 follow #9064's dependency order. No matching implementation was found in main or open, closed and merged PR history.

Names/NIDs are in the PS5 3.20 inventory. Signatures, null behavior and metadata queries follow bundled FreeType 2.13.3.

Tested

Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON, main 3e91c8edf5 plus #9064.

  • All system libraries built with cmake --build build --target libs guest_freetype_charmap_info_tests guest_freetype_outline_tests guest_freetype_tests guest_freetype_charmap_tests -j6.
  • Four registered FreeType tests passed (outline 0.05 s, charmap metadata 0.05 s, base 0.06 s, iteration/selection 0.07 s).
  • Generated format-4/format-12 TrueType maps check indices, different languages on different faces, unsigned language IDs 0x80000001 and 0xFFFFFFFF, both selected and unselected maps, selection preservation, null handles and copied-record rejection. A generated BDF fixture verifies the native non-SFNT defaults.
  • Strict -Wall -Wextra -Werror source checks and repository conventions passed. Compiled mutations that sign-extend language IDs or query the selected map instead of the requested map fail the regression.
  • Temporarily combined #8247, #8286, #8289, #9045, #9054, #9064 and this feature on main 3e91c8edf5. All system libraries and seven FreeType test targets built; all seven registered tests passed (0.10 / 0.09 / 0.07 / 0.07 / 0.09 / 0.05 / 0.08 s). C++ changes merged cleanly; temporary CMake/debt resolutions and merge commits are not published.
  • After restoring this branch, its four tests passed again (0.05 / 0.06 / 0.07 / 0.07 s). The packaged PRX contains edmDMsPE7Zg, 2UZg+FAym4c and MXgrzq0nh1Q.

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.

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.

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: #9064
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4950891888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9069). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-21T11:36:00Z. --- ### What Add `FT_Get_Charmap_Index`, `FT_Get_CMap_Language_ID` and `FT_Get_CMap_Format` to the guest bridge. Each query maps the original guest charmap record to the native face's corresponding charmap, without changing the selection. Language IDs return as unsigned 64-bit values and formats as signed 64-bit values under the existing LP64 guest model. Null handles follow native FreeType. A copied or unregistered record with a non-null face throws: its private native cmap state cannot be reconstructed from a public guest snapshot. This limitation and the unverified console signatures/returns are recorded in debt. This branch builds on #9064's shared build/test configuration and debt edits; merge it first. #8247 is merged; the remaining shared CMake edits with #8286 follow #9064's dependency order. No matching implementation was found in main or open, closed and merged PR history. Names/NIDs are in the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). Signatures, null behavior and metadata queries follow [bundled FreeType 2.13.3](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftobjs.c). ### Tested Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, main `3e91c8edf5` plus #9064. - All system libraries built with `cmake --build build --target libs guest_freetype_charmap_info_tests guest_freetype_outline_tests guest_freetype_tests guest_freetype_charmap_tests -j6`. - Four registered FreeType tests passed (outline 0.05 s, charmap metadata 0.05 s, base 0.06 s, iteration/selection 0.07 s). - Generated format-4/format-12 TrueType maps check indices, different languages on different faces, unsigned language IDs `0x80000001` and `0xFFFFFFFF`, both selected and unselected maps, selection preservation, null handles and copied-record rejection. A generated BDF fixture verifies the native non-SFNT defaults. - Strict `-Wall -Wextra -Werror` source checks and repository conventions passed. Compiled mutations that sign-extend language IDs or query the selected map instead of the requested map fail the regression. - Temporarily combined #8247, #8286, #8289, #9045, #9054, #9064 and this feature on main `3e91c8edf5`. All system libraries and seven FreeType test targets built; all seven registered tests passed (0.10 / 0.09 / 0.07 / 0.07 / 0.09 / 0.05 / 0.08 s). C++ changes merged cleanly; temporary CMake/debt resolutions and merge commits are not published. - After restoring this branch, its four tests passed again (0.05 / 0.06 / 0.07 / 0.07 s). The packaged PRX contains `edmDMsPE7Zg`, `2UZg+FAym4c` and `MXgrzq0nh1Q`. 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. --> 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. ### 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: <!-- #PR, or none --> #9064 - [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:36:51 +00:00 (Migrated from github.com)

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


Progress report (2f161d4 → 0ed04b2)

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

✅ 5 implemented
Library Name
libSceFreeType FT_Get_CMap_Format_nid_postfix
libSceFreeType FT_Get_CMap_Language_ID_nid_postfix
libSceFreeType FT_Get_Charmap_Index_nid_postfix
libSceFreeType FT_Outline_Check_nid_postfix
libSceFreeType FT_Outline_Get_CBox_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314946097 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9069#issuecomment-6314946097). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T11:36:51Z. --- <!-- progress-report --> ### Progress report (2f161d4 → 0ed04b2) 📈 **System libraries**: 42.44% (+0.02%, +5 implemented functions) <details> <summary>✅ 5 implemented</summary> | Library | Name | | - | - | | libSceFreeType | `FT_Get_CMap_Format_nid_postfix` | | libSceFreeType | `FT_Get_CMap_Language_ID_nid_postfix` | | libSceFreeType | `FT_Get_Charmap_Index_nid_postfix` | | libSceFreeType | `FT_Outline_Check_nid_postfix` | | libSceFreeType | `FT_Outline_Get_CBox_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!9069
No description provided.