feat(libSceFreeTypeOt): resolve FT_Open_Face, FT_GlyphSlot_Oblique and FT_GlyphSlot_Embolden #17776

Merged
zkiller1236 merged 2 commits from upstream-pr/17776 into main 2026-11-21 09:19:30 +00:00
zkiller1236 commented 2026-11-09 15:34:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zkiller1236 on 2026-11-09T15:34:47Z.


What

libSceFreeTypeOt exported NIDs OeNH41MA2Vs, wBKAYO7yEXw and 73vg+nRH68g as throwing placeholders (sceFreeTypeOtOpenFace, sceFreeTypeOtGlyphSlotOblique, sceFreeTypeOtGlyphSlotEmbolden). tools/nid_names.py shows they are exactly FT_Open_Face, FT_GlyphSlot_Oblique and FT_GlyphSlot_Embolden, which libSceFreeType implements. The module's other face and glyph-slot exports (FT_New_Face, FT_New_Memory_Face, FT_Load_Glyph, FT_Render_Glyph, FT_Set_Pixel_Sizes, …) already reach those libSceFreeType wrappers, so faces and slots are shared objects between the two modules.

  • Linux and macOS: the three placeholders are removed, so the NIDs resolve through the module's libSceFreeType dependency like the other face exports.
  • Windows: ForwardExports.cpp gets three typed thunks with the same NIDs, next to FT_Load_Glyph's.
  • The placeholders' leftover declarations are removed from libSceFreeType/include/Api.hpp.

The three names leave the debt file's "provider-specific prototypes unverified" list and get an entry saying their prototypes are assumed to be FreeType's public ones, unverified for the provider's version, with results, limits and throws those of the libSceFreeType wrappers over the bundled FreeType 2.15.0. This is the same approach as #17772 for two stroker exports; the two PRs are independent and merge cleanly together.

Tested

Linux x86-64, GCC, Release with BUILD_TESTING=ON, on main ffe575754a.

  • guest_freetype_ot (raw .prx, names) and guest_freetype_ot_patched (patched .prx, NIDs) pass. The test gains Synthesis(), which works entirely through the module's exports: it opens the SquareGlyphFont fixture from memory with FT_Open_Face (and checks the null-arguments and null-library error codes), sets 18 px, loads glyph 1, applies FT_GlyphSlot_Oblique or FT_GlyphSlot_Embolden, and compares the advance, metrics and every outline point with host FreeType doing the same. It also checks that the glyph has an outline and that the synthesis changed it, and calls both functions with null. On Windows these checks run only in patched mode, because the raw DLL does not export the libSceFreeType names.
  • Negative control: with main's Export.cpp, guest_freetype_ot_patched aborts with sceFreeTypeOtOpenFace_nid_no_patch not implemented.
  • The 47 other guest_freetype* tests that were built pass.
  • check_conventions.py --base origin/main passes. pr_overlap.py reports no shared exports; #10606, #15052, #16122 and #16832 edit neighbouring lines (mostly the debt file's long identified-NIDs line), and ten PRs that conflict with main could not be compared. Their diffs do not mention these NIDs or names.
  • Reviewed before opening by a separate AI reviewer (Claude Sonnet). Its suggestions are applied: the non-empty-outline and outline-changed checks, and softer wording of the prototype assumption.

Windows was not built here; PS5/title execution is untested.

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

Claude Code assisted with the investigation, implementation, tests and review.

🤖 Generated with Claude Code

https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5226498332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17776). Originally posted by [zkiller1236](https://github.com/zkiller1236) on 2026-11-09T15:34:47Z. --- ### What libSceFreeTypeOt exported NIDs `OeNH41MA2Vs`, `wBKAYO7yEXw` and `73vg+nRH68g` as throwing placeholders (`sceFreeTypeOtOpenFace`, `sceFreeTypeOtGlyphSlotOblique`, `sceFreeTypeOtGlyphSlotEmbolden`). `tools/nid_names.py` shows they are exactly `FT_Open_Face`, `FT_GlyphSlot_Oblique` and `FT_GlyphSlot_Embolden`, which libSceFreeType implements. The module's other face and glyph-slot exports (`FT_New_Face`, `FT_New_Memory_Face`, `FT_Load_Glyph`, `FT_Render_Glyph`, `FT_Set_Pixel_Sizes`, …) already reach those libSceFreeType wrappers, so faces and slots are shared objects between the two modules. - Linux and macOS: the three placeholders are removed, so the NIDs resolve through the module's libSceFreeType dependency like the other face exports. - Windows: `ForwardExports.cpp` gets three typed thunks with the same NIDs, next to `FT_Load_Glyph`'s. - The placeholders' leftover declarations are removed from `libSceFreeType/include/Api.hpp`. The three names leave the debt file's "provider-specific prototypes unverified" list and get an entry saying their prototypes are assumed to be FreeType's public ones, unverified for the provider's version, with results, limits and throws those of the libSceFreeType wrappers over the bundled FreeType 2.15.0. This is the same approach as #17772 for two stroker exports; the two PRs are independent and merge cleanly together. ### Tested Linux x86-64, GCC, Release with `BUILD_TESTING=ON`, on `main` ffe575754a. - `guest_freetype_ot` (raw `.prx`, names) and `guest_freetype_ot_patched` (patched `.prx`, NIDs) pass. The test gains `Synthesis()`, which works entirely through the module's exports: it opens the `SquareGlyphFont` fixture from memory with `FT_Open_Face` (and checks the null-arguments and null-library error codes), sets 18 px, loads glyph 1, applies `FT_GlyphSlot_Oblique` or `FT_GlyphSlot_Embolden`, and compares the advance, metrics and every outline point with host FreeType doing the same. It also checks that the glyph has an outline and that the synthesis changed it, and calls both functions with null. On Windows these checks run only in patched mode, because the raw DLL does not export the libSceFreeType names. - Negative control: with `main`'s `Export.cpp`, `guest_freetype_ot_patched` aborts with `sceFreeTypeOtOpenFace_nid_no_patch not implemented`. - The 47 other `guest_freetype*` tests that were built pass. - `check_conventions.py --base origin/main` passes. `pr_overlap.py` reports no shared exports; #10606, #15052, #16122 and #16832 edit neighbouring lines (mostly the debt file's long identified-NIDs line), and ten PRs that conflict with `main` could not be compared. Their diffs do not mention these NIDs or names. - Reviewed before opening by a separate AI reviewer (Claude Sonnet). Its suggestions are applied: the non-empty-outline and outline-changed checks, and softer wording of the prototype assumption. Windows was not built here; PS5/title execution is untested. <!-- 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 Claude Code assisted with the investigation, implementation, tests and review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo
MarcZX10 commented 2026-11-16 14:53:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T14:53:49Z.

Review: COMMENTED


Reviewed — no blocking findings

No blocking defect is visible in the reviewed changes; Windows build and PS5 behavior remain unverified.

What I ran

Reviewed head 6fd8704e1caa5ce322b994e4c7ce49514ec81cab using the prepared diff and repo_read.py for targeted source context. I did not run tests or builds. The author reports Linux tests and a negative control; those results were not independently run here.

Results

Check Result Note
Diff and targeted source review passed Five changed files inspected
Tests and builds not run Linux results are author-reported
Negative control not run Author-reported only

Negative control

Could not run a negative control in this review environment. The author reports that the patched test aborts against the previous export implementation.

Findings

Blocking

None.

Non-blocking

  • Windows forwarding is guarded by _WIN32, and the author reports that Windows was not built. A Windows build would confirm these new thunks compile and export as intended.

Sources

Not verified

  • Windows build and runtime behavior, PS5/title execution, and the provider-specific ABI and behavior on console.
  • Read the prepared diff for all five changed files: core/libs/prx/libSceFreeType/include/Api.hpp, core/libs/prx/libSceFreeTypeOt/Export.cpp, core/libs/prx/libSceFreeTypeOt/ForwardExports.cpp, core/libs/tests/GuestFreeTypeOt.cpp, and docs/dev/debt/libSceFreeTypeOt.md. Read targeted source context in the first, third, and fourth files. No changed files were excluded from the review artifacts; full-file contents beyond the relevant hunks were not read.

To get this to a good state

Nothing is required.

Optional: build the Windows target to verify the guarded forwarding thunks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5922025806 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17776#pullrequestreview-5922025806). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T14:53:49Z. **Review:** COMMENTED --- # Reviewed — no blocking findings No blocking defect is visible in the reviewed changes; Windows build and PS5 behavior remain unverified. ## What I ran Reviewed head `6fd8704e1caa5ce322b994e4c7ce49514ec81cab` using the prepared diff and `repo_read.py` for targeted source context. I did not run tests or builds. The author reports Linux tests and a negative control; those results were not independently run here. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Five changed files inspected | | Tests and builds | not run | Linux results are author-reported | | Negative control | not run | Author-reported only | ## Negative control Could not run a negative control in this review environment. The author reports that the patched test aborts against the previous export implementation. ## Findings ### Blocking None. ### Non-blocking - Windows forwarding is guarded by `_WIN32`, and the author reports that Windows was not built. A Windows build would confirm these new thunks compile and export as intended. ## Sources - [Forwarding thunks at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/6fd8704e1caa5ce322b994e4c7ce49514ec81cab/core/libs/prx/libSceFreeTypeOt/ForwardExports.cpp#L203-L216) - [Existing libSceFreeType declarations](https://github.com/boykopovar/AnyPS5/blob/6fd8704e1caa5ce322b994e4c7ce49514ec81cab/core/libs/prx/libSceFreeType/include/Api.hpp#L135-L149) ## Not verified - Windows build and runtime behavior, PS5/title execution, and the provider-specific ABI and behavior on console. - Read the prepared diff for all five changed files: `core/libs/prx/libSceFreeType/include/Api.hpp`, `core/libs/prx/libSceFreeTypeOt/Export.cpp`, `core/libs/prx/libSceFreeTypeOt/ForwardExports.cpp`, `core/libs/tests/GuestFreeTypeOt.cpp`, and `docs/dev/debt/libSceFreeTypeOt.md`. Read targeted source context in the first, third, and fourth files. No changed files were excluded from the review artifacts; full-file contents beyond the relevant hunks were not read. ## To get this to a good state Nothing is required. Optional: build the Windows target to verify the guarded forwarding thunks.
MarcZX10 commented 2026-11-21 04:52:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:52:51Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the reviewed forwarding declarations and implementations align with the existing libSceFreeType wrappers, and the included test covers the new paths.

What I ran

Reviewed head 8600fdb32bfcaab8009d0280878868ad50c5dc23. I read description.md, commits.md, manifest.json, diff.patch, all five changed source files, and the relevant libSceFreeType wrapper implementations and test setup. No commands or tests were run; the test results below are author-reported.

Results

Check Result Note
Diff and changed code passed Forwarders match wrapper signatures
Automated checks not run Reported runs not independently verified
Windows and console not run Not built or executed

Findings

Blocking

None.

Non-blocking

None.

Not verified

Linux test execution, the reported negative control, and convention and overlap checks were not independently run. Windows build and PS5/title execution were not performed. All changed files listed in manifest.json were read; no changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002928266 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17776#pullrequestreview-6002928266). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:52:51Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the reviewed forwarding declarations and implementations align with the existing libSceFreeType wrappers, and the included test covers the new paths. ## What I ran Reviewed head `8600fdb32bfcaab8009d0280878868ad50c5dc23`. I read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, all five changed source files, and the relevant libSceFreeType wrapper implementations and test setup. No commands or tests were run; the test results below are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code | passed | Forwarders match wrapper signatures | | Automated checks | not run | Reported runs not independently verified | | Windows and console | not run | Not built or executed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Linux test execution, the reported negative control, and convention and overlap checks were not independently run. Windows build and PS5/title execution were not performed. All changed files listed in `manifest.json` were read; no changed files were excluded. ## To get this to a good state Nothing is required.
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!17776
No description provided.