diff options
author | Robin Gareus <robin@gareus.org> | 2014-10-01 03:59:48 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-10-01 04:01:14 +0200 |
commit | d75d6a833afd8f876355dcd851fc7d00e9c1c6af (patch) | |
tree | 975597755f283daeac1948ebcd2e1d2353aef73f /gtk2_ardour/bundle_env_mingw.cc | |
parent | 98386166791f6767cc0667b74047f89d10043a78 (diff) |
mingw environment: ArdourMono.ttf
Diffstat (limited to 'gtk2_ardour/bundle_env_mingw.cc')
-rw-r--r-- | gtk2_ardour/bundle_env_mingw.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gtk2_ardour/bundle_env_mingw.cc b/gtk2_ardour/bundle_env_mingw.cc index bf0acb8871..41a6aab5cc 100644 --- a/gtk2_ardour/bundle_env_mingw.cc +++ b/gtk2_ardour/bundle_env_mingw.cc @@ -18,6 +18,21 @@ */ #include "bundle_env.h" +#include "i18n.h" + +#include <fontconfig/fontconfig.h> + +#include "ardour/ardour.h" +#include "ardour/search_paths.h" +#include "ardour/filesystem_paths.h" + +#include "pbd/file_utils.h" +#include "pbd/epa.h" + +using namespace std; +using namespace PBD; +using namespace ARDOUR; + void fixup_bundle_environment (int, char* [], const char** localedir) @@ -27,4 +42,22 @@ fixup_bundle_environment (int, char* [], const char** localedir) void load_custom_fonts() { + std::string ardour_mono_file; + + if (!find_file (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; + } } |