feat(libSceFreeType): implement the variation and multiple-master calls #10613

Merged
MarcZX10 merged 35 commits from upstream-pr/10613 into main 2026-11-10 06:54:01 +00:00
MarcZX10 commented 2026-10-24 12:54:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T12:54:25Z.


What

Adds the FreeType variation and multiple-master calls to libSceFreeType, following the bundled FreeType 2.13.3 (ftmm.c): FT_Get_MM_Var, FT_Done_MM_Var, FT_Set_Var_Design_Coordinates, FT_Get_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates, FT_Get_Var_Blend_Coordinates, FT_Set_MM_Blend_Coordinates, FT_Set_MM_Design_Coordinates and FT_Get_Multi_Master.

  • The coordinate calls convert the guest's 64-bit FT_Fixed and FT_Long arrays element by element, keep the native argument checks (including a zero count with a non-null array and the zero padding of a long array), publish the result into the guest array for the getters, and refresh the guest face after the setters because they change the face flags.
  • FT_Get_MM_Var and FT_Get_Multi_Master hand the guest the native structures: FT_MM_Var and its axes and styles are returned as the native allocation (released with FT_Done_MM_Var on the same library), and FT_Multi_Master is copied. Their public layouts match the console's LP64 ones only with a 64-bit FT_Long, so on a host with a 32-bit FT_Long (Windows) they throw for a registered face, and a coordinate outside the host FT_Fixed range throws there too.
  • Console signatures are unverified; the debt entries say so.

Commits: for each function in turn, in the order above, the implementation, its test and its debt entry.

Tested

Linux x86-64, GCC, full CMake build (Ninja, Release). guest_freetype_variations uses a minimal variable TrueType fixture (one wght axis with an fvar and a gvar table) next to a plain one and compares every call with a native face: the axis data and named-style counts returned by FT_Get_MM_Var, repeated create/release, design and blend coordinates set and read back for in-range, out-of-range and negative values with zero, one and two coordinates, the face flags after each setter, the MM-specific setters and FT_Get_Multi_Master on variable and plain faces, and the null face, null array and null library cases. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test at each of the nine stages with that check disabled in a local, uncommitted edit; all exit 0. Windows was not run. 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:4995556795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10613). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T12:54:25Z. --- ### What Adds the FreeType variation and multiple-master calls to libSceFreeType, following the bundled FreeType 2.13.3 ([ftmm.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftmm.c)): `FT_Get_MM_Var`, `FT_Done_MM_Var`, `FT_Set_Var_Design_Coordinates`, `FT_Get_Var_Design_Coordinates`, `FT_Set_Var_Blend_Coordinates`, `FT_Get_Var_Blend_Coordinates`, `FT_Set_MM_Blend_Coordinates`, `FT_Set_MM_Design_Coordinates` and `FT_Get_Multi_Master`. - The coordinate calls convert the guest's 64-bit `FT_Fixed` and `FT_Long` arrays element by element, keep the native argument checks (including a zero count with a non-null array and the zero padding of a long array), publish the result into the guest array for the getters, and refresh the guest face after the setters because they change the face flags. - `FT_Get_MM_Var` and `FT_Get_Multi_Master` hand the guest the native structures: `FT_MM_Var` and its axes and styles are returned as the native allocation (released with `FT_Done_MM_Var` on the same library), and `FT_Multi_Master` is copied. Their public layouts match the console's LP64 ones only with a 64-bit `FT_Long`, so on a host with a 32-bit `FT_Long` (Windows) they throw for a registered face, and a coordinate outside the host `FT_Fixed` range throws there too. - Console signatures are unverified; the debt entries say so. Commits: for each function in turn, in the order above, the implementation, its test and its debt entry. ### Tested Linux x86-64, GCC, full CMake build (Ninja, Release). `guest_freetype_variations` uses a minimal variable TrueType fixture (one `wght` axis with an `fvar` and a `gvar` table) next to a plain one and compares every call with a native face: the axis data and named-style counts returned by `FT_Get_MM_Var`, repeated create/release, design and blend coordinates set and read back for in-range, out-of-range and negative values with zero, one and two coordinates, the face flags after each setter, the MM-specific setters and `FT_Get_Multi_Master` on variable and plain faces, and the null face, null array and null library cases. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test at each of the nine stages with that check disabled in a local, uncommitted edit; all exit 0. Windows was not run. `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:45 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — test requests done, debt counts still open

The variation test no longer asserts the LP64 throws, but the two overlapping provider lists and stale counts in the Ot debt doc are still on this head.

What I ran

Live head c14e2ca9dc566020eea40557f7518f5f0ba1bab3 (matches batch). gh pr view for mergeability and statusCheckRollup; gh api reads of comments; git show <head>:<path> on GuestFreeTypeVariations.cpp and libSceFreeTypeOt.md; a grep count on Export.cpp. Nothing was built or run.

Results

Check Result Note
mergeability MERGEABLE, CLEAN the 28 Oct conflicts are gone
windows SUCCESS hosted
conventions SUCCESS hosted; does not check doc counts
linux SKIPPED hosted skip

Findings

  • Throw assertions (28 and 29 Oct): done. GuestFreeTypeVariations.cpp:91-93 now compares against the native reference on a null face and returns. :243 skips the multi-master loop under !kHostLong64.
  • Debt doc (29 Oct, and 1 Nov): not done. libSceFreeTypeOt.md:3 and :5 are two provider lists. :4 says 136 and :6 says 129 sceFreeTypeOtUnknown_* exports. Export.cpp has 120 unique names at head, matching the reviewer's 120. The reviewer asks to merge the lists, keep both main's stroker names and this PR's variation names, and replace the counts with the real number or omit it.

Sources

Not verified

  • The Windows coverage limitation the reviewer asks to state in the debt entries: not checked.
  • Reruns of guest_freetype_variations and public_headers: not run, no build.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732250793 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10613#pullrequestreview-5732250793). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:57:45Z. **Review:** COMMENTED --- # Reviewed — test requests done, debt counts still open The variation test no longer asserts the LP64 throws, but the two overlapping provider lists and stale counts in the Ot debt doc are still on this head. ## What I ran Live head `c14e2ca9dc566020eea40557f7518f5f0ba1bab3` (matches batch). `gh pr view` for mergeability and `statusCheckRollup`; `gh api` reads of comments; `git show <head>:<path>` on `GuestFreeTypeVariations.cpp` and `libSceFreeTypeOt.md`; a `grep` count on `Export.cpp`. Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | mergeability | MERGEABLE, CLEAN | the 28 Oct conflicts are gone | | windows | SUCCESS | hosted | | conventions | SUCCESS | hosted; does not check doc counts | | linux | SKIPPED | hosted skip | ## Findings - Throw assertions (28 and 29 Oct): done. `GuestFreeTypeVariations.cpp:91-93` now compares against the native reference on a null face and returns. `:243` skips the multi-master loop under `!kHostLong64`. - Debt doc (29 Oct, and 1 Nov): not done. `libSceFreeTypeOt.md:3` and `:5` are two provider lists. `:4` says 136 and `:6` says 129 `sceFreeTypeOtUnknown_*` exports. `Export.cpp` has 120 unique names at head, matching the reviewer's 120. The reviewer asks to merge the lists, keep both main's stroker names and this PR's variation names, and replace the counts with the real number or omit it. ## Sources - https://github.com/boykopovar/AnyPS5/blob/c14e2ca9dc566020eea40557f7518f5f0ba1bab3/core/libs/tests/GuestFreeTypeVariations.cpp#L91-L93 - https://github.com/boykopovar/AnyPS5/blob/c14e2ca9dc566020eea40557f7518f5f0ba1bab3/core/libs/tests/GuestFreeTypeVariations.cpp#L243 - https://github.com/boykopovar/AnyPS5/blob/c14e2ca9dc566020eea40557f7518f5f0ba1bab3/docs/dev/debt/libSceFreeTypeOt.md#L3-L6 ## Not verified - The Windows coverage limitation the reviewer asks to state in the debt entries: not checked. - Reruns of `guest_freetype_variations` and `public_headers`: not run, no build.
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!10613
No description provided.