[Fontconfig] Re: Bug in fc-cat with user cache

Mike FABIAN mfabian at suse.de
Tue Jan 17 02:45:14 PST 2006

Frederic Crozat <fcrozat at mandriva.com> さんは書きました:

> Le samedi 14 janvier 2006 à 13:30 -0800, Patrick Lam a écrit :
>> Mike FABIAN wrote:
>> > I made a small one line patch (attached) which seems to fix the
>> > problem for me. Is this patch correct?
>> I don't think it is, but I think I committed a correct patch which
>> applies FcConfigNormalizeFontDir consistently now.
> Well, it is still incorrect.
> Try the following :
> rm -rf /var/cache/fontconfig
> as simple user, run "xterm -fa sans" => cache is created as
> ~/.fonts.cache-2 and everything is fine
> re-run xterm -fa sans => xterm fallbacks to xfs
> using FC_DEBUG=1, you can see file information sent to applications for
> fonts are incorrect. For instance :
> /usr/share/fonts/DejaVuSans.ttf instead
> of /usr/share/fonts/ttf/dejavu/DejaVuSans.ttf

Yes, I can confirm that it is still incorrect like Frederic writes.

What was wrong with my attached patch? I'm not sure
but I think something similar is necessary. 

	    if (!FcDirCacheConsume (cache->fd, dir, set, config))

always adds the top-level directory to the list of directories
which is then used in FcConfigNormalizeFontDir(). For example it adds
the same directory /usr/X11R6/lib/X11/fonts/ many times but never
the subdirectories like /usr/X11R6/lib/X11/fonts/Type1/ ...
Replacing "dir" by "d->name" like

	    if (!FcDirCacheConsume (cache->fd, d->name, set, config))

seems to fix this because now the correct directory names area added
to the list.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: full-path-problem.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060117/94eab4b4/full-path-problem.bin
-------------- next part --------------

Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian

More information about the Fontconfig mailing list