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"
22 if (be_verbose_global)
23 message (_ ("Initializing FontConfig..."));
26 error (_ ("initializing FontConfig"));
28 FcConfig *fcc = FcConfigGetCurrent ();
31 String builddir = prefix_directory + "/mf/out/";
33 if (stat (builddir.to_str0 (), &statbuf) == 0)
34 dirs.push (builddir.to_str0 ());
37 dirs.push (prefix_directory + "/fonts/otf/");
38 dirs.push (prefix_directory + "/fonts/type1/");
39 dirs.push (prefix_directory + "/fonts/svg/");
42 for (int i = 0; i < dirs.size (); i++)
45 if (!FcConfigAppFontAddDir (fcc, (FcChar8 *)dir.to_str0 ()))
46 error (_f ("adding font directory: %s", dir.to_str0 ()));
47 else if (be_verbose_global)
48 message (_f ("adding font directory: %s", dir.to_str0 ()));
51 if (be_verbose_global)
52 progress_indication ("\n");