diff options
author | Robin Gareus <robin@gareus.org> | 2014-10-02 19:01:12 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-10-02 19:01:12 +0200 |
commit | 1c5246b5f11170c5cbce517017d930e23edc02fa (patch) | |
tree | ef7eeddd46ce00bca123791c982423844785af89 /gtk2_ardour/bundle_env_mingw.cc | |
parent | 242892999f2d73e8a11e63bdc43f8fa50d760aa5 (diff) |
amend 24289299 - pango fontmap w/mingw
Diffstat (limited to 'gtk2_ardour/bundle_env_mingw.cc')
-rw-r--r-- | gtk2_ardour/bundle_env_mingw.cc | 33 |
1 files changed, 18 insertions, 15 deletions
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 <glibmm.h> #include <fontconfig/fontconfig.h> +#include <pango/pangoft2.h> +#include <pango/pangocairo.h> #include <windows.h> #include <wingdi.h> @@ -67,24 +69,25 @@ void load_custom_fonts() return; } - // pango with fontconfig backend - FcConfig *config = FcInitLoadConfigAndFonts(); - FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(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<const FcChar8*>(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); + } } } |