feat(libfontconfig): implement the configuration-less font queries #17741
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17741"
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 zkiller1236 on 2026-11-09T13:49:19Z.
What
FcFontList(7+Gq-0xFybo),FcFontSetMatch(8DLBHeMsS1k),FcFontMatch(FqneT2syjGE),FcFontSort(MApHziT-St4) andFcConfigSubstitute(8v4Xk2b+C1k) were parameterless placeholders that threw. They now take the publicfontconfig.hprototypes and follow Fontconfig 2.15.0 (the bundled3rdparty/fontconfig) against this module's configuration functions, which the firmware 13.42 disassembly already recorded in the debt file shows to be configuration-less:FcConfigCreate,FcConfigReferenceandFcConfigGetCurrentreturn null andFcInitBringUptoDatereturns true.FcFontList(config, pattern, objects): as infclist.c, a null configuration first callsFcInitBringUptoDate(returning null if it fails);FcConfigReferencethen yields null, so it returns null.FcFontSetMatch(config, sets, nsets, pattern, result): as infcmatch.c, it storesFcResultNoMatchin*resultbefore taking the reference, then returns null.FcFontMatch(config, pattern, result)andFcFontSort(config, pattern, trim, coverage, result): as infcmatch.c, they storeFcResultNoMatchbefore taking the reference and return null;FcFontSortleaves*coverageuntouched, as 2.15.0 only writes it after the reference.FcConfigSubstitute(config, pattern, kind): as inFcConfigSubstituteWithPat, a kind outsideFcMatchPattern..FcMatchScanreturns false; otherwise the null reference also returns false.kindis taken asint, so any guest value is compared without converting it to the enum.Each function calls the module's real
FcConfigReferenceand throws if it ever returns a configuration, since no font or substitution data exists to continue with. A null argument that 2.15.0 asserts against (the set array, pattern or result) also throws.FcMatchKindis added toTypes.hppwith thefontconfig.hvalues. The five rows leave the debt file's placeholder table (16 to 11) and get their own entry, which states that the console's copies of these functions were not disassembled, so it is unverified that they call the sameFcConfigReference.Tested
Linux x86-64, GCC, Release with
BUILD_TESTING=ON, onmain3d7f347871.guest_fontconfig,guest_fontconfig_config,guest_fontconfig_current,guest_fontconfig_setsandguest_fontconfig_objectspass. The newCheckConfigurationQueriescoversFcFontListwith null, created and current configurations, with and without a pattern and object set;FcFontSetMatchwith zero and one sets, checking that a presetFcResultMatch/FcResultOutOfMemorybecomesFcResultNoMatch;FcFontMatchandFcFontSortwith null and created configurations, bothtrimvalues and a null or sentinel coverage pointer (left unchanged); the seven null-argument throws; andFcConfigSubstitutefor kinds -1, 0, 1, 2, 3 and0x7fffffff, with and without a pattern.mainthe new test does not compile, because these exports take no parameters there, and calling them throws.check_conventions.py --base origin/mainpasses.pr_overlap.pyreports no shared exports; #16564, #16634 and #17631 change neighbouring lines (the debt table's count line, and one declaration line inInventoryExports.hppfor #16634), so whichever merges later resolves a small text conflict.kindis anint, and the debt entry is shortened.FcFontMatchandFcFontSortwere added in a second commit and reviewed the same way.Windows and PS5/title execution are untested.
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)Claude Code assisted with the investigation, implementation, tests and review.
🤖 Generated with Claude Code
https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo