- /* similar for GDK pixbuf loaders, but there's no RC file required
- to specify where it lives.
- */
-
- mpath = Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders");
- setenv ("GDK_PIXBUF_MODULE_FILE", mpath.c_str(), 1);
+ /* this doesn't do much but setting it should prevent various parts of the GTK/GNU stack
+ from looking outside the bundle to find the charset.alias file.
+ */
+ g_setenv ("CHARSETALIASDIR", dir_path.c_str(), 1);
+
+}
+
+static void load_custom_fonts() {
+ std::string ardour_mono_file;
+ if (!find_file_in_search_path (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) {
+ cerr << _("Cannot find ArdourMono TrueType font") << endl;
+ }
+
+ FcConfig *config = FcInitLoadConfigAndFonts();
+ FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(ardour_mono_file.c_str()));
+ if (ret == FcFalse) {
+ cerr << _("Cannot load ArdourMono TrueType font.") << endl;
+ }
+ ret = FcConfigSetCurrent(config);
+ if (ret == FcFalse) {
+ cerr << _("Failed to set fontconfig configuration.") << endl;
+ }