Full support for fontconfig
https://github.com/RazrFalcon/fontdb/issues/56#issuecomment-1667516630 suggests that we should entirely avoid using fontdb and directly use fontconfig to index fonts on Linux. Perhaps we should have a better solution?
Originally posted by @tjw123hh in https://github.com/pop-os/cosmic-text/issues/174#issuecomment-2216816485
Looking at the #[cfg(feature = "fontconfig")] code in fontdb, it seems to me it's pretty close to a solid fontconfig replacement. It uses fontconfig-parser to parse the config files, so most of what needs to be done is finding the paths where the config files are located, and then dealing correctly with the aliases defined in those config files. There are some problems with the latter part with the current fontdb code. (On my system, the current fontdb code fails to resolve .family_name(Family::Monospace) to a font that actually exists, whereas fontconfig has not such problems.)
Though I get that the fontdb maintainer doesn't want to maintain a whole fontconfig replacement within fontdb.
So can we avoid fontdb and use fontconfig API instead?