feat(libSceFreeTypeOt): provide the FreeType trigonometry and outline… #11613

Merged
noamroger merged 3 commits from upstream-pr/11613 into main 2026-11-04 17:35:41 +00:00
noamroger commented 2026-10-26 22:50:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by noamroger on 2026-10-26T22:50:06Z.


What

libSceFreeTypeOt declares six FreeType exports whose NIDs are already identified (L1uHkWTazkI FT_Sin, dojyaLKzKN0 FT_Tan, 3WpTQrvGUcU FT_Vector_Unit, ++lgV9pRsO4 FT_Outline_Decompose, weVsBCT+TTQ FT_Outline_Get_Orientation, Bhm8Injl0KA FT_Outline_Copy) but throws on all of them. libSceFreeType already implements and tests the same functions, so this PR builds them into libSceFreeTypeOt from those sources, the way OutlineBorders.cpp is already shared, and removes the six throwing stubs.

  • FT_Outline_Get_Orientation and FT_Outline_Copy move unchanged from libSceFreeType/Export.cpp to libSceFreeType/src/OutlineOrientation.cpp, so both modules compile them.
  • libSceFreeTypeOt compiles Trigonometry.cpp, OutlineDecompose.cpp and OutlineOrientation.cpp and links the bundled freetype with --exclude-libs,ALL, as libSceFreeType does.
  • FT_New_Size and FT_Request_Size keep throwing, since libSceFreeTypeOt creates no face. Their debt entry is cut to them, and a new entry records that console behaviour of this module is unverified and that the shared trigonometry source also exports FT_Cos and FT_Angle_Diff, which the 3.20 inventory does not list for this module.

Tested

Linux x86-64, full build with GCC 13. The new guest_freetype_ot test links only libSceFreeTypeOt and the bundled freetype. It compares FT_Sin, FT_Tan and FT_Vector_Unit with FreeType on 4 096 random angles, decomposition events (line, conic and cubic segments, with and without shift/delta) and orientation with FT_Outline_Decompose and FT_Outline_Get_Orientation, and checks the copy, its size mismatch and its null-source errors. All 29 guest_freetype* tests pass (libSceFreeType unchanged after the move, Ol/Ot outline border raw and patched). The public_headers tests pass, and the patched libSceFreeTypeOt.prx exports the six NIDs. tools/check_conventions.py --base origin/main passes. Not tested on a PS5.

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 (textual overlap only with #11426, #10897 and #10593: neighbouring lines in libSceFreeTypeOt Export.cpp/CMakeLists.txt, its debt file and libSceFreeType Export.cpp; no shared exports. Happy to go after any of them and rebase.)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5025828086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11613). Originally posted by [noamroger](https://github.com/noamroger) on 2026-10-26T22:50:06Z. --- ### What libSceFreeTypeOt declares six FreeType exports whose NIDs are already identified (`L1uHkWTazkI` FT_Sin, `dojyaLKzKN0` FT_Tan, `3WpTQrvGUcU` FT_Vector_Unit, `++lgV9pRsO4` FT_Outline_Decompose, `weVsBCT+TTQ` FT_Outline_Get_Orientation, `Bhm8Injl0KA` FT_Outline_Copy) but throws on all of them. libSceFreeType already implements and tests the same functions, so this PR builds them into libSceFreeTypeOt from those sources, the way `OutlineBorders.cpp` is already shared, and removes the six throwing stubs. - `FT_Outline_Get_Orientation` and `FT_Outline_Copy` move unchanged from `libSceFreeType/Export.cpp` to `libSceFreeType/src/OutlineOrientation.cpp`, so both modules compile them. - libSceFreeTypeOt compiles `Trigonometry.cpp`, `OutlineDecompose.cpp` and `OutlineOrientation.cpp` and links the bundled freetype with `--exclude-libs,ALL`, as libSceFreeType does. - `FT_New_Size` and `FT_Request_Size` keep throwing, since libSceFreeTypeOt creates no face. Their debt entry is cut to them, and a new entry records that console behaviour of this module is unverified and that the shared trigonometry source also exports FT_Cos and FT_Angle_Diff, which the 3.20 inventory does not list for this module. ### Tested Linux x86-64, full build with GCC 13. The new `guest_freetype_ot` test links only libSceFreeTypeOt and the bundled freetype. It compares FT_Sin, FT_Tan and FT_Vector_Unit with FreeType on 4 096 random angles, decomposition events (line, conic and cubic segments, with and without shift/delta) and orientation with `FT_Outline_Decompose` and `FT_Outline_Get_Orientation`, and checks the copy, its size mismatch and its null-source errors. All 29 `guest_freetype*` tests pass (libSceFreeType unchanged after the move, Ol/Ot outline border raw and patched). The `public_headers` tests pass, and the patched `libSceFreeTypeOt.prx` exports the six NIDs. `tools/check_conventions.py --base origin/main` passes. Not tested on a PS5. ### 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 (textual overlap only with #11426, #10897 and #10593: neighbouring lines in libSceFreeTypeOt Export.cpp/CMakeLists.txt, its debt file and libSceFreeType Export.cpp; no shared exports. Happy to go after any of them and rebase.) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 23:04:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T23:04:17Z.

Review: CHANGES_REQUESTED


Reviewed head ad04cc65bf76fa39d295935fe8e534a5c1562d34.

[P1] Restore the six NID-to-function export aliases. Export.cpp removes the APS5_EXPORT("NID", sceFreeTypeOt..._nid_no_patch) registrations along with the throwing stubs, but the new implementations in OutlineOrientation.cpp, OutlineDecompose.cpp and Trigonometry.cpp only define FT_*_nid_postfix functions. They do not register those functions with APS5_EXPORT. The macro in ExportMacros.hpp creates the NID_nid_no_patch_cut linker aliases used by the PRX export table; a matching function symbol alone does not preserve the six libSceFreeTypeOt exports. As a result, consumers importing these NIDs will still fail to resolve them even though the new unit test can call the functions directly.

Please add the six APS5_EXPORT aliases for L1uHkWTazkI, dojyaLKzKN0, 3WpTQrvGUcU, ++lgV9pRsO4, weVsBCT+TTQ and Bhm8Injl0KA, targeting the corresponding FT_*_nid_postfix functions. Then verify the built PRX export table contains all six NIDs; the direct-linked guest_freetype_ot test does not cover that registration. I did not rerun the reported Linux tests. Hosted eligibility, conventions, intake, labels and report pass; build/relinker jobs are skipped by path policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660260725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11613#pullrequestreview-5660260725). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T23:04:17Z. **Review:** CHANGES_REQUESTED --- Reviewed head `ad04cc65bf76fa39d295935fe8e534a5c1562d34`. **[P1] Restore the six NID-to-function export aliases.** `Export.cpp` removes the `APS5_EXPORT("NID", sceFreeTypeOt..._nid_no_patch)` registrations along with the throwing stubs, but the new implementations in `OutlineOrientation.cpp`, `OutlineDecompose.cpp` and `Trigonometry.cpp` only define `FT_*_nid_postfix` functions. They do not register those functions with `APS5_EXPORT`. The macro in `ExportMacros.hpp` creates the `NID_nid_no_patch_cut` linker aliases used by the PRX export table; a matching function symbol alone does not preserve the six `libSceFreeTypeOt` exports. As a result, consumers importing these NIDs will still fail to resolve them even though the new unit test can call the functions directly. Please add the six `APS5_EXPORT` aliases for `L1uHkWTazkI`, `dojyaLKzKN0`, `3WpTQrvGUcU`, `++lgV9pRsO4`, `weVsBCT+TTQ` and `Bhm8Injl0KA`, targeting the corresponding `FT_*_nid_postfix` functions. Then verify the built PRX export table contains all six NIDs; the direct-linked `guest_freetype_ot` test does not cover that registration. I did not rerun the reported Linux tests. Hosted eligibility, conventions, intake, labels and report pass; build/relinker jobs are skipped by path policy.
MarcZX10 commented 2026-10-26 23:33:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T23:33:12Z.

Review: APPROVED


Re-reviewed updated head a05a031d1e8b34a2771bc4fae45c884944ccb80b. The export table concern is resolved: the patched test now loads libSceFreeTypeOt.prx and resolves all six NIDs directly, while the raw-module run resolves the named helper symbols. The author also reports the NID lookup fails against the unpatched module and all 30 guest_freetype* tests pass. Hosted conventions, eligibility, labels and report pass; platform build and relinker jobs are skipped by path policy. I found no remaining blocking issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5660492927 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11613#pullrequestreview-5660492927). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T23:33:12Z. **Review:** APPROVED --- Re-reviewed updated head `a05a031d1e8b34a2771bc4fae45c884944ccb80b`. The export table concern is resolved: the patched test now loads `libSceFreeTypeOt.prx` and resolves all six NIDs directly, while the raw-module run resolves the named helper symbols. The author also reports the NID lookup fails against the unpatched module and all 30 `guest_freetype*` tests pass. Hosted conventions, eligibility, labels and report pass; platform build and relinker jobs are skipped by path policy. I found no remaining blocking issue.
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!11613
No description provided.