]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/font-config.cc
* stepmake/stepmake/*:
[lilypond.git] / lily / font-config.cc
index 8954c809f40f6bc454a715eec638dd7c20ab4659..c15f94f87e3866982eac21d1e1776ec9c71f9be4 100644 (file)
 #include "main.hh"
 #include "warn.hh"
 
+FcConfig *font_config_global = 0;
+
 void
 init_fontconfig ()
 {
   if (be_verbose_global)
     message (_ ("Initializing FontConfig..."));
-  
-  if (!FcInit ())
-    error (_ ("initializing FontConfig"));
-
-  FcConfig *fcc = FcConfigGetCurrent ();
 
+  if (!FcInit ())
+    error (_ ("initializing FontConfig failed"));
 
-#if 0
-  /*
-    Hmm. the cache is always out of date??!
-   */
-  FcChar8 *cache = FcConfigGetCache (fcc);
-  if (!FcDirCacheValid (cache))
-    {
-      warning (_ ("FontConfig cache out of date. Rebuilding may take some time."));
-    }
-#endif
-  
+  font_config_global = FcConfigGetCurrent ();
   Array<String> dirs;
-  struct stat statbuf; 
-  String builddir = prefix_directory + "/mf/out/";
 
-  if (stat (builddir.to_str0 (), &statbuf) == 0)
-    dirs.push (builddir.to_str0 ());
-  else
-    {
-      dirs.push (prefix_directory + "/fonts/otf/");
-      dirs.push (prefix_directory + "/fonts/type1/");
-      dirs.push (prefix_directory + "/fonts/svg/");
-    }
+  /*
+    ugh. C&P main.cc
+  */
+  dirs.push (prefix_directory + "/fonts/otf/");
+  dirs.push (prefix_directory + "/fonts/type1/");
+  dirs.push (prefix_directory + "/fonts/cff/");
+  dirs.push (prefix_directory + "/fonts/svg/");
   
   for (int i = 0; i < dirs.size (); i++)
     {
       String dir = dirs[i];
-      if (!FcConfigAppFontAddDir (fcc, (FcChar8 *)dir.to_str0 ()))
+      if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.to_str0 ()))
        error (_f ("adding font directory: %s", dir.to_str0 ()));
       else if (be_verbose_global)
        message (_f ("adding font directory: %s", dir.to_str0 ()));
@@ -70,7 +56,6 @@ init_fontconfig ()
 void
 init_fontconfig ()
 {
-  
 }
 
 #endif