diff --git a/gtk2_ardour/bundle_env_mingw.cc b/gtk2_ardour/bundle_env_mingw.cc index 723e3cee0c..85fd37b99f 100644 --- a/gtk2_ardour/bundle_env_mingw.cc +++ b/gtk2_ardour/bundle_env_mingw.cc @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include @@ -67,24 +69,25 @@ void load_custom_fonts() return; } - // pango with fontconfig backend - FcConfig *config = FcInitLoadConfigAndFonts(); - FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast(ardour_mono_file.c_str())); + if (pango_font_map_get_type() == PANGO_TYPE_FT2_FONT_MAP) { + FcConfig *config = FcInitLoadConfigAndFonts(); + FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast(ardour_mono_file.c_str())); - if (ret == FcFalse) { - cerr << _("Cannot load ArdourMono TrueType font.") << endl; - } + if (ret == FcFalse) { + cerr << _("Cannot load ArdourMono TrueType font.") << endl; + } - ret = FcConfigSetCurrent(config); + ret = FcConfigSetCurrent(config); - if (ret == FcFalse) { - cerr << _("Failed to set fontconfig configuration.") << endl; - } - - // pango with win32 backend - if (0 == AddFontResource(ardour_mono_file.c_str())) { - cerr << _("Cannot register ArdourMono TrueType font with windows gdi.") << endl; + if (ret == FcFalse) { + cerr << _("Failed to set fontconfig configuration.") << endl; + } } else { - atexit (&unload_custom_fonts); + // pango with win32 backend + if (0 == AddFontResource(ardour_mono_file.c_str())) { + cerr << _("Cannot register ArdourMono TrueType font with windows gdi.") << endl; + } else { + atexit (&unload_custom_fonts); + } } }