Skip to content

feat(libSceFreeType): expose composite glyph components - #9398

Merged
oneandonlydean merged 6 commits into
boykopovar:mainfrom
Ondra97:codex/feat-freetype-subglyph-info
Nov 1, 2026
Merged

oneandonlydean merged 6 commits into
boykopovar:mainfrom
Ondra97:codex/feat-freetype-subglyph-info

Conversation

@Ondra97

@Ondra97 Ondra97 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Add FT_Get_SubGlyph_Info to the guest FreeType bridge. After loading a composite glyph with FT_LOAD_NO_RECURSE, callers can retrieve each component's glyph index, flags, arguments and transformation through the native slot. Its private subglyphs pointer remains hidden. The wrapper widens the native matrix to signed 64-bit guest fields and preserves native output-store order and unchanged outputs on error.

The name/NID vOhW2Wdz0t4 is in the PS5 3.20 inventory. Signatures, required output pointers and error behavior follow bundled FreeType 2.13.3; console ABI and errors remain unverified in library debt. The existing font fixture builder accepts caller-provided glyf, loca and maxp tables while retaining its defaults.

Refreshed against main 3d19f3fed31be38d7196ea1bd74e29ab6cc3c9a4, retaining the public-header repair and all newer FreeType APIs and debt entries from main. The subglyph export remains declared exactly once in umbrella-reachable include/Api.hpp.

The wrapper implementation, generated-font fixture builder and subglyph regression are byte-identical to the earlier published 6443eb91420a195006d199fa6790b2c00388cede revision. The existing topic commits are retained.

Tested

Revalidated on 2026-10-30: base 3d19f3fed31be38d7196ea1bd74e29ab6cc3c9a4, submitted head bfece9d7b2b23996c95621620a2866f94e83101b. Main was merged into the existing branch to preserve its topic history.

Windows 11 Pro 10.0.26300 x64; AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (these tests use the CPU). WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies.

  • Full production relinker and libs build, patched-library checker and every executable used by the focused selection passed on the submitted sources.
  • 122/122 focused CTests passed, zero failures or skips: 57 font/FreeType/library checks and 65 public-header audit/compilation checks. All 373 patched libraries loaded, zero failures.
  • guest_freetype_subglyph executed 30 valid component comparisons and 63 error comparisons, including native parity, aliases, signed transforms, preserved error outputs and unchanged guest slots.
  • The public-header audit checked 373 libraries and 14598 exports for unique declarations and umbrella coverage.
  • The wrapper, generated-font builder and subglyph test are unchanged byte-for-byte from the previously submitted head. The debt conflict keeps both the subglyph note and main's newer advance-overflow/partial-output limitations. Main's newer stroker, corner and other API declarations remain present.
  • Conventions, strict main synchronization, registration and whitespace checks pass. Registration is an audit of registered executables, not a claim that the full test suite ran.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake --build build --target font_face_lifetime_tests guest_font_graphics_tests guest_font_metrics_tests guest_font_outline_profile_tests guest_font_rebind_renderer_tests guest_font_renderer_lifecycle_tests guest_font_scissor_tests guest_font_style_frame_tests guest_font_style_information_tests guest_font_tests guest_font_words_tests guest_font_writing_line_tests guest_freetype_advances_tests guest_freetype_bitmap_init_tests guest_freetype_bitmap_tests guest_freetype_charmap_info_tests guest_freetype_charmap_tests guest_freetype_corner_tests guest_freetype_curve_bounds_tests guest_freetype_face_info_tests guest_freetype_list_tests guest_freetype_module_properties_tests guest_freetype_names_tests guest_freetype_outline_border_tests guest_freetype_outline_mutations_tests guest_freetype_outline_tests guest_freetype_pfr_null_face_tests guest_freetype_pfr_tests guest_freetype_postscript_info_tests guest_freetype_request_size_tests guest_freetype_sfnt_names_tests guest_freetype_sfnt_tests guest_freetype_stream_tests guest_freetype_stroker_tests guest_freetype_subglyph_tests guest_freetype_tests guest_system_font_tests libs patched_libraries_tests relinker --parallel 8
ctest --test-dir build -R '^(guest_freetype.*|guest_.*font.*|font_.*|patched_libraries|public_headers.*)$' -j 4 -V --output-on-failure --no-tests=error
python core/libs/tests/test_public_headers.py --audit-only
python tools/check_test_registration.py build
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/pr9398-rebase-20261030 --jobs 4
git diff origin/main...HEAD --check

The refreshed overlap scan lists #9588 and five base-conflicting shared-file comparisons: #9933, #10589, #10602, #10606 and #10897. I inspected their shared patches: they concern glyph objects, PostScript private dictionaries, outline allocation, module/library lifetime or table validation. None adds, removes or changes FT_Get_SubGlyph_Info or the composite-font builder. #9588 already declares this PR as an ordering prerequisite; it is not a prerequisite in the other direction. No mixed-stack runtime test is claimed.

No title or PS5-hardware run, native Linux execution of this refreshed head or complete CTest suite is claimed. Console ABI and equivalence to the console's FreeType version remain unverified. Earlier revision evidence is retained below with its own revisions.

Earlier submitted-revision validation (historical)

Windows 11 Pro build 26300 x64; AMD Ryzen 9 7900X, 31.66 GiB RAM, NVIDIA RTX 4070 Ti SUPER (the font tests use the CPU). WinLibs MinGW-w64 GCC 15.2.0 UCRT POSIX SEH r7, CMake 4.3.1, Python 3.14.7, Ninja, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF, pinned recursive bundled submodules.

Tested base 17f8dfad513b134a4996991109fc9db47a3bb905, submitted head 7b43258012ca9ea059edef12ddd4696fb7f97381, on 2026-10-28:

  • The complete default all-target Windows build passed, including system libraries and test targets.
  • 115/115 focused CTests passed, zero failures or skips: 50 font/FreeType/library runtime tests and 65 public-header audit/compilation tests. All 368 patched libraries loaded with zero failures.
  • guest_freetype_subglyph executed all 30 valid component comparisons and 63 error comparisons, checking aliases, signed transforms, error-output preservation and unchanged guest slots against native FreeType.
  • The public-header audit verified 368 libraries and 13,064 exports with unique declarations and umbrella coverage.
  • Conventions, strict main-sync and whitespace checks passed. The branch is zero commits behind the tested main and merges cleanly.
  • The test-registration audit checked 1,513 test executables, with none newly unregistered. This is registration coverage, not a count of executed tests.

Commands from build_tools/p9398/s, with the supported WinLibs toolchain on PATH:

git submodule update --init --recursive
cmake -S . -B ../b -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_ONLY=OFF -DANYPS5_ENABLE_SPIRV_TOOLS=OFF -DPython3_EXECUTABLE=C:/Python314/python.exe
cmake --build ../b --parallel 8
ctest --test-dir ../b -R '^(guest_freetype.*|guest_.*font.*|font_.*|patched_libraries|public_headers.*)$' -j 4 -V --output-on-failure --no-tests=error --output-junit ../focused-9398-20261028.xml
python core/libs/tests/test_public_headers.py --audit-only
python tools/check_test_registration.py ../b
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/pr9398-main-sync-20261028 --jobs 2
git diff origin/main...HEAD --check

The refreshed overlap scan against the tested main found no conflicts among comparable PRs. It could not compose #9419, #9465, #9588, #10579, #10582, #10588, #10591, #10593, #10594, #10600, #10601, #10604, #10611, #10613, #10897 and #11613 with main. I compared their exact shared-file patches from the common ancestors: none adds, removes or changes the subglyph export. Those changes concern other APIs or NID tests. No new dependency is required, and their combined runtime behavior is not claimed as tested.

The generated TrueType fixtures exercise composite components loaded with FT_LOAD_NO_RECURSE, signed offsets, point matching, matrix variants, aliased outputs, errors and slot stability. Earlier negative controls and mutation evidence remain in the review history and belong to their stated revisions.

No title, PS5 hardware run, native Linux execution of this refreshed head or complete CTest suite is claimed. Console ABI and equivalence to the console's FreeType version remain unverified.

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

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Progress report (3d19f3f → bfece9d)

📈 System libraries: 42.56% (+0.0035%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceFreeType FT_Get_SubGlyph_Info_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceFreeType 80/83 (96.39%) 81/84 (96.43%) +0.04%

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrapper’s ABI widths match the guest record, and it stages native outputs before publishing them in the documented order. The synthetic composite-font tests cover valid components, error preservation, aliases, signed matrix values, and slot stability. The reported full build and 10/10 focused tests are detailed, with an independent Windows focused run as additional evidence. git diff --check passes and the current head merges cleanly with main.

Please rebase onto current main (4a17c71757; the test base in the PR is 0c6a5bd593) and rerun the focused FreeType tests, conventions, and overlap checks before merge. This PR is the declared prerequisite for #9399, so that follow-up can then rebase on the merged result. Hosted product build jobs are skipped. I did not run a local FreeType build or test in this environment.

danielradosa added a commit to danielradosa/AnyPS5 that referenced this pull request Oct 24, 2026
@adriadam10 adriadam10 self-assigned this Oct 25, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 25, 2026 12:35

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux run of the current head, since the description covers Windows only. On Linux FT_Fixed, FT_Int and FT_UInt have the LP64 widths, so this covers the wrapper on the other ABI.

Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON. Head 6ff3a6433 merged onto main e2d457be3. The merge is clean even though the branch is about 4,700 commits behind.

  • Build ok. All 30 freetype tests pass, guest_freetype_subglyph among them (20 of 20 repeated runs), plus patched_libraries. In the patched libSceFreeType.prx, FT_Get_SubGlyph_Info is exported as vOhW2Wdz0t4.
  • main has no stub for this export, so the test cannot link against main. Instead, I checked four mutations of the wrapper. The test catches all of them: swapping transform.xy/yx (line 87), copying outputs on a backend error (line 81), arg1 = hostArg2 (line 86) and flags = 0 (line 86).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 10589 core/libs/prx/libSceFreeType/CMakeLists.txt
core/libs/prx/libSceFreeType/include/Api.hpp
docs/dev/debt/libSceFreeType.md
PR 10606 core/libs/prx/libSceFreeType/CMakeLists.txt
core/libs/prx/libSceFreeType/Export.cpp
core/libs/prx/libSceFreeType/include/Api.hpp
docs/dev/debt/libSceFreeType.md
PR 10897 core/libs/prx/libSceFreeType/CMakeLists.txt
core/libs/prx/libSceFreeType/include/Api.hpp
docs/dev/debt/libSceFreeType.md
PR 14212 docs/dev/debt/libSceFreeType.md

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Ondra97 Thanks. Since this was opened, main requires every export to be declared exactly once in a header reachable through the library's umbrella header (prx/libSceFreeType/libSceFreeType.hpp, which includes include/Api.hpp), and no declarations in .cpp files or tests (ctest -R public_headers checks it). Here, FT_Get_SubGlyph_Info have no header declaration, and core/libs/tests/GuestFreeTypeSubGlyph.cpp declares exports, including existing ones, in a local extern "C" block. Could you merge main, declare the new exports in include/Api.hpp with the signatures you use, and have the test include prx/libSceFreeType/libSceFreeType.hpp instead of the local block?

@Ondra97

Ondra97 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Addressed in 6443eb9. I merged main (f759e165d9), added the matching FT_Get_SubGlyph_Info declaration to include/Api.hpp, and replaced the test's local extern "C" block with prx/libSceFreeType/libSceFreeType.hpp. The fixture now uses the current GuestLibrary* type.

The complete Windows build passed, followed by 111/111 focused tests with zero skips, including all 65 public-header audit/compilation tests and the subglyph regression. All 368 patched libraries loaded successfully. GitHub's conventions check passed; the hosted Windows job is still running. I updated the PR description with the tested revisions and commands.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 30, 2026
@oneandonlydean
oneandonlydean merged commit e59a3f8 into boykopovar:main Nov 1, 2026
11 of 12 checks passed
@Ondra97
Ondra97 deleted the codex/feat-freetype-subglyph-info branch November 3, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants