- String path = String (*dirs) + "/" + "otf";
-
- if (!FcConfigAppFontAddDir (0, (FcChar8*)path.to_str0 ()))
- {
- error (_f ("Failed to add lilypond directory %s", path.to_str0 ()));
- }
- }
+ string dir = dirs[i];
+ if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
+ error (_f ("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)
+ progress_indication ("Building font database.\n");
+ FcConfigBuildFonts (font_config_global);
+ FcConfigSetCurrent (font_config_global);
+ if (be_verbose_global)
+ progress_indication ("\n");
+
+ if (!is_file ((char*)cache_file))
+ {
+ /* inhibit future messages. */
+ FILE *f = fopen ((char*)cache_file, "w");
+ if (f)
+ fclose (f);
+ }
+