Skip to content

feat(libSceFreeType): expose CID font metadata - #9545

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
Ondra97:codex/feat-freetype-cid-metadata
Oct 24, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
Ondra97:codex/feat-freetype-cid-metadata

Conversation

@Ondra97

@Ondra97 Ondra97 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Expose the three CID-font metadata queries through the existing guest-to-native face bridge:

Export NID
FT_Get_CID_Registry_Ordering_Supplement Pr3eI2uGgvU
FT_Get_CID_Is_Internally_CID_Keyed p-LFZYbDPDU
FT_Get_CID_From_Glyph_Index NLwiYXdX5WU

Return the native registry/ordering/supplement, CID-keyed status and character-string-index/CID mapping, including the native errors and output initialization for unsupported or null faces. Optional and aliased output pointers retain the native behavior. Compile-time checks establish a one-byte FT_Bool and four-byte FT_Int/FT_UInt; registry and ordering strings remain owned by the corresponding native face.

The names/NIDs match the pinned PS5 3.20 inventory. The contracts come from bundled ftcid.c, its CFF metadata service and the public CID API. Console ABI/version and metadata equivalence remain unverified and are recorded in library debt.

The regression creates its own small raw CFF fonts from INDEX/DICT primitives: Adobe / Identity / 7 maps character-string index 1 to CID 41; a second CID font uses different registry/ordering names, supplement 9 and CID 65535. Name-keyed CFF and TrueType fonts exercise the distinct unsupported/non-CID paths. No external font asset or new dependency is needed.

The former merge-order predecessor #9538 is merged, together with #9309. The branch retains their outline-orientation and character-size implementation and tests. #9530 and #9574 are also merged; their Gasp and trigonometry implementations and tests remain preserved alongside the newer kerning implementation. No title unblock or performance improvement is claimed.

Tested

Rebased on upstream main dc9f1ef656367272f8485b8ed1e11378adf45a2e; tested PR head e3a69bc1c6feff671965c2fb9610b27753ff5d3d. Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Ninja, Release, BUILD_TESTING=ON, pinned bundled dependencies. The FreeType/font tests use the CPU.

  • cmake --build <build> --target relinker libs patched_libraries_tests guest_freetype_tests guest_freetype_bitmap_tests guest_freetype_request_size_tests guest_freetype_outline_tests guest_freetype_outline_mutations_tests guest_freetype_charmap_tests guest_freetype_charmap_info_tests guest_freetype_face_info_tests guest_freetype_names_tests guest_freetype_sfnt_names_tests guest_freetype_list_tests guest_font_tests guest_system_font_tests guest_font_writing_line_tests font_face_lifetime_tests --parallel 8: production relinker, patched libraries and all selected fixtures built on the rebased source.
  • ctest --test-dir <build> -R '^(guest_freetype.*|guest_.*font.*|font_.*|patched_libraries)$' -V --output-on-failure --no-tests=error: 18/18 passed, zero skips; 368 patched libraries loaded, zero failures. CID regression: 115 query scenarios across four fonts, four rendered glyphs. Main's merged trigonometry regression also ran (4,226 scalar cases, 1,764 angle differences and 68 LP64 tangent goldens).
  • Export.cpp is byte-identical to the previous submitted head. git range-diff retained both commits; the sole conflict resolution preserved upstream FT_TRIGONOMETRY_H beside this PR's FT_CID_H in the test includes. The existing orientation, Gasp, bitmap and trigonometry fixtures remained registered and executed.
  • python tools/check_conventions.py --base origin/main, python tools/check_main_sync.py --base origin/main --strict, git diff origin/main...HEAD --check and python tools/check_test_registration.py <build>: passed. python tools/pr_overlap.py --branch codex/pr9545-rebase-20261024 --repo boykopovar/AnyPS5 --jobs 12 completed; feat(libSceFreeType): manage multiple size objects #9550 adds separate size exports at a shared header insertion, and the old feat(libSceFreeType): expose CID font metadata #9545 branch is the expected self-match.

No title/homebrew run or complete CTest suite is claimed on this rebased head. Console ABI/version and metadata equivalence remain unverified as recorded in debt.

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 22, 2026 •

Copy link
Copy Markdown

Progress report (dc9f1ef → e3a69bc)

📈 System libraries: 48.67% (+0.01%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceFreeType FT_Get_CID_From_Glyph_Index_nid_postfix
libSceFreeType FT_Get_CID_Is_Internally_CID_Keyed_nid_postfix
libSceFreeType FT_Get_CID_Registry_Ordering_Supplement_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceFreeType 49/50 (98.00%) 52/53 (98.11%) +0.11 pp

@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.

Reviewed the full adapter and regression diff against the pinned bundled FreeType 2.13.3 CID API. The wrappers preserve the native functions’ null-face, output initialization, optional/aliased output and per-font metadata behavior through the existing guest-face ownership map; the tests construct CID and non-CID fonts and compare each result/error against native FreeType, including output guards and rendering checks. The PR is based on current main, declares its shared-insertion order after #9538, and the branch overlap scan found no additional code overlap. Hosted eligibility, conventions, intake, labels and report checks pass; build jobs were skipped by path policy. The Windows builds/tests and syntax/registration checks in the PR description are author-reported; I did not run a local build.

@Ondra97

Ondra97 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

I opened #9550 to add FT_New_Size, FT_Activate_Size and FT_Done_Size. I declared #9545 for merge order because both patches add FreeType API header includes at the same Export.cpp insertion. Retain both FT_CID_H and FT_SIZES_H; the implementations are independent.

@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.

Rechecked the unchanged head and the declared #9538 merge-order dependency. The three CID adapters match the pinned FreeType behavior, and the generated CFF/native-comparison coverage addresses CID, named-CFF and TrueType paths, including optional and aliased outputs. Eligibility, conventions, intake, labels and report checks pass; product/relinker jobs were skipped. I did not run local tests. Approval remains conditional on merging #9538 first as declared.

@fogydes

fogydes commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Reviewed; verified against the pinned freetype source. The three CID wrappers delegate to the host FreeType through the existing face bridge (FaceOf + null host through), so every answer — including the null-face path, where the host initializes the outputs and then answers Invalid_Argument — is the pinned 2.13.3 build's own behavior from ftcid.c/cffdrivr.c rather than anything written down here; the test's three input classes (name-keyed CFF, keyed-CFF, naked-CFF/TrueType) map onto exactly those driver implementations. The static_assert pinning FT_Bool at 1 byte, FT_Int/FT_UInt at 4 matches the guest ABI those exports promise, so no re-wrapping of the FT_Bool return is needed. The debt entry honestly scopes what's unverified and links the pinned ftcid.c blob, and the native-face lifetime of the returned registry/ordering strings is called out. Existing guest_freetype test stays under its budget; no registration change needed.

@MarcZX10

Copy link
Copy Markdown
Contributor

The detailed CID/native comparison and independent source review support the implementation; the declared #9538-before-#9545 insertion order remains correct while #9538 is open. I refreshed checks against upstream/main 4777cac: diff-check and conventions pass, and the merge is clean, but this head is 2 ahead/119 behind (merge base a6dcea9). No intervening main commits changed the CID adapter, its tests or debt file. Please update to current main and rerun the focused FreeType tests/convention/overlap checks on the resulting head. The Windows tests remain author-reported; product/relinker jobs are skipped. I did not run local C++ tests because the root filesystem is full.

@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 CID wrappers and generated-font tests remain sound on review, and the declared dependency on #9538 accurately records the insertion order. I am requesting only the repository freshness follow-up: this head is 2 ahead/119 behind current upstream/main 4777cac (merge base a6dcea9). Please update and rerun the focused FreeType tests and checks before merge, preserving the #9538 dependency and the follow-up chain. Diff-check, conventions and merge-tree pass on the current head; product/relinker jobs are skipped. I did not run local C++ tests due to the full filesystem.

@github-actions

github-actions Bot commented Oct 22, 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 9848 docs/dev/debt/libSceFreeType.md
PR 10706 core/libs/prx/libSceFreeType/Export.cpp
core/libs/tests/GuestFreeType.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@Ondra97
Ondra97 force-pushed the codex/feat-freetype-cid-metadata branch from ea53754 to 49c0a41 Compare October 23, 2026 03:10
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 23, 2026
@Ondra97 Ondra97 mentioned this pull request Oct 23, 2026
12 tasks done
@Ondra97
Ondra97 force-pushed the codex/feat-freetype-cid-metadata branch from 49c0a41 to 991e67c Compare October 23, 2026 05:53
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 23, 2026
@Ondra97
Ondra97 force-pushed the codex/feat-freetype-cid-metadata branch from 991e67c to 7d7b04e Compare October 23, 2026 14:37
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@adriadam10 adriadam10 self-assigned this Oct 23, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@Ondra97
Ondra97 force-pushed the codex/feat-freetype-cid-metadata branch from 7d7b04e to e3a69bc Compare October 24, 2026 16:54
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 24, 2026 19:17

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.

@adriadam10
adriadam10 merged commit 50757b0 into boykopovar:main Oct 24, 2026
11 of 12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Rechecked against current main: it merges cleanly, the CID adapters and the FT_CID_H/FT_TRIGONOMETRY_H test includes coexist with the newly merged FreeType changes, and the test still compares CID, name-keyed CFF and TrueType against native FreeType and would not link without the exports. Merged.

@Ondra97
Ondra97 deleted the codex/feat-freetype-cid-metadata branch October 25, 2026 02:46
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.

4 participants