From 1c5246b5f11170c5cbce517017d930e23edc02fa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 2 Oct 2014 19:01:12 +0200 Subject: amend 24289299 - pango fontmap w/mingw --- gtk2_ardour/bundle_env_mingw.cc | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'gtk2_ardour/bundle_env_mingw.cc') 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; - } - - ret = FcConfigSetCurrent(config); + if (ret == FcFalse) { + cerr << _("Cannot load ArdourMono TrueType font.") << endl; + } - if (ret == FcFalse) { - cerr << _("Failed to set fontconfig configuration.") << endl; - } + ret = FcConfigSetCurrent(config); - // 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); + } } } -- cgit v1.2.3