2 font-config.cc -- implement FontConfig related functions
4 source file of the GNU LilyPond music typesetter
6 (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
13 #include <fontconfig/fontconfig.h>
15 #include "file-path.hh"
19 FcConfig *font_config_global = 0;
24 if (be_verbose_global)
25 message (_ ("Initializing FontConfig..."));
28 error (_ ("initializing FontConfig failed"));
30 font_config_global = FcConfigGetCurrent ();
32 String builddir = prefix_directory + "/mf/out/";
35 if (stat (builddir.to_str0 (), &statbuf) == 0)
36 dirs.push (builddir.to_str0 ());
42 dirs.push (prefix_directory + "/fonts/otf/");
43 dirs.push (prefix_directory + "/fonts/type1/");
44 dirs.push (prefix_directory + "/fonts/cff/");
45 dirs.push (prefix_directory + "/fonts/svg/");
47 for (int i = 0; i < dirs.size (); i++)
50 if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.to_str0 ()))
51 error (_f ("adding font directory: %s", dir.to_str0 ()));
52 else if (be_verbose_global)
53 message (_f ("adding font directory: %s", dir.to_str0 ()));
56 if (be_verbose_global)
57 progress_indication ("\n");