13
0

amend 24289299 - pango fontmap w/mingw

This commit is contained in:
Robin Gareus 2014-10-02 19:01:12 +02:00
parent 242892999f
commit 1c5246b5f1

View File

@ -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,7 +69,7 @@ void load_custom_fonts()
return;
}
// pango with fontconfig backend
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()));
@ -80,7 +82,7 @@ void load_custom_fonts()
if (ret == FcFalse) {
cerr << _("Failed to set fontconfig configuration.") << endl;
}
} else {
// pango with win32 backend
if (0 == AddFontResource(ardour_mono_file.c_str())) {
cerr << _("Cannot register ArdourMono TrueType font with windows gdi.") << endl;
@ -88,3 +90,4 @@ void load_custom_fonts()
atexit (&unload_custom_fonts);
}
}
}