FcFontSetSort(3)
π NAME π
FcFontSetSort β gimme the list of fonts that actually match, bestie β¨
okay so real talk, this is the "which fonts match" girly. she returns a list of matching fonts, sorted and everything. no cap. π«Ά
πΈ SYNOPSIS πΈ
#include <fontconfig/fontconfig.h>
FcFontSet * FcFontSetSort (FcConfig *config, FcFontSet **sets, int nsets, FcPattern *pattern, FcBool trim, FcCharSet **csp, FcResult *result);
likeβ¦ look at her. seven arguments. main character energy fr fr π
π¦ DESCRIPTION π¦
so what she does is: she takes fonts from sets and returns them sorted by how close they are to pattern. closeness ranking, iconic behaviour, we love to see it π
if trim is FcTrue, then any elements in the list that don't include Unicode coverage that earlier elements in the list didn't already have get elided. yeah β redundant coverage gets yeeted. ποΈβ¨ the union of the Unicode coverage of all of the fonts gets returned in csp, but only if csp is not NULL. if it's NULL, nothing happens there, iykyk.
β οΈ bestie pls read this one: this function should be called only afterFcConfigSubstituteandFcDefaultSubstitutehave been called forpβ otherwise your results will not be correct. like, not "kinda off", straight up WRONG. π don't skip the prep steps, that's the whole vibe check.
the FcFontSet you get back references FcPattern structures which may be shared by the return value from multiple FcFontSort calls. so applications cannot modify these patterns. π do not touch. hands off. instead, they should be passed β along with pattern β to FcFontRenderPrepare, which combines them into a complete pattern. that's the move. that's the slay. π
and when you're done with the FcFontSet returned by FcFontSetSort? you destroy it by calling FcFontSetDestroy. clean up after yourself, queen π
β¨ and that's the whole page, bestie β¨ this one's from Fontconfig 2.17.0, dated 27 June 2025 ππ go sort some fonts and be iconic about it π¦π
π¦ where this page comes from
- fedora 43: fontconfig-devel 2.17.0-3.fc43 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 43: fontconfig-devel 2.17.0-3.fc43 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 44: fontconfig-devel 2.17.0-4.fc44 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- fedora 44: fontconfig-devel 2.17.0-4.fc44 Β· HPND AND LicenseRef-Fedora-Public-Domain AND Unicode-DFS-2016
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms