summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2005-01-04 21:54:50 +0000
committerKeith Packard <keithp@keithp.com>2005-01-04 21:54:50 +0000
commitfce87a189b2e89a07e271ff7f1e3dab0d4b5b919 (patch)
tree3826ab605ac18028dcad972cb8386c4d31059c9a
parentd53461812d46ffb2eaffb2c512e8740e8536e498 (diff)
Verify that every font pattern loaded from cache has both FC_FILE and
FC_FAMILY entries. Attempt to fix bug #2219.
-rw-r--r--ChangeLog7
-rw-r--r--src/fccache.c10
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fbe4adb..729c941 100644
--- 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:
diff --git a/src/fccache.c b/src/fccache.c
index 9e47e86..2845543 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -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);