After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703331 - Change default fontconfig cache folder location on Windows
Change default fontconfig cache folder location on Windows
Status: RESOLVED NOTGNOME
Product: GIMP
Classification: Other
Component: General
2.8.6
Other Windows
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2013-06-29 23:04 UTC by Eduard Braun
Modified: 2014-07-28 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Eduard Braun 2013-06-29 23:04:50 UTC
The fontconfig cache folder on Windows currently defaults to "%TEMP%\fontconfig\cache"

The problem: This folder is often emptied out manually or automatically (e.g. by several temp file cleaning tools). Since building the fontcache is very slow every time the temp folder has been cleared startup of GIMP takes ages.

I therefore suggest to change the fontconfig cache folder to something more reasonable e.g. "%UserProfile%\.gimp-2.8\fontconfig\cache" or "%APPDATA%\GIMP\2.9\fontconfig\cache" respectively.

I tested this with GIMP 2.8.6 stable (x64) as well as an development version of GIMP 2.9 (x86) compiled on 2013-06-29.
Comment 1 Jehan 2013-07-01 01:46:00 UTC
Hi,

it seems more of a fontconfig issue, and apparently a common one, cf. http://lists.freedesktop.org/archives/fontconfig/2012-April/003934.html as well as other links.

Yet even though the mail thread says at the end something has been committed, I just cloned fontconfig repo, and it does not look like fixed at all.
Cf. configure.ac and src/fcxml.c in fontconfig code.

That seems really easy to fix, but I would need to get the will of building again gimp (and fontconfig obviously) under a Windows VM to be sure. So that may not be for now. In any case, I'd say that's not a GIMP bug. :-)
Comment 2 Eduard Braun 2013-07-01 02:31:49 UTC
I always work around the issue by just setting the cachedir in "\etc\fonts\fonts.conf" to something like "<cachedir>~/.fontconfig</cachedir>".

Maybe this is a sufficient workaround for GIMP, too, until this is correctly fixed in fontconfig?
Comment 3 Michael Schumacher 2013-07-01 07:55:15 UTC
That fontconfig commit seems to fix a stat problem, and is IMO not supposed to change the location at all.
Comment 4 Eduard Braun 2013-07-01 08:41:36 UTC
"LOCAL_APPDATA_FONTCONFIG_CACHE" seems like a good location for the cachedir, too (it was mentioned here: http://thread.gmane.org/gmane.comp.fonts.fontconfig/4738).
Comment 5 Jehan 2013-07-01 11:26:28 UTC
Michael > I agree. As I said, the issue does not look fixed at all on fontconfig side.

Eduard > well I don't know what would be the best directory for fontconfig cache on Windows but I think the best is to discuss this with the fontconfig folks rather than with us. I tried to search if they had an official bug tracker to search and fill a report if they had not one already, but could not find a sure location. Looks like they are using libreoffice's bugzilla now. Is it considered their official tracker?

In any case I am not really for having an official GIMP-specific workaround because this kind of things just add maintenance weight on downstream projects and may cause problems later if the fontconfig folks chose another directory than us for instance (and if we forget to remove our workaround). I mean, for very horrible bugs, workarounds may be worth it; but some slowness at startup "sometimes" on Windows, well I am not sure this is worth the additional worry.
Therefore I am rather into opening a ticket upstream and closing ours once it is done. :-)

And yes in the meantime, you can either change the system-wide /etc/fonts/fonts.conf, or else create a "GIMP-system-wide" fonts.conf ($PREFIX/etc/gimp/2.0/fonts.conf), or else create a local user fonts.conf (in the local GIMP config directory).
Comment 6 Jehan 2013-11-17 09:49:41 UTC
Hey,

I had a closer look. So apparently that's all already implemented. All we have to do is to change the value of <cachedir> in etc/fonts/fonts.conf:
<cachedir>LOCAL_APPDATA_FONTCONFIG_CACHE</cachedir>

This can be done afterwards, or before by changing the default.

I've opened a report at fontconfig's tracker to propose them to change the default: https://bugs.freedesktop.org/show_bug.cgi?id=71691
In the meantime, we can just use the patch I uploaded there in our own Windows build of fontconfig.
Drawoc, do you think we add this patch in build/windows/jhbuild/patches/ ?
Comment 7 Jehan 2013-12-09 10:03:48 UTC
My patch has been accepted upstream and is now merged into their git repo. LOCAL_APPDATA_FONTCONFIG_CACHE will now be the new default.

If we want to be sure our official release has the right cache path, we will have to use the next released version (or patch an older).
I don't close this bug report until we finally manage to make our Windows release procedure.
Comment 8 Jehan 2014-07-28 13:41:49 UTC
commit 6b2963928eaf353d3ba14b7f4bb2c98c2a22d66e
Author: Jehan <jehan@girinstud.io>
Date:   Tue Jul 22 18:20:02 2014 +0000

    configure: warning when compiling with old fontconfig on Win32.

    Fontconfig had a few bugs in the default configuration when compiled for
    Windows. These issues are fixed from version 2.11.1. Display a warning
    when compiling on win32 platform with older versions.
    See in particular bugs 708110 and 703331.

Resolved as NOTGNOME.