Frederic Crozat <fcrozat@xxxxxxxxxxxx> さんは書きました: > 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.
diff -ru fontconfig-2.3.93.20060110.orig/src/fccache.c fontconfig-2.3.93.20060110/src/fccache.c --- fontconfig-2.3.93.20060110.orig/src/fccache.c 2006-01-11 13:23:52.000000000 +0100 +++ fontconfig-2.3.93.20060110/src/fccache.c 2006-01-11 15:09:40.000000000 +0100 @@ -309,7 +309,7 @@ if (strncmp (d->name, dir, strlen(dir)) == 0) { lseek (cache->fd, d->offset, SEEK_SET); - if (!FcDirCacheConsume (cache->fd, dir, set, config)) + if (!FcDirCacheConsume (cache->fd, d->name, set, config)) return FcFalse; if (strcmp (d->name, dir) == 0) ret = FcTrue;
-- Mike FABIAN <mfabian@xxxxxxx> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig