
--- fontconfig-2.4.1/fonts.conf.in	2006-09-09 23:36:02.000000000 -0400
+++ fontconfig-2.4.1-new/fonts.conf.in	2007-11-03 15:23:57.000000000 -0400
@@ -30,7 +30,7 @@
 <!-- Font cache directory list -->
 
 	<cachedir>@FC_CACHEDIR@</cachedir>
-	<cachedir>~/.fontconfig</cachedir>
+	<cachedir>~/.fontconfig-2.4</cachedir>
 
 <!--
   Accept deprecated 'mono' alias, replacing it with 'monospace'
@@ -69,10 +69,21 @@
 	</match>
 
 <!--
+  Load per-user customization file
+-->
+	<include ignore_missing="yes">~/.fonts.conf</include>
+
+<!--
   Load local system customization file
 -->
 	<include ignore_missing="yes">conf.d</include>
 
+<!--
+  Load local (apple) system customization file
+-->
+	<include ignore_missing="yes">/usr/X11/lib/X11/fonts/local.conf</include>
+	<include ignore_missing="yes">/etc/fonts/local.conf</include>
+
 	<config>
 <!--
   These are the default Unicode chars that are expected to be blank
--- fontconfig-2.4.1/src/fcinit.c	2006-09-05 04:56:47.000000000 -0400
+++ fontconfig-2.4.1-new/src/fcinit.c	2007-11-03 15:15:14.000000000 -0400
@@ -70,6 +70,25 @@
 	return FcInitFallbackConfig ();
     }
 
+    if (config->cacheDirs && config->cacheDirs->num == 0)
+    {
+	fprintf (stderr,
+		 "Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
+	fprintf (stderr,
+		 "Fontconfig warning: adding <cachedir>%s</cachedir>\n",
+		 FC_CACHEDIR);
+	fprintf (stderr,
+		 "Fontconfig warning: adding <cachedir>~/.fontconfig-2.4</cachedir>\n");
+	if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) ||
+	    !FcConfigAddCacheDir (config, (FcChar8 *) "~/.fontconfig-2.4"))
+	{
+	    fprintf (stderr,
+		     "Fontconfig error: out of memory");
+	    FcConfigDestroy (config);
+	    return FcInitFallbackConfig ();
+	}
+    }
+
     return config;
 }
 
