feat(libfontconfig): implement FcCharSet exports and FcMatrixMultiply #14392
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14392"
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 danielhorngt on 2026-11-01T11:15:54Z.
What
Implements six libfontconfig exports:
FcCharSetCreate,FcCharSetDestroy,FcCharSetAddChar,FcCharSetMerge,FcCharSetSubtractCountandFcMatrixMultiply. Signatures and behaviour follow the public fontconfig 2.12.6 header and sources, including null handling, the range ofFcCharSetAddCharand aliased matrix arguments. A character above0x00fffffffails unless the leaf of its truncated number already exists, becauseFcCharSetFindLeafPosnarrows to 16 bits beforeFcCharSetPutLeafchecks the range. That check and the charset null checks are the same in 2.15.0. The module's fontconfig version is unknown and no console or title caller was read, so this is recorded indocs/dev/debt/libfontconfig.md.Tested
Windows 11, WinLibs GCC 15.2.0, Release build at commit
c6ef3fdc45:ctest -R '^guest_fontconfig$'passes. Negative control: breakingFcMatrixMultiplyandIsSubsettogether made the test fail at the first matrix check (line 24), so that run did not separately exercise theIsSubsetchange; restoring the code made it pass again. After the range fix, removing the range check made the test fail at line 76 and restoring it passed.check_conventions.pyandpr_overlap.pypass. Not tested: Linux, macOS, any title or real module, and the full test suite.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:23:33Z.
Review: COMMENTED
Reviewed — no blocking findings
The six fontconfig exports are implemented with the bitmap layout they describe, the matrix product is computed into a temporary so aliased arguments work, and the new test covers those aliasing and range edges; I did not check the fontconfig 2.12.6 behaviour the PR cites, and the test has not been run here.
What I ran
c644d2ab24a733208d7f7b5f54b36720aa5a802a, basee67cc81869./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14392 --output-dir /dev/shm/reviewer-run/precheck/14392python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base e67cc81869 --head c644d2ab24a733208d7f7b5f54b36720aa5a802a --json(exit 0;passed; 0 findings; 53 symbols).core/libs/tests/GuestFontconfig.cppfrom a head extract: one literal-path registration heuristic.FcCharSetAddChar(leaf index(character & 0xff) >> 5, bitcharacter & 0x1f, 16-bit leaf number),FcMatrixMultiply(product into a local, then stored),FcCharSetMerge,FcCharSetSubtractCount,FcCharSetCreateandFcCharSetDestroyincore/libs/prx/libfontconfig/Export.cpp; the test's aliasing and range checks (lines 20-80).Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14392/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check e67cc818696fd6e6c58ac80adc6550c54aed68e8...c644d2ab24a733208d7f7b5f54b36720aa5a802a/usr/bin/python3 tools/check_conventions.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head c644d2ab24a733208d7f7b5f54b36720aa5a802a --title feat(libfontconfig): implement FcCharSet exports and FcMatrixMultiply --body /dev/shm/reviewer-run/precheck/14392/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base e67cc818696fd6e6c58ac80adc6550c54aed68e8 --head c644d2ab24a733208d7f7b5f54b36720aa5a802a --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14392 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14392/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14392/head-c644d2ab24a7-925af6d8/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14392/head-c644d2ab24a7-925af6d8 --json core/libs/prx/libfontconfig/CMakeLists.txt core/libs/prx/libfontconfig/Export.cpp core/libs/prx/libfontconfig/include/InventoryExports.hpp core/libs/tests/GuestFontconfig.cpp docs/dev/debt/libfontconfig.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run here. The C++ test needs a build.
Findings
Blocking: none.
Non-blocking:
0x00ffffffis the PR's account ofFcCharSetFindLeafPosin fontconfig 2.12.6; the PR's own test (FcCharSetAddChar(set, 0x01000041) == 0) pins it. The fontconfig source the PR cites was not fetched here.Sources
github.com/boykopovar/AnyPS5@c644d2ab24/core/libs/prx/libfontconfig/Export.cppgithub.com/boykopovar/AnyPS5@c644d2ab24/core/libs/tests/GuestFontconfig.cppNot verified
guest_fontconfigwas not built or run here.conventions,eligibility,labelsandlibrary-portabilitysucceeded;linux,register-context,relinker,relinker-asanandwrite-watchwere skipped.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:17:42Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current range handling follows the cited Fontconfig source, but the overlapping #14435 work still has no agreed landing order recorded.
What I ran
Reviewed exact head
c644d2ab24a733208d7f7b5f54b36720aa5a802aagainst PR basee67cc818696fd6e6c58ac80adc6550c54aed68e8; its merge preview against currentmainf2d874c1fdccf781c0fa5d86619bb5dd8894b958was clean. Environment: Debian 12, Python 3.11.2; no local build or C++ tests.Results
Findings
Blocking
#14392 and #14435 both modify the new libfontconfig files, but neither description records an agreed landing order or dependency. The repository requires authors to agree which overlapping PR lands first and declare that order with
Depends on. Please coordinate with the #14435 author and record the sequence: if #14392 lands first, #14435 should depend on it; if #14392 lands second, update this PR to depend on #14435.Non-blocking
The earlier character-range concern is resolved. In Fontconfig 2.12.6,
FcCharSetFindLeafPospassesucs4 >> 8to aFcChar16parameter;FcCharSetPutLeafrejects a page at or above0x10000only when insertion is needed. This means a high character aliases an existing truncated page, while it fails on an empty set. The current implementation and tests reflect that source behavior. This was source inspection, not a reference build.Sources
fccharset.c, pinned to the release commitNot verified
I did not build or run
guest_fontconfig. No reference Fontconfig build, console/module version, or title behavior was independently tested. Hosted Linux and specialized jobs were skipped.To get this to a good state
Coordinate and record the landing order with #14435, updating the dependent PR's
Depends online. I will rerun the same relevant checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:56:03Z.
Review: APPROVED
Re-checked — new evidence, looks good
The #14435 author now declares
Depends on: #14392, resolving the landing-order blocker, and the high-codepoint behavior matches the pinned Fontconfig source.Reviewed head
c644d2ab24a733208d7f7b5f54b36720aa5a802aagainstmainatf2d874c1fdccf781c0fa5d86619bb5dd8894b958; hosted conventions, eligibility, library portability, labels, report and Windows checks pass, while Linux and specialized jobs are skipped. I inspected the pinned Fontconfig 2.15.0fccharset.cand the corresponding implementation and assertions; I did not run a local build or C++ test.The source confirms that leaf lookup narrows
ucs4 >> 8toFcChar16before range validation; an already-present truncated leaf is reused, while a missing leaf is rejected byFcCharSetPutLeaf. The implementation and tests now preserve that behavior. The newDepends onfield in #14435 records the agreed order.No negative control was run by me. The author reports differential and Windows test runs in the PR description; I did not independently reproduce them. Console behavior remains unverified.
Sources: Fontconfig 2.15.0
fccharset.cat the cited commit, implementation at the reviewed head, range and alias assertions at the reviewed head, #14435 dependency declaration.