- String dir = dirs[i];
- if (!FcConfigAppFontAddDir (fcc, (FcChar8*)dir.to_str0 ()))
- error (_f ("Failed to add lilypond directory %s", dir));
- }
+ string dir = dirs[i];
+ if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
+ error (_f ("failed adding font directory: %s", dir.c_str ()));
+ else if (be_verbose_global)
+ message (_f ("adding font directory: %s", dir.c_str ()));
+ }
+
+ if (be_verbose_global)
+ message (_ ("Building font database."));
+ FcConfigBuildFonts (font_config_global);
+ FcConfigSetCurrent (font_config_global);
+ if (be_verbose_global)
+ message ("\n");
+
+ if (cache_file
+ && !is_file ((char*)cache_file))
+ {
+ /* inhibit future messages. */
+ FILE *f = fopen ((char*)cache_file, "w");
+ if (f)
+ fclose (f);
+ }
+