]> git.donarmstrong.com Git - lilypond.git/blob - lily/font-config.cc
5c8fa806e503af37ea9488d344c17c791ab79f6f
[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 #include <fontconfig/fontconfig.h>
14
15 #include "main.hh"
16 #include "warn.hh"
17
18 void
19 init_fontconfig ()
20 {
21   if (!FcInit())
22     {
23       error ("FontConfig failed to initialize"); 
24     }
25
26   char const **dirs = prefix_directories;
27   for (; *dirs; dirs++)
28     {
29       String path = String (*dirs) + "/" + "otf";
30       
31       if (!FcConfigAppFontAddDir (0, (FcChar8*)path.to_str0 ()))
32         {
33           error (_f ("Failed to add lilypond directory %s", path.to_str0 ()));
34         }
35     }     
36 }
37
38 #else
39
40 void init_fontconfig() {}
41 #endif