feat(libSceFreeType): expose font format and embedding flags #9090

Merged
santhoshkumar-dev merged 4 commits from upstream-pr/9090 into main 2026-10-23 06:25:13 +00:00
santhoshkumar-dev commented 2026-10-21 12:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-21T12:04:40Z.


What

Add the guest exports FT_Get_X11_Font_Format and FT_Get_FSType_Flags. They query the owned native face, return its driver format string and preserve the full unsigned 16-bit embedding flags. Null handles follow native FreeType. The generated BDF fixture is shared with the charmap-metadata regression.

Both names/NIDs are present in the PS5 3.20 inventory. The modern FT_Get_Font_Format alias is absent there and is not added. Behavior follows bundled FreeType 2.13.3's format service and FSType service. Console signatures, labels, flags and string lifetime remain unverified and are recorded in debt.

This branch builds on #9075; merge it first. #8247 is merged, and the remaining #8286 CMake dependency is ordered by that chain. No competing implementation was found in main or open, closed and merged PR history.

Tested

Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Main 47fa6eecf8 was merged into the branch before validation.

  • All system libraries and six FreeType test targets built; all six registered tests passed (0.05 / 0.06 / 0.06 / 0.06 / 0.06 / 0.19 s).
  • Generated TrueType OS/2 tables check zero, individual, combined and high embedding-flag bits through 0xFFFF; missing OS/2 and non-SFNT BDF faces follow native results. Format labels and pointers are compared with the actual native face, including multiple faces and null/empty handles. Borrowed native format strings remain readable after faces and libraries are destroyed in the test.
  • Shared BDF-fixture extraction preserves the charmap test's behavior. Strict -Wall -Wextra -Werror source checks and conventions passed.
  • Temporarily combined #8247, #8286, #8289, #9045, #9054, #9064, #9069, #9075 and this feature on main 47fa6eecf8. All system libraries and nine FreeType test targets built; all nine registered tests passed (0.23 / 0.16 / 0.08 / 0.07 / 0.07 / 0.06 / 0.07 / 0.08 / 0.12 s). C++ changes merged cleanly; temporary CMake/debt resolutions and merge commits are not published.
  • After restoring this branch, all six tests passed again (0.05 / 0.06 / 0.07 / 0.06 / 0.06 / 0.07 s). The packaged PRX contains aWMUKhiwUbk and H4eyE4ez7O4.

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: #9075
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4951235691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9090). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-21T12:04:40Z. --- ### What Add the guest exports `FT_Get_X11_Font_Format` and `FT_Get_FSType_Flags`. They query the owned native face, return its driver format string and preserve the full unsigned 16-bit embedding flags. Null handles follow native FreeType. The generated BDF fixture is shared with the charmap-metadata regression. Both names/NIDs are present in the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). The modern `FT_Get_Font_Format` alias is absent there and is not added. Behavior follows bundled FreeType 2.13.3's [format service](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftfntfmt.c) and [FSType service](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftfstype.c). Console signatures, labels, flags and string lifetime remain unverified and are recorded in debt. This branch builds on #9075; merge it first. #8247 is merged, and the remaining #8286 CMake dependency is ordered by that chain. No competing implementation was found in main or open, closed and merged PR history. ### Tested Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. Main `47fa6eecf8` was merged into the branch before validation. - All system libraries and six FreeType test targets built; all six registered tests passed (0.05 / 0.06 / 0.06 / 0.06 / 0.06 / 0.19 s). - Generated TrueType OS/2 tables check zero, individual, combined and high embedding-flag bits through `0xFFFF`; missing OS/2 and non-SFNT BDF faces follow native results. Format labels and pointers are compared with the actual native face, including multiple faces and null/empty handles. Borrowed native format strings remain readable after faces and libraries are destroyed in the test. - Shared BDF-fixture extraction preserves the charmap test's behavior. Strict `-Wall -Wextra -Werror` source checks and conventions passed. - Temporarily combined #8247, #8286, #8289, #9045, #9054, #9064, #9069, #9075 and this feature on main `47fa6eecf8`. All system libraries and nine FreeType test targets built; all nine registered tests passed (0.23 / 0.16 / 0.08 / 0.07 / 0.07 / 0.06 / 0.07 / 0.08 / 0.12 s). C++ changes merged cleanly; temporary CMake/debt resolutions and merge commits are not published. - After restoring this branch, all six tests passed again (0.05 / 0.06 / 0.07 / 0.06 / 0.06 / 0.07 s). The packaged PRX contains `aWMUKhiwUbk` and `H4eyE4ez7O4`. 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 --> #9075 - [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 12:28:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T12:28:45Z.


Progress report (2f161d4 → 114df69)

📈 System libraries: 42.46% (+0.04%, +9 implemented functions)

✅ 9 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_Get_FSType_Flags_nid_postfix
libSceFreeType FT_Get_X11_Font_Format_nid_postfix
libSceFreeType FT_Outline_Check_nid_postfix
libSceFreeType FT_Outline_Get_CBox_nid_postfix
libSceFreeType FT_Outline_Reverse_nid_postfix
libSceFreeType FT_Outline_Translate_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315906423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9090#issuecomment-6315906423). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T12:28:45Z. --- <!-- progress-report --> ### Progress report (2f161d4 → 114df69) 📈 **System libraries**: 42.46% (+0.04%, +9 implemented functions) <details> <summary>✅ 9 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_Get_FSType_Flags_nid_postfix` | | libSceFreeType | `FT_Get_X11_Font_Format_nid_postfix` | | libSceFreeType | `FT_Outline_Check_nid_postfix` | | libSceFreeType | `FT_Outline_Get_CBox_nid_postfix` | | libSceFreeType | `FT_Outline_Reverse_nid_postfix` | | libSceFreeType | `FT_Outline_Translate_nid_postfix` | </details>
Ondra97 commented 2026-10-22 03:31:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T03:31:31Z.


I opened #9588 for FT_Glyph_Get_CBox. I declared #9090 for merge order because its #9075 -> #9069 -> #9064 chain carries the same outline helpers/tests and shares the CMake/debt insertions. The inherited helper bodies and outline test match #9064 exactly. Retain one copy of those helpers plus the distinct new features.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331994692 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9090#issuecomment-6331994692). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-22T03:31:31Z. --- I opened #9588 for FT_Glyph_Get_CBox. I declared #9090 for merge order because its #9075 -> #9069 -> #9064 chain carries the same outline helpers/tests and shares the CMake/debt insertions. The inherited helper bodies and outline test match #9064 exactly. Retain one copy of those helpers plus the distinct new features.
santhoshkumar-dev commented 2026-10-22 07:37:40 +00:00 (Migrated from github.com)

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


Confirmed the dependency chain. Merge our branches in this order: #8286, #9064, #9069, #9075, then #9090. #9588 follows those prerequisites together with its other declared dependencies. Keep one copy of the inherited outline helpers/tests while retaining the distinct font-property, outline-mutation, charmap-metadata and glyph-query features.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6335412016 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9090#issuecomment-6335412016). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-22T07:37:40Z. --- Confirmed the dependency chain. Merge our branches in this order: #8286, #9064, #9069, #9075, then #9090. #9588 follows those prerequisites together with its other declared dependencies. Keep one copy of the inherited outline helpers/tests while retaining the distinct font-property, outline-mutation, charmap-metadata and glyph-query features.
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!9090
No description provided.