]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/font-config.cc
Issue 3693: Let Percent_repeat_iterator be unfazed by Timing changes
[lilypond.git] / lily / font-config.cc
index 8ad36fbbabadb8edfa9a0a3db2d0b0bce3d1a143..26a9799b76c5963f3ee404f2422e63ff4da89d25 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -40,20 +40,25 @@ init_fontconfig ()
   /* TODO: Find a way for Fontconfig to update its cache, if needed. */
   font_config_global = FcInitLoadConfig ();
 
-  vector<string> dirs;
-
   /* Extra trailing slash suddenly breaks fontconfig (fc-cache 2.5.0)
      on windows.  */
-  dirs.push_back (lilypond_datadir + "/fonts/otf");
-
-  for (vsize i = 0; i < dirs.size (); i++)
-    {
-      string dir = dirs[i];
-      if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
-        error (_f ("failed adding font directory: %s", dir.c_str ()));
-      else
-        debug_output (_f ("Adding font directory: %s", dir.c_str ()));
-    }
+  string dir (lilypond_datadir + "/fonts/otf");
+
+  if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
+    error (_f ("failed adding font directory: %s", dir.c_str ()));
+  else
+    debug_output (_f ("Adding font directory: %s", dir.c_str ()));
+
+  string conf (lilypond_datadir + "/fonts/lilypond-fonts.conf");
+
+  if (!FcConfigParseAndLoad (font_config_global,
+                             (FcChar8 *)conf.c_str (),
+                             FcFalse))
+    error (_f ("failed adding fontconfig configuration file: %s",
+               conf.c_str ()));
+  else
+    debug_output (_f ("Adding fontconfig configuration file: %s",
+                      conf.c_str ()));
 
   debug_output (_ ("Building font database..."));