[Fontconfig] Detecting whether a font is a fallback

Jean Abou Samra jean at abou-samra.fr
Wed Apr 19 22:56:08 UTC 2023


Hi,

Suppose I call FcFontMatch on a font pattern with a family name that doesn't exist on my system. I get some default system font.

Is there a reliable way to tell whether the FcPattern I get is for a fallback font like this? I could compare the two FC_FAMILY values, but it seems that Fontconfig does some case transformations —
and possibly other things like replacing dashes? Is there a simple way to know if two FC_FAMILY strings match? Is there a better approach that I'm missing?

This is for LilyPond, which has ways of configuring fonts, and where we'd like to display a warning if a font is not found (unlike a GUI application, which just wants to display the text even if it's
in a suboptimal font).

Thanks,

Jean

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20230420/e1a9732c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20230420/e1a9732c/attachment.sig>


More information about the Fontconfig mailing list