[Fontconfig] Is there a way to set the cache directory using environment variables?

Jean Abou Samra jean at abou-samra.fr
Thu Aug 10 15:07:42 UTC 2023

> on Windows I'm using prebuilt fontconfig binaries provided by the MSYS2
> project. I want my app to run on systems without MSYS2, however, so I can't
> use the default fontconfig directories hard-coded into MSYS2's fontconfig
> build because they only exist if MSYS2 is installed. Luckily, I can use the
> environment variables FONTCONFIG_FILE and FONTCONFIG_PATH to override the
> MSYS2-specific configuration in the prebuilt fontconfig binaries and set my
> own directories for fontconfig this way.
> However, I don't seem to find a way to set the path where fontconfig stores
> its cache files. It always uses the path hard-coded in the binary but this
> only exists if MSYS2 is installed. Is there any way to override the MSYS2
> cache directory or do I have to build fontconfig myself to do that? 

In vanilla Fontconfig builds, you can set the XDG_CACHE_HOME variable to modify
the cache location. Whether your MSYS2 build will respect that depends on how
the MSYS2 people have patched Fontconfig.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20230810/61fe842e/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/20230810/61fe842e/attachment.sig>

More information about the Fontconfig mailing list