feat(libSceFreeTypeOt): implement outline bitmap export #16978

Closed
hyvvs wants to merge 6 commits from upstream-pr/16978 into main
hyvvs commented 2026-11-08 03:45:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-08T03:45:23Z.


What

Implements FT_Outline_Get_Bitmap in libSceFreeTypeOt (NID 4RRjK-Wd1lU). The Ot export now maps to the existing typed guest-layout adapter in libSceFreeType/src/OutlineBitmap.cpp, and the adapter source is included in the Ot PRX. It unwraps the guest library, converts LP64 guest outline coordinates with a host FT_Pos range check, maps guest bitmap metadata, scopes borrowed output-buffer writes with GuestArena::HostWrite, and returns native FreeType status values.

Adds a focused Ot differential CTest using the existing square, triangle and conic-curve fixtures. It compares grayscale and monochrome output byte-for-byte with the pinned native FreeType backend and covers unsupported BGRA mode and null inputs.

ABI basis: the PS5 3.20 export inventory and the public FreeType 2.4.12 declaration FT_Error FT_Outline_Get_Bitmap(FT_Library, FT_Outline*, const FT_Bitmap*). The repository's pinned backend is FreeType 2.15.0. Console runtime behavior and exact firmware-version equivalence have not been measured; raster output may differ from the firmware-era FreeType implementation.

  • Reconciled with upstream FreeTypeOt changes at d03beaf110. The PRX compiles both the existing outline bitmap adapter and the newly merged memory-record adapter; the technical-debt list retains the upstream 39 still-unidentified exports and removes the now-implemented bitmap function from the named unknown list.

Tested

  • Windows 11 / MinGW GCC 15.2 Release on merged head 2a5208730d: libSceFreeTypeOt, outline bitmap, memory, constants and raccess targets all built; CTest for guest_freetype_ot_outline_bitmap, guest_freetype_ot_memory, guest_freetype_ot_constants and guest_freetype_ot_raccess passed 4/4.
  • On merged head 2a5208730d, WSL2 Ubuntu GCC 13.3 Debug with ASan and UBSan: the outline bitmap, memory, constants, and raccess binaries built; CTest all 4/4 passed with ASAN_OPTIONS=detect_leaks=1 and UBSAN_OPTIONS=halt_on_error=1.
  • On merged head: python tools/check_conventions.py --base upstream/main and git diff upstream/main..HEAD --check passed. The fork origin/main is not the authoritative comparison base.
  • Windows PE import-table inspection confirms the differential test imports FT_Outline_Get_Bitmap_nid_postfix from libSceFreeTypeOt.prx, not the sibling libSceFreeType.prx; the Ot PRX exports the wrapper symbol. The APS5_EXPORT source mapping binds NID 4RRjK-Wd1lU to it. The patched-NID dynamic-load path was not separately executed.
  • tools/pr_overlap.py scanned the live open-PR set. It failed closed on shared-file/conflicting PR comparisons; manual review of every reported FreeTypeOt patch found no competing 4RRjK-Wd1lU implementation. Confirmed unrelated shared-file edits include #15865's CMake source-list additions and #16832's LCD-filter debt entry; #12370, #16122 and the other neighboring PRs change different exports. At the time of that ownership audit, the same function name exists in libSceFreeType as a separate provider, intentionally.

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:5208390232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16978). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-11-08T03:45:23Z. --- ### What Implements `FT_Outline_Get_Bitmap` in `libSceFreeTypeOt` (NID `4RRjK-Wd1lU`). The Ot export now maps to the existing typed guest-layout adapter in `libSceFreeType/src/OutlineBitmap.cpp`, and the adapter source is included in the Ot PRX. It unwraps the guest library, converts LP64 guest outline coordinates with a host `FT_Pos` range check, maps guest bitmap metadata, scopes borrowed output-buffer writes with `GuestArena::HostWrite`, and returns native FreeType status values. Adds a focused Ot differential CTest using the existing square, triangle and conic-curve fixtures. It compares grayscale and monochrome output byte-for-byte with the pinned native FreeType backend and covers unsupported BGRA mode and null inputs. ABI basis: the PS5 3.20 export inventory and the public FreeType 2.4.12 declaration `FT_Error FT_Outline_Get_Bitmap(FT_Library, FT_Outline*, const FT_Bitmap*)`. The repository's pinned backend is FreeType 2.15.0. Console runtime behavior and exact firmware-version equivalence have not been measured; raster output may differ from the firmware-era FreeType implementation. - Reconciled with upstream FreeTypeOt changes at d03beaf11059bad1642b6072d6be80ad2b478307. The PRX compiles both the existing outline bitmap adapter and the newly merged memory-record adapter; the technical-debt list retains the upstream 39 still-unidentified exports and removes the now-implemented bitmap function from the named unknown list. ### Tested <!-- 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. --> - Windows 11 / MinGW GCC 15.2 Release on merged head 2a5208730d646b953c7431d0904d8b7e3f6f0bbf: libSceFreeTypeOt, outline bitmap, memory, constants and raccess targets all built; CTest for guest_freetype_ot_outline_bitmap, guest_freetype_ot_memory, guest_freetype_ot_constants and guest_freetype_ot_raccess passed 4/4. - On merged head 2a5208730d646b953c7431d0904d8b7e3f6f0bbf, WSL2 Ubuntu GCC 13.3 Debug with ASan and UBSan: the outline bitmap, memory, constants, and raccess binaries built; CTest all 4/4 passed with ASAN_OPTIONS=detect_leaks=1 and UBSAN_OPTIONS=halt_on_error=1. - On merged head: python tools/check_conventions.py --base upstream/main and git diff upstream/main..HEAD --check passed. The fork origin/main is not the authoritative comparison base. - Windows PE import-table inspection confirms the differential test imports `FT_Outline_Get_Bitmap_nid_postfix` from `libSceFreeTypeOt.prx`, not the sibling `libSceFreeType.prx`; the Ot PRX exports the wrapper symbol. The `APS5_EXPORT` source mapping binds NID `4RRjK-Wd1lU` to it. The patched-NID dynamic-load path was not separately executed. - `tools/pr_overlap.py` scanned the live open-PR set. It failed closed on shared-file/conflicting PR comparisons; manual review of every reported FreeTypeOt patch found no competing `4RRjK-Wd1lU` implementation. Confirmed unrelated shared-file edits include #15865's CMake source-list additions and #16832's LCD-filter debt entry; #12370, #16122 and the other neighboring PRs change different exports. At the time of that ownership audit, the same function name exists in `libSceFreeType` as a separate provider, intentionally. ### 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

Pull request closed

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!16978
No description provided.