feat(libSceFreeType): implement advance queries #9399
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9399"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-21T20:38:30Z.
What
The FreeType guest bridge lacks
FT_Get_AdvanceandFT_Get_Advances. Add both exports using the bundled FreeType 2.13.3, with 32-bit glyph indices/flags and 64-bit guestFT_Fixedoutputs.Preserve validation order, empty ranges, fast-only failures, scaling and partial results on LP64 hosts. Synchronize glyph-slot snapshots when the fallback loads glyphs and when the CFF fast path loads glyphs without SFNT metrics; leave unrelated guest outline edits intact on paths that do not load glyphs. Publish outputs after synchronization so an output aliased to the guest slot is retained.
On Windows, successful native 32-bit
FT_Fixedresults are widened. Backend errors other thanUnimplemented_Featurethrow because the native buffer does not identify which results were written. This restriction, host overflow behavior and the unverified console ABI/version are recorded in debt.Export names are in the PS5 3.20 FreeType inventory. Behavior follows bundled ftadvanc.c and cffdrivr.c. No open PR implementing these two functions was found in the refreshed search.
Merge ordering: #9398 goes first because both PRs insert a debt note at the same location. This is a documentation ordering dependency; the advance-query implementation does not require its code. After #9398 merges, rebase this PR onto updated upstream
main, retain both debt notes, and rerun conventions and overlap checks before pushing.Both advance exports are declared once in
include/Api.hpp, reachable throughprx/libSceFreeType/libSceFreeType.hpp. The implementation and advance test include the umbrella header; the test usesGuestLibrary*and has no local export declarations. Upstreammainthrough86fb985abbhas been merged.The refreshed overlap check also reports #9588 at the CMake source-list insertion point. It adds glyph APIs, not advance queries; neither implementation requires the other. Comparisons for several stale FreeType PRs remain incomplete because they conflict with
main.Tested
2026-10-28 update, after merging upstream
main: Ubuntu 24.04 x86-64 Docker on Apple Silicon, GCC 13.3, Release, bundled dependencies.libSceFreeType, libc/libkernel dependencies and the three focused FreeType test targets.ctest --test-dir /tmp/anyps5-build -R '^public_headers' --output-on-failure -j 4: 65/65 passed, including the export declaration audit and all standalone-header compilation batches.ctest --test-dir /tmp/anyps5-build -R '^guest_freetype(_charmap|_advances)?$' --output-on-failure -V: 3/3 passed.python3 tools/check_conventions.py --base origin/mainandgit diff --check: passed. Refreshed the branch overlap check against upstreammain.Ubuntu 24.04 x86-64 Docker container on an Apple Silicon Mac, GCC 13.3, Release, bundled dependencies, base
0c6a5bd5938fde7bbc0bf720927c4584bd3e4700.BUILD_TESTING=ON; built the actual FreeType shared library, its libc/libkernel dependencies, all three registered FreeType test targets andnid_patcher.ctest --test-dir /tmp/anyps5-build -R "^guest_freetype(_charmap|_advances)?$" --output-on-failure -V: 3/3 passed (guest_freetype_advances,guest_freetype,guest_freetype_charmap; total 0.16 s).-Wall -Wextra -Werrorcompilation passed. Compiled mutations that suppress CFF synchronization or copy 32-bit output slots fail the regression.dMSDtQsYuJMandl55oKq6zmrA.git merge-treecheck confirmed a documentation conflict with #9398 indocs/dev/debt/libSceFreeType.md; the implementations do not overlap.Windows runtime, PS5 hardware, commercial titles and the full test suite were not tested.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-21T22:13:56Z.
Marked as dependent on #9398 .
Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T22:41:44Z.
Windows run of
59d661a231merged ontomaina6dcea9279(821d56531c, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceFreeTypeandguest_freetype_advances_testswith no errors or warnings.ctest --repeat until-fail:2onguest_freetype_advances: passes on both repeats. Not run: a title.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T05:41:58Z.
Review: DISMISSED
The adapters follow the bundled FreeType 2.13.3 implementation and preserve the documented partial-result and slot-synchronization behavior. The fixture coverage is strong, including malformed glyph data, aliased outputs, fast-only failures, CFF paths, and platform-specific
FT_Fixedhandling. The reported full target build and focused 3/3 test run, plus the independent Windows focused run, are useful evidence.git diff --checkpasses and the current head merges cleanly withmain.The declared
Depends on: #9398matches the shared debt-entry conflict. Once #9398 lands, please rebase this branch onto then-currentmain(currently4a17c71757) and rerun the focused FreeType tests, conventions, and overlap checks. The recorded Linux tests use base0c6a5bd593; hosted product build jobs are skipped. I did not run a local FreeType build or test in this environment.