feat(libSceFreeType): implement FT_Get_Gasp #9530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9530"
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 Ondra97 on 2026-10-22T00:24:58Z.
What
Implement the missing guest
FT_Get_Gaspquery (l4azYkX86Ds). Resolve the existing guest face to its native FreeType face and return the font's rasterizer-advice flags for the complete 32-bit ppem argument. This lets guest clients choose hinting and grayscale/monochrome rendering from the font'sgasptable.The name/NID is in the pinned PS5 3.20 inventory; the ABI follows the existing face bridge and public
FT_Int(FT_Face, FT_UInt)signature. Behavior comes directly from bundled FreeType 2.13.3 ftgasp.c and its gasp table loader. Console version/result compatibility remains unverified and is recorded in debt. No title unblock or performance improvement is claimed.Extend the existing font fixture with an optional, correctly indexed
gasptable and exercise the query through the existingguest_freetypetest. All eight synthetic fonts are checked against native FreeType and independently specified range results; rendering choices made from the returned flags also produce matching glyph bitmaps. There is no new CMake target or third-party dependency.The former merge-order predecessor #9309 is merged; the branch includes its character-size implementation and current transform and naming tests.
Tested
Rebased on upstream main
0db47b263d1019043f7d28fad4e7ee0a1ea5ec6a; tested headac06b871a9299345e55f64f7fa6e632bf02262ef. Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Ninja, Release,BUILD_TESTING=ON, bundled dependencies. CPU: AMD Ryzen 9 7900X; RAM: 32 GB; GPU: NVIDIA GeForce RTX 4070 Ti SUPER. Font rendering uses the CPU.cmake --build ../build --target relinker libs guest_freetype_tests guest_freetype_charmap_tests guest_freetype_names_tests guest_freetype_sfnt_names_tests guest_freetype_request_size_tests patched_libraries_tests guest_font_tests guest_system_font_tests guest_font_writing_line_tests font_face_lifetime_tests --parallel 8: production relinker, all patched libraries and selected runtime fixtures built successfully with submitted sources only.ctest --test-dir ../build -R '^(guest_freetype.*|guest_.*font.*|font_.*|patched_libraries)$' -V --output-on-failure --no-tests=error: 12/12 passed, no skips, 1.80 s total; 367 patched libraries loaded, 0 failed.python tools/check_conventions.py --base origin/main,python tools/check_main_sync.py --base origin/main --strict,git diff origin/main...HEAD --checkandpython tools/check_test_registration.py ../build: passed; 1,209 test executables, none built and unregistered.python tools/pr_overlap.py --branch codex/pr9530-rebase-20261023b --repo boykopovar/AnyPS5 --jobs 8: reviewed. The old #9530 head is the expected self-match; #9453 adds a throwing same-NID stub in the separatelibSceFreeTypeOllibrary. #9560 and #9574 add independent functions at shared test/include insertions; their merge order is separate from this implementation. Remaining conflicting shared debt entries describe independent bitmap, bounding-box, PostScript or platform-export work. #9545 and #9550 add separate CID/size functions and test helpers. No other open PR implements this guest query inlibSceFreeType.The include conflict preserves main's
<algorithm>/<bit>imports for outline orientation alongsideFT_GASP_H.git range-diffconfirms unchanged query and regression behavior. The original missing-feature baseline cannot link this regression because it lacksFT_Get_Gasp_nid_postfix. Console compatibility and title-level impact remain unverified.Checklist
Based on current
main; no other open PR implements the same functionsOne 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 fileNo notes, investigation
.mdfiles 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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:31:09Z.
Review: APPROVED
The wrapper delegates to the bundled FreeType 2.13.3
FT_Get_Gaspusing the mapped native face; I checked the source's null/non-SFNT, range-boundary, no-table and version-0 masking behavior against the regression's expectations. The fixture computes the SFNT search parameters from its table count, and the tests compare both the guest adapter and native FreeType across the documented range and rendering cases. The declared #9309 dependency is accurate: a direct merge conflicts only in the shared debt file. Current eligibility, conventions, intake, labels and report checks pass; product/relinker jobs are skipped. The extensive build/test evidence in the PR is author-reported; I did not run a local build or tests.'Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T00:49:56Z.
I am preparing
FT_Outline_Get_Orientationas an independent follow-up. It shares include/debt insertion points with this PR, but no exported function implementation. I will list #9530 as the merge-order dependency (which already orders #9309 first), then rebase those insertions after this PR merges. No changes to this branch are needed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:01:03Z.
Review: APPROVED
Rechecked the unchanged
FT_Get_Gaspadapter against bundled FreeType 2.13.3, including null/no-table results, range boundaries, version-0 masking and preservation of guest slot state. The regression and reported rendered-glyph comparisons cover the public behavior; #9309 remains open as the declared debt insertion predecessor. Eligibility, conventions, intake, labels and report checks pass; platform/product jobs were skipped. I did not rerun local tests.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T02:20:27Z.
I opened #9560, which adds FT_Outline_Decompose. I declared #9530 for merge order because the regression calls share an insertion, and its #9309 dependency adds separate helpers at the decomposition test-helper insertion. Retain both tests and their helpers. The implementations are independent.
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:21:49Z.
Reviewed; no issues found. The wrapper keeps the sibling pattern (
FaceOf+ null host through toFT_Get_Gasp, which answersFT_GASP_NO_TABLEfor a null face — the test pins that for both null ppems). The test's oracle is the host FreeType itself: 524304 guest/native query pairs over the full ppem range plus malformed and version-0 gasp tables, and the version-zeroflags & 3expectation matches the freetype source, so nothing in the answer space is invented. The fixture's font-table builder computes the table-directorysearchRange/entrySelectorcorrectly for the now-eight-table font (largest power of two at or below the entry count); the old hard-coded 4-table values stay byte-identical for fonts of that size, so existing tests are unaffected. Debt entry added with the exact freetype source link. Runtime stays inside the 30 s budget.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:37:52Z.
I rechecked current head
c6c78bf28c2a: it merges cleanly with today’smain, and current diff-check/conventions pass. The reported 524,304 query comparisons, 14 rendered-glyph checks and 3/3 FreeType CTest selection are strong author-reported evidence. This branch is 2 ahead / 119 behind currentmain(merge basea6dcea927); please refresh it and rerun the focused FreeType tests/checks. Keep the declared #9309 debt-file order; #9538 also uses this PR as its declared predecessor for a shared test insertion.