]> git.donarmstrong.com Git - lilypond.git/blob - lily/font-config.cc
* stepmake/aclocal.m4 (STEPMAKE_KPATHSEA): Do not include
[lilypond.git] / lily / font-config.cc
1 /*
2   font-config.cc -- implement Font_config related functions
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include "config.hh"
11
12 #ifdef HAVE_PANGO_FT2
13
14 #include <fontconfig/fontconfig.h>
15
16 #include "file-path.hh"
17 #include "main.hh"
18 #include "warn.hh"
19
20 void
21 init_fontconfig ()
22 {
23   if (!FcInit ())
24     error (_ ("FontConfig failed to initialize"));
25
26   FcConfig *fcc = FcConfigGetCurrent ();
27
28   Array<String> dirs;
29   dirs.push (prefix_directory + "/otf/");
30   dirs.push (prefix_directory + "/mf/out/");
31   dirs.push (prefix_directory + "/type1/");
32   dirs.push (prefix_directory + "/cff/");
33   
34   for (int i = 0; i < dirs.size (); i++)
35     {
36       String dir = dirs[i];
37       if (!FcConfigAppFontAddDir (fcc, (FcChar8*)dir.to_str0 ()))
38         error (_f ("Failed to add lilypond directory %s", dir));
39     }     
40 }
41
42 #else
43
44 void
45 init_fontconfig ()
46 {
47 }
48 #endif