]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/font-config.cc
(init_fontconfig): do the init if
[lilypond.git] / lily / font-config.cc
index ad66c7870834fc8ffd9e5370bfc6263ede258188..7cea2fcfdee321295085ff37b64a572512fa05a9 100644 (file)
@@ -30,17 +30,12 @@ init_fontconfig ()
   font_config_global = FcInitLoadConfig ();
   FcChar8 *cache_file = FcConfigGetCache (font_config_global);
 
-  if (!cache_file)
-    {
-      programming_error ("global fontconfig cache_file not found");
-      return;
-    }
-  
   /*
     This is a terrible kludge, but there is apparently no way for
     FontConfig to signal whether it needs to rescan directories.
    */ 
-  if (!is_file ((char*)cache_file))
+  if (cache_file
+      && !is_file ((char const *)cache_file))
     message (_f ("Rebuilding FontConfig cache %s, this may take a while...", cache_file));
                        
   vector<string> dirs;
@@ -64,7 +59,8 @@ init_fontconfig ()
   if (be_verbose_global)
     progress_indication ("\n");
 
-  if (!is_file ((char*)cache_file))
+  if (cache_file
+      && !is_file ((char*)cache_file))
     {
       /* inhibit future messages. */
       FILE *f = fopen ((char*)cache_file, "w");