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

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Sat Feb 12 22:52:05 UTC 2022


On Sat, 12 Feb 2022 13:22:11 -0600, Behdad Esfahbod wrote:

>   http://mces.blogspot.com/2015/05/how-to-use-custom-application-fonts.html

    So you can attach your private FcConfig to a private
    PangoFcFontMap, inform the font map every time you change the
    FcConfig (eg, add more fonts to it), and you should be able to use
    that font map to create layouts and use normally, without switching
    FcConfig's all the time.

That seems the right way to do it: create custom Fontconfig setups to
control the behaviour of a font-rendering subsystem, rather than
messing about with the global user-default configuration.

By the way, I completely forgot to add a wrapper for
FcInitLoadConfig() and FcInitLoadConfigAndFonts() to my Python binding
<https://github.com/ldo/python_fontconfig>, but this has now been fixed.


More information about the Fontconfig mailing list