feat(libSceFreeType): implement FT_GlyphSlot_Oblique and FT_GlyphSlot_Embolden #10593

Merged
MarcZX10 merged 11 commits from upstream-pr/10593 into main 2026-11-06 01:10:37 +00:00
MarcZX10 commented 2026-10-24 11:43:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:43:56Z.


What

Adds FT_GlyphSlot_Oblique and FT_GlyphSlot_Embolden to libSceFreeType, following the bundled FreeType 2.13.3 (ftsynth.c). Like FT_Render_Glyph, each adapter first copies the guest slot's outline point changes into the native slot, runs the native call on the native slot, and republishes the guest slot (metrics, advance, bitmap and outline). FT_GlyphSlot_Embolden covers outline and bitmap slots. A guest outline coordinate outside the host FT_Pos range throws, which only matters where the native type is 32 bits (Windows). Console signatures are unverified; the debt entries say so.

Commits: for each function in turn (FT_GlyphSlot_Oblique, then FT_GlyphSlot_Embolden), the implementation, its test and its debt entry.

Tested

Linux x86-64, GCC, full CMake build (Ninja, Release). guest_freetype_slot_synthesis loads the square-glyph fixture through the guest and a native oracle, applies each call to both after the guest slot's outline was modified, and compares format, advance, metrics and every outline point; it also checks the outline actually changed, runs FT_GlyphSlot_Embolden on a BDF bitmap glyph and compares the bitmap, offsets and metrics, and covers null and unregistered slots. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test with that check disabled in a local, uncommitted edit; it exits 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

Rebase validation (2026-10-25)

Rebased onto upstream main at e7e3e9c1984c293f06bff08428b8c89b7b932ac2. The rebase preserved the FT_Outline_Copy implementation already on main and added this PR's two glyph-slot adapters; CMake and debt changes applied cleanly. The exact rebased head passes python3 tools/check_conventions.py --base upstream/main --head HEAD and git diff --check. The earlier focused FreeType test run described above was on the pre-rebase head. I could not rebuild it after rebasing because the checkout has no populated SDL2 submodule, and CMake system-dependency configuration stops because SDL2 development files are unavailable. No post-rebase test result is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4995093858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10593). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T11:43:56Z. --- ### What Adds `FT_GlyphSlot_Oblique` and `FT_GlyphSlot_Embolden` to libSceFreeType, following the bundled FreeType 2.13.3 ([ftsynth.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftsynth.c)). Like `FT_Render_Glyph`, each adapter first copies the guest slot's outline point changes into the native slot, runs the native call on the native slot, and republishes the guest slot (metrics, advance, bitmap and outline). `FT_GlyphSlot_Embolden` covers outline and bitmap slots. A guest outline coordinate outside the host `FT_Pos` range throws, which only matters where the native type is 32 bits (Windows). Console signatures are unverified; the debt entries say so. Commits: for each function in turn (`FT_GlyphSlot_Oblique`, then `FT_GlyphSlot_Embolden`), the implementation, its test and its debt entry. ### Tested Linux x86-64, GCC, full CMake build (Ninja, Release). `guest_freetype_slot_synthesis` loads the square-glyph fixture through the guest and a native oracle, applies each call to both after the guest slot's outline was modified, and compares format, advance, metrics and every outline point; it also checks the outline actually changed, runs `FT_GlyphSlot_Embolden` on a BDF bitmap glyph and compares the bitmap, offsets and metrics, and covers null and unregistered slots. The host CPU (Xeon E5-1620 v2) fails the startup CPU-feature gate, so I ran the test with that check disabled in a local, uncommitted edit; it exits 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 ### Rebase validation (2026-10-25) Rebased onto upstream `main` at `e7e3e9c1984c293f06bff08428b8c89b7b932ac2`. The rebase preserved the `FT_Outline_Copy` implementation already on main and added this PR's two glyph-slot adapters; CMake and debt changes applied cleanly. The exact rebased head passes `python3 tools/check_conventions.py --base upstream/main --head HEAD` and `git diff --check`. The earlier focused FreeType test run described above was on the pre-rebase head. I could not rebuild it after rebasing because the checkout has no populated SDL2 submodule, and CMake system-dependency configuration stops because SDL2 development files are unavailable. No post-rebase test result is claimed.
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!10593
No description provided.