]> git.wh0rd.org - fontconfig.git/commitdiff
Verify that every font pattern loaded from cache has both FC_FILE and
authorKeith Packard <keithp@keithp.com>
Tue, 4 Jan 2005 21:54:50 +0000 (21:54 +0000)
committerKeith Packard <keithp@keithp.com>
Tue, 4 Jan 2005 21:54:50 +0000 (21:54 +0000)
    FC_FAMILY entries. Attempt to fix bug #2219.

ChangeLog
src/fccache.c

index fbe4adb8afef7c625eb3d852ff42a5b5ecac1945..729c941b27307bf6aaa03ce7bf97fc11103dba8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-04  Keith Packard  <keithp@keithp.com>
+
+       * src/fccache.c: (FcCacheFontSetAdd):
+       Verify that every font pattern loaded from cache has
+       both FC_FILE and FC_FAMILY entries.
+       Attempt to fix bug #2219.
+
 2004-12-29  Keith Packard  <keithp@keithp.com>
 
        * README:
index 9e47e86121d7901604027141fa7fea1db14f61a4..28455430a62a2777e6cf12a8df1437622653359e 100644 (file)
@@ -294,10 +294,18 @@ FcCacheFontSetAdd (FcFontSet          *set,
        font = FcNameParse (name);
        if (font)
        {
+           FcChar8 *family;
+           
            if (FcDebug () & FC_DBG_CACHEV)
                printf (" dir cache file \"%s\"\n", file);
            ret = FcPatternAddString (font, FC_FILE, path);
-           if (ret && (!config || FcConfigAcceptFont (config, font)))
+           /*
+            * Make sure the pattern has the file name as well as
+            * already containing at least one family name.
+            */
+           if (ret && 
+               FcPatternGetString (font, FC_FAMILY, 0, &family) == FcResultMatch &&
+               (!config || FcConfigAcceptFont (config, font)))
            {
                frozen = FcPatternFreeze (font);
                ret = (frozen != 0);