Provide a way to detect font fallbacks
As illustrated by LilyPond (see https://lists.freedesktop.org/archives/fontconfig/2023-April/006982.html), it would be beneficial for some applications to have a way to detect if the font it got is a fallback font. This is important for text-based applications that allow the user to select a font, which want to emit a warning in case there is a typo in the font name, for example.
I recognize that due to the expressiveness of Fontconfig's configuration XML language, the exact semantics of this are a bit fuzzy and would need to be defined more precisely. For example, if the font is found through an <alias>
element, I imagine we would want to mark the result as a fallback is it was matched using one of the families in the <default>
element, but not in the <prefer>
or <accept>
elements.