feat(libSceFreeType): implement FT_Set_Char_Size #9309

Merged
Ondra97 merged 2 commits from upstream-pr/9309 into main 2026-10-23 01:06:23 +00:00
Ondra97 commented 2026-10-21 18:04:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-21T18:04:06Z.


What

Add FT_Set_Char_Size to the existing LP64 FreeType guest bridge. Before this change, the known PS5 3.20 NID xuY99Qcb108 had no guest provider. The adapter applies FreeType's point-size and DPI defaults, updates the guest size metrics even after a native error, and leaves the published glyph record unchanged.

I use the existing bundled FreeType 2.13.3 implementation and generated font fixture. The export name/NID comes from the PS5 3.20 inventory; behavior comes from its public implementation.

On Windows, dimensions and DPI combinations that would overflow the native 32-bit FT_Long arithmetic throw before the native call. Console ABI, FreeType-version equivalence and a title unblock remain unverified; the debt entry records those limits.

Tested

Windows 11 Pro, Ryzen 9 7900X, 32 GB RAM, NVIDIA RTX 4070 Ti SUPER. WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON.

Base: 95d17687aed6bad81082d9bbef01cb1d9c0a384c. Change: 7210515acff18da4bf8dd4bd0fa90d8e024b111f. The three feature files are byte-identical to the initially validated patch after rebasing onto this base.

  • Baseline negative control on original base cecb540a63f614d2b06cbb557c6d1f6f02475fa3 (the FreeType implementation is unchanged on the rebased base): the expanded guest_freetype_tests target fails to link against the unchanged base implementation with undefined reference to FT_Set_Char_Size_nid_postfix. This is a missing-provider check, not a baseline runtime test.
  • cmake --build build --target guest_freetype_tests guest_freetype_charmap_tests --parallel 8 and ctest --test-dir build -R '^guest_freetype(_charmap)?$' -V: 2/2 passed, no skips. Fourteen direct native request comparisons (12 success and 2 error results) compare all published size metrics and subsequent glyphs. Additional checks cover 64-bit negative arguments, oversized requests and DPI, invalid face/size precedence, independent faces, recovery, and preservation of the existing glyph record.
  • Full integration build after rebase: cmake --build build --parallel 8 passed. The validation tree temporarily included only the reviewed test alignment fix from #8310, pinned at ca55e46f98ad85861dd7567abad0c028274daca1. The affected source was restored byte-for-byte afterward (SHA-256 56e35719289aa06739d4b84f51ac781f8e5d138db8f9007d01159624d2f8466e) and is absent from this PR. The full build therefore validates this feature together with the test-only prerequisite #8310.
  • After the test/debt layout was separated from pending FreeType work, the FreeType targets were rebuilt for the final head. ctest --test-dir build -R '^(guest_font|guest_system_font|guest_font_writing_line|font_face_lifetime(_replace|_churn)?|guest_freetype(_charmap)?|patched_libraries)$' --output-on-failure: 9/9 passed, no skips; all 360 patched libraries loaded, 0 failed.
  • The patched libSceFreeType.prx export table contains NID xuY99Qcb108.
  • python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/feat-freetype-char-size: no overlap. I separated the test/debt insertion points from #8558 and the other pending FreeType PRs; the new export does not duplicate their functionality.
  • python tools/check_conventions.py --base origin/main: passed.
  • python tools/check_test_registration.py build: 1,165 test executables registered, none unregistered.
  • git diff --check: passed.

No console or game was run. The available PRAGMATA registries do not import this export, so no title unblock is claimed.

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:4956114184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9309). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-21T18:04:06Z. --- ### What Add `FT_Set_Char_Size` to the existing LP64 FreeType guest bridge. Before this change, the known PS5 3.20 NID `xuY99Qcb108` had no guest provider. The adapter applies FreeType's point-size and DPI defaults, updates the guest size metrics even after a native error, and leaves the published glyph record unchanged. I use the existing bundled FreeType 2.13.3 implementation and generated font fixture. The export name/NID comes from the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c); behavior comes from its [public implementation](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftobjs.c). On Windows, dimensions and DPI combinations that would overflow the native 32-bit `FT_Long` arithmetic throw before the native call. Console ABI, FreeType-version equivalence and a title unblock remain unverified; the debt entry records those limits. ### Tested Windows 11 Pro, Ryzen 9 7900X, 32 GB RAM, NVIDIA RTX 4070 Ti SUPER. WinLibs MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. Base: `95d17687aed6bad81082d9bbef01cb1d9c0a384c`. Change: `7210515acff18da4bf8dd4bd0fa90d8e024b111f`. The three feature files are byte-identical to the initially validated patch after rebasing onto this base. - Baseline negative control on original base `cecb540a63f614d2b06cbb557c6d1f6f02475fa3` (the FreeType implementation is unchanged on the rebased base): the expanded `guest_freetype_tests` target fails to link against the unchanged base implementation with `undefined reference to FT_Set_Char_Size_nid_postfix`. This is a missing-provider check, not a baseline runtime test. - `cmake --build build --target guest_freetype_tests guest_freetype_charmap_tests --parallel 8` and `ctest --test-dir build -R '^guest_freetype(_charmap)?$' -V`: 2/2 passed, no skips. Fourteen direct native request comparisons (12 success and 2 error results) compare all published size metrics and subsequent glyphs. Additional checks cover 64-bit negative arguments, oversized requests and DPI, invalid face/size precedence, independent faces, recovery, and preservation of the existing glyph record. - Full integration build after rebase: `cmake --build build --parallel 8` passed. The validation tree temporarily included only the reviewed test alignment fix from #8310, pinned at `ca55e46f98ad85861dd7567abad0c028274daca1`. The affected source was restored byte-for-byte afterward (SHA-256 `56e35719289aa06739d4b84f51ac781f8e5d138db8f9007d01159624d2f8466e`) and is absent from this PR. The full build therefore validates this feature together with the test-only prerequisite #8310. - After the test/debt layout was separated from pending FreeType work, the FreeType targets were rebuilt for the final head. `ctest --test-dir build -R '^(guest_font|guest_system_font|guest_font_writing_line|font_face_lifetime(_replace|_churn)?|guest_freetype(_charmap)?|patched_libraries)$' --output-on-failure`: 9/9 passed, no skips; all 360 patched libraries loaded, 0 failed. - The patched `libSceFreeType.prx` export table contains NID `xuY99Qcb108`. - `python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/feat-freetype-char-size`: no overlap. I separated the test/debt insertion points from #8558 and the other pending FreeType PRs; the new export does not duplicate their functionality. - `python tools/check_conventions.py --base origin/main`: passed. - `python tools/check_test_registration.py build`: 1,165 test executables registered, none unregistered. - `git diff --check`: passed. No console or game was run. The available PRAGMATA registries do not import this export, so no title unblock is claimed. <!-- 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. --> ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 18:04:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T18:04:57Z.


Progress report (606297f → 7210515)

📈 System libraries: 42.11% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceFreeType FT_Set_Char_Size_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323011725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9309#issuecomment-6323011725). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T18:04:57Z. --- <!-- progress-report --> ### Progress report (606297f → 7210515) 📈 **System libraries**: 42.11% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceFreeType | `FT_Set_Char_Size_nid_postfix` | </details>
Ondra97 commented 2026-10-22 00:24:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T00:24:56Z.


I am preparing a separate FT_Get_Gasp implementation. It shares only the libSceFreeType.md debt insertion with this PR; there is no shared export or runtime dependency. I will list #9309 as a merge-order dependency and rebase that debt entry after this PR merges. No changes to this branch are needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329623700 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9309#issuecomment-6329623700). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-22T00:24:56Z. --- I am preparing a separate `FT_Get_Gasp` implementation. It shares only the `libSceFreeType.md` debt insertion with this PR; there is no shared export or runtime dependency. I will list #9309 as a merge-order dependency and rebase that debt entry after this PR merges. No changes to this branch are needed.
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!9309
No description provided.