[Fontconfig] Trouble forcing rescanning of font dirs

Diego Santa Cruz Diego.SantaCruz at spinetix.com
Mon Feb 2 05:13:48 PST 2009

> -----Original Message-----
> From: Behdad Esfahbod [mailto:behdad.esfahbod at gmail.com] On Behalf Of
> Behdad Esfahbod
> Sent: 02 February 2009 13:06
> To: mfabian at suse.de
> Cc: Diego Santa Cruz; fontconfig at lists.freedesktop.org
> Subject: Re: [Fontconfig] Trouble forcing rescanning of font dirs
> Mike FABIAN wrote:
> > I also think this is a bug, see
> >
> > https://bugzilla.novell.com/show_bug.cgi?id=438855#c23
> >
> > Comment #24 of this bug has a patch which I attach here as well
> > for convenience.
> >
> > The line
> >
> >  if (dir_stat.st_mtime <= file_stat.st_mtime) {
> >
> > was removed recently from fccache.c, I think this was probably
> removed
> > by accident and was a mistake.
> I doubt you really mean "recently".  Anyway, that was not a mistake.
> That
> line will cause lots of problems with clock skews and changes (which
> are not
> uncommon at new installations).  Instead, the cache stores the dir
> timestamp,
> and the two are compared for equality.

I am also afraid from comparing mtime's like above, so I do not think it is the correct fix.

> I think the approach Diego proposes may be real the fix.  However, I'm
> puzzled
> as live font installation and uninstallation both work for me
> correctly.  I'll
> check it out again.
> Diego, which fontconfig version are you using?

I am running 2.6.0.

I guess the reason why it works for you and not us is that we are only running one application that is using fontconfig and that we do not run fc-cache right after font install for a variety of reasons. In this case nobody is recreating the cache file and thus fontconfig finds that the copy it has already in memory is the same as the one on disk and in that case it does not bother to check for the cache being up to date. 

I am testing my proposed fix and will let you know how it goes shortly.


Diego Santa Cruz, PhD
Technology Architect
SpinetiX S.A.
Rue des Terreaux 17
1003, Lausanne, Switzerland
T +41 21 341 15 50
F +41 21 311 19 56
diego.santacruz at spinetix.com

More information about the Fontconfig mailing list