feat(libfontconfig): support collection values and pattern filtering #16564

Merged
bipinkrish merged 1 commit from upstream-pr/16564 into main 2026-11-11 12:14:32 +00:00
bipinkrish commented 2026-11-07 05:37:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bipinkrish on 2026-11-07T05:37:30Z.


What

A pattern can now store and return character sets and language sets. Character sets retain their shared identity; language sets are copied at insertion and on pattern copies. FcPatternFilter copies each selected property's values in their original order. Repeating a property name appends its values again. A null object set duplicates the pattern. Getters leave the caller's output unchanged on missing properties, invalid indexes, and type mismatches.

The contracts follow Fontconfig 2.15.0 at 72b9a48, particularly FcValueSave, FcValueEqual, and FcPatternFilter. The console ABI and version equivalence remain unverified and are recorded in the library's debt.

Tested

Ubuntu 24.04.4 LTS, x86-64, GCC 13.3, Release, on c45ed07952.

  • cmake --build build --target guest_fontconfig_tests guest_fontconfig_sets_tests guest_fontconfig_objects_tests nid_patcher -j3 and ctest --test-dir build -R '^guest_fontconfig($|_sets$|_objects$)' --output-on-failure: 3 passed. Regression cases cover shared character-set lifetime, independent language-set copies, equality, removal, filter order, and unchanged lookup outputs on errors.
  • A host probe called the same ownership and filtering cases on system Fontconfig 2.15.0 and the built AnyPS5 module, before and after NID patching. All assertions passed.
  • Negative control: the new object test loaded a module built from base c48f200127 and stopped at FcPatternAddCharSet not implemented.
  • python3 core/libs/tests/test_public_headers.py --audit-only and the conventions checks against origin/main and upstream/main passed.

The branch merges cleanly with the scanned main snapshot at 3c2a9ca8f5. The overlap tool checked 1,781 open PRs and could not complete two comparisons because those branches conflict with main. I inspected both pinned diffs. #14212 changes Fontconfig debt formatting and counts. #15294 changes FcConfigCreate, FcConfigReference, FcConfigDestroy, and the debt file. Neither implements these pattern exports.

No console or title run.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5198815334 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16564). Originally posted by [bipinkrish](https://github.com/bipinkrish) on 2026-11-07T05:37:30Z. --- ### What A pattern can now store and return character sets and language sets. Character sets retain their shared identity; language sets are copied at insertion and on pattern copies. `FcPatternFilter` copies each selected property's values in their original order. Repeating a property name appends its values again. A null object set duplicates the pattern. Getters leave the caller's output unchanged on missing properties, invalid indexes, and type mismatches. The contracts follow Fontconfig 2.15.0 at [`72b9a48`](https://github.com/fontconfig/fontconfig/tree/72b9a48f57de6204d99ce1c217b5609ee92ece9b), particularly [`FcValueSave`, `FcValueEqual`, and `FcPatternFilter`](https://github.com/fontconfig/fontconfig/blob/72b9a48f57de6204d99ce1c217b5609ee92ece9b/src/fcpat.c). The console ABI and version equivalence remain unverified and are recorded in the library's debt. ### Tested <!-- 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. --> Ubuntu 24.04.4 LTS, x86-64, GCC 13.3, Release, on `c45ed07952`. - `cmake --build build --target guest_fontconfig_tests guest_fontconfig_sets_tests guest_fontconfig_objects_tests nid_patcher -j3` and `ctest --test-dir build -R '^guest_fontconfig($|_sets$|_objects$)' --output-on-failure`: 3 passed. Regression cases cover shared character-set lifetime, independent language-set copies, equality, removal, filter order, and unchanged lookup outputs on errors. - A host probe called the same ownership and filtering cases on system Fontconfig 2.15.0 and the built AnyPS5 module, before and after NID patching. All assertions passed. - Negative control: the new object test loaded a module built from base `c48f200127` and stopped at `FcPatternAddCharSet not implemented`. - `python3 core/libs/tests/test_public_headers.py --audit-only` and the conventions checks against `origin/main` and `upstream/main` passed. The branch merges cleanly with the scanned `main` snapshot at `3c2a9ca8f5`. The overlap tool checked 1,781 open PRs and could not complete two comparisons because those branches conflict with `main`. I inspected both pinned diffs. #14212 changes Fontconfig debt formatting and counts. #15294 changes `FcConfigCreate`, `FcConfigReference`, `FcConfigDestroy`, and the debt file. Neither implements these pattern exports. No console or title run. ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
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!16564
No description provided.