[Fontconfig] Query for default config without force initialization if absent

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Sat Feb 12 19:20:53 UTC 2022


On Sat, 12 Feb 2022 10:23:32 +0100, Francesco Pretto wrote:

> I have a PDF manipulation library[1] that needs to
> use fontconfig for regular font lookups. My idea is that my library
> code should attempt first to check if an existing default
> configuration exists, and if it does it should use that. If it does
> not exist I want to chose to let fontconfig to default initialize one
> or create a custom one that fit better the purpose of my PDF library.

Better idea: use the default config, unless the caller specifies
alternate settings for you instead. In other words, give the caller the
option to pass you an explicit “FcConfig *” object that they have
constructed or obtained from somewhere; if this is NULL, then fall back
to the default.


More information about the Fontconfig mailing list