feat(libfontconfig): implement FcPatternGetFTFace #17744

Merged
zkiller1236 merged 2 commits from upstream-pr/17744 into main 2026-11-12 05:05:51 +00:00
zkiller1236 commented 2026-11-09 13:54:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zkiller1236 on 2026-11-09T13:54:50Z.


What

FcPatternGetFTFace (NID HjlABSyLzNg) was a parameterless placeholder that threw. It now takes the public fontconfig.h prototype, with the FT_Face output as an opaque pointer (void**, the same LP64 ABI), and sits in Objects.cpp next to the other typed getters. It follows Fontconfig 2.15.0's fcpat.c step for step, like FcPatternGetInteger, GetBool, GetString and GetMatrix here: it returns FcPatternGet's result when that is not a match, returns FcResultTypeMismatch when the value is not FcTypeFTFace, and otherwise stores the face. As in the sibling getters, a null output on the matching path throws.

No export in this module stores a FreeType face in a pattern (pattern values are integers, booleans, doubles, strings and matrices), so in practice it returns FcResultNoMatch, FcResultNoId or FcResultTypeMismatch without touching the output; the matching path is written per the source but cannot be exercised yet. The row leaves the debt file's placeholder table (16 to 15) and gets an entry stating this, and that the console prototype and behaviour are unverified.

Tested

Linux x86-64, GCC, Release with BUILD_TESTING=ON, on main d792f1ad5f.

  • guest_fontconfig_objects and the other four guest_fontconfig* tests pass. The new FreeTypeFaceGetter covers a null pattern, a missing object, string and integer values (FcResultTypeMismatch, including with a null output), and ids 1 and -1 (FcResultNoId), checking that the output keeps its sentinel value each time.
  • On main the test does not compile, because the export takes no parameters there, and calling it throws.
  • check_conventions.py --base origin/main passes. pr_overlap.py reports no shared exports. #16564 removes neighbouring placeholder stubs and debt-table rows, and #16634, #17631 and my #17741 change the debt table's count line, so whichever merges later resolves small text conflicts; the new function and test were placed away from #16564's additions to keep those conflicts small.
  • Reviewed before opening by a separate AI reviewer (Claude Sonnet), which checked it against the 2.15.0 source and confirmed nothing in the module can produce an FcTypeFTFace value; its one optional wording change to the debt entry is applied.

Windows and PS5/title execution are untested.

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

Claude Code assisted with the implementation, tests and review.

🤖 Generated with Claude Code

https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5225003185 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17744). Originally posted by [zkiller1236](https://github.com/zkiller1236) on 2026-11-09T13:54:50Z. --- ### What `FcPatternGetFTFace` (NID `HjlABSyLzNg`) was a parameterless placeholder that threw. It now takes the public `fontconfig.h` prototype, with the `FT_Face` output as an opaque pointer (`void**`, the same LP64 ABI), and sits in `Objects.cpp` next to the other typed getters. It follows Fontconfig 2.15.0's `fcpat.c` step for step, like `FcPatternGetInteger`, `GetBool`, `GetString` and `GetMatrix` here: it returns `FcPatternGet`'s result when that is not a match, returns `FcResultTypeMismatch` when the value is not `FcTypeFTFace`, and otherwise stores the face. As in the sibling getters, a null output on the matching path throws. No export in this module stores a FreeType face in a pattern (pattern values are integers, booleans, doubles, strings and matrices), so in practice it returns `FcResultNoMatch`, `FcResultNoId` or `FcResultTypeMismatch` without touching the output; the matching path is written per the source but cannot be exercised yet. The row leaves the debt file's placeholder table (16 to 15) and gets an entry stating this, and that the console prototype and behaviour are unverified. ### Tested Linux x86-64, GCC, Release with `BUILD_TESTING=ON`, on `main` d792f1ad5f. - `guest_fontconfig_objects` and the other four `guest_fontconfig*` tests pass. The new `FreeTypeFaceGetter` covers a null pattern, a missing object, string and integer values (`FcResultTypeMismatch`, including with a null output), and ids 1 and -1 (`FcResultNoId`), checking that the output keeps its sentinel value each time. - On `main` the test does not compile, because the export takes no parameters there, and calling it throws. - `check_conventions.py --base origin/main` passes. `pr_overlap.py` reports no shared exports. #16564 removes neighbouring placeholder stubs and debt-table rows, and #16634, #17631 and my #17741 change the debt table's count line, so whichever merges later resolves small text conflicts; the new function and test were placed away from #16564's additions to keep those conflicts small. - Reviewed before opening by a separate AI reviewer (Claude Sonnet), which checked it against the 2.15.0 source and confirmed nothing in the module can produce an `FcTypeFTFace` value; its one optional wording change to the debt entry is applied. Windows and PS5/title execution are untested. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 Claude Code assisted with the implementation, tests and review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo
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!17744
No description provided.