[Fontconfig] order of searching for identical fonts

Akira TAGOH akira at tagoh.org
Mon Dec 12 13:00:40 UTC 2022

If they have different "fontversion", higher one has a priority.
otherwise a font path loaded first should has.
If you want to pick up a font first where is available on certain font
paths adding through FcConfigAppFontAddDir, you may want to use
FcFontSetMatch and/or FcFontSetList instead of FcFontMatch/FcFontList
with FcConfigGetFonts(config, FcSetApplication) and then fallback to
FcSetSystem as needed, because FcFontMatch/FcFontList is always going
through FcSetSystem and then FcSetApplication.

Hope this helps,

On Mon, Dec 12, 2022 at 8:48 PM Werner LEMBERG <wl at gnu.org> wrote:
> Let's assume that we have two identical fonts
> ```
> /my/directory/foo.ttf
> /usr/local/share/fonts/foo.ttf
> ```
> which differ (from FontConfig's point of view) only in the font
> revision.  The directory of the former font has been added using
> `FcConfigAppFontAddDir`, after loading the default configuration
> files.
> Which one of the font gets found first?  How can I influence that?
>     Werner


More information about the Fontconfig mailing list