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

Andreas Falkenhahn andreas at falkenhahn.com
Thu Aug 10 16:30:24 UTC 2023


On 10.08.2023 at 17:07 Jean Abou Samra wrote:

> In vanilla Fontconfig builds, you can set the XDG_CACHE_HOME variable to modify
> the cache location. 

Doesn't work. Looking at the code it seems like XDG_CACHE_HOME is only handled if
there are no cache dirs in the config:

    if (config->cacheDirs && config->cacheDirs->num == 0) { 
         ...
         prefix = FcConfigXdgCacheHome ();
         ...
    }

The above if statement likely evaluates to FALSE for the MSYS2 build because
MSYS2 does define a cache directory but of course I don't want to use that because
it relies on the MSYS2 infrastructure...

-- 
Best regards,
 Andreas Falkenhahn                            mailto:andreas at falkenhahn.com



More information about the Fontconfig mailing list