feat(libSceFreeType): implement FT_Get_Font_Format and the deprecated TrueType patent calls #10579

Merged
MarcZX10 merged 14 commits from upstream-pr/10579 into main 2026-11-03 08:07:25 +00:00
MarcZX10 commented 2026-10-24 11:10:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:10:43Z.


What

Adds three libSceFreeType exports that forward to the bundled FreeType 2.13.3 through the guest face: FT_Get_Font_Format, and the deprecated FT_Face_CheckTrueTypePatents and FT_Face_SetUnpatentedHinting, which always return false in ftpatent.c. They follow the existing FT_Get_X11_Font_Format adapter, including the null and unregistered-face behaviour. Console signatures and the console library version are unverified, as for the other FreeType exports; the debt entry says so.

Commits: for each function in turn (FT_Get_Font_Format, FT_Face_CheckTrueTypePatents, FT_Face_SetUnpatentedHinting), the implementation, its test and its debt entry.

Tested

Linux x86-64, GCC, full CMake build (Ninja, Release). guest_freetype_face_compat compares the three calls with a native FT_Face for a BDF bitmap face and a TrueType face, checks the pointer equals the native face's, and covers a null and an unregistered guest face. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test and the neighbouring guest_freetype_face_info with that check disabled in a local, uncommitted edit; both exit 0. tools/check_conventions.py and git diff --check pass. No title or GPU involved.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4994881868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10579). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T11:10:43Z. --- ### What Adds three libSceFreeType exports that forward to the bundled FreeType 2.13.3 through the guest face: `FT_Get_Font_Format`, and the deprecated `FT_Face_CheckTrueTypePatents` and `FT_Face_SetUnpatentedHinting`, which always return false in [ftpatent.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftpatent.c). They follow the existing `FT_Get_X11_Font_Format` adapter, including the null and unregistered-face behaviour. Console signatures and the console library version are unverified, as for the other FreeType exports; the debt entry says so. Commits: for each function in turn (`FT_Get_Font_Format`, `FT_Face_CheckTrueTypePatents`, `FT_Face_SetUnpatentedHinting`), the implementation, its test and its debt entry. ### Tested Linux x86-64, GCC, full CMake build (Ninja, Release). `guest_freetype_face_compat` compares the three calls with a native `FT_Face` for a BDF bitmap face and a TrueType face, checks the pointer equals the native face's, and covers a null and an unregistered guest face. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test and the neighbouring `guest_freetype_face_info` with that check disabled in a local, uncommitted edit; both exit 0. `tools/check_conventions.py` and `git diff --check` pass. No title or GPU involved. ### Checklist - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 04:57:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:57:35Z.

Review: COMMENTED


Reviewed — reviewer's fix-up confirmed at head

The fix-up commit adds the canonical Api.hpp include to the one file the reviewer named, and the hosted Windows check passed at this head.

What I ran

  • Live head 2c1b05002a (matches batch).
  • gh pr view 10579 (headRefOid, statusCheckRollup); gh api GET of comments and reviews newer than 2026-10-27T02:23:11Z.
  • git show --stat of 2c1b05002a; git show of core/libs/prx/libSceFreeType/src/FaceCompat.cpp at the head.
  • Nothing was built or run.

Results

Check Result Note
eligibility, conventions, labels, report SUCCESS hosted
windows SUCCESS hosted
relinker, relinker-asan, register-context, write-watch SKIPPED hosted
linux SKIPPED hosted
merge state CLEAN hosted

Findings

  • oneandonlydean (2026-10-29T11:51:28Z): added the canonical Api.hpp include, no other changes.
    • Verified: commit 2c1b050 touches only core/libs/prx/libSceFreeType/src/FaceCompat.cpp (1 insertion), and line 1 is #include "prx/libSceFreeType/include/Api.hpp". The file defines FT_Get_Font_Format_nid_postfix (line 13) and FT_Face_CheckTrueTypePatents_nid_postfix (line 18).
  • maskym's Windows report (2026-10-27T23:06:32Z) is for an earlier head, 3440cb298f.

Sources

Not verified

  • Compilation of the include change; not built.
  • The Windows run itself; only hosted status is read.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732249932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10579#pullrequestreview-5732249932). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:57:35Z. **Review:** COMMENTED --- # Reviewed — reviewer's fix-up confirmed at head The fix-up commit adds the canonical Api.hpp include to the one file the reviewer named, and the hosted Windows check passed at this head. ## What I ran - Live head 2c1b05002a2d143e049f84f4d484879a3bb5e392 (matches batch). - gh pr view 10579 (headRefOid, statusCheckRollup); gh api GET of comments and reviews newer than 2026-10-27T02:23:11Z. - git show --stat of 2c1b05002a; git show of core/libs/prx/libSceFreeType/src/FaceCompat.cpp at the head. - Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | eligibility, conventions, labels, report | SUCCESS | hosted | | windows | SUCCESS | hosted | | relinker, relinker-asan, register-context, write-watch | SKIPPED | hosted | | linux | SKIPPED | hosted | | merge state | CLEAN | hosted | ## Findings - oneandonlydean (2026-10-29T11:51:28Z): added the canonical Api.hpp include, no other changes. - Verified: commit 2c1b050 touches only core/libs/prx/libSceFreeType/src/FaceCompat.cpp (1 insertion), and line 1 is #include "prx/libSceFreeType/include/Api.hpp". The file defines FT_Get_Font_Format_nid_postfix (line 13) and FT_Face_CheckTrueTypePatents_nid_postfix (line 18). - maskym's Windows report (2026-10-27T23:06:32Z) is for an earlier head, 3440cb298f. ## Sources - https://github.com/boykopovar/AnyPS5/blob/2c1b05002a2d143e049f84f4d484879a3bb5e392/core/libs/prx/libSceFreeType/src/FaceCompat.cpp#L1-L18 ## Not verified - Compilation of the include change; not built. - The Windows run itself; only hosted status is read.
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!10579
No description provided.