diff options
author | John Emmas <johne53@tiscali.co.uk> | 2014-03-27 08:14:11 +0000 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2014-03-27 08:14:11 +0000 |
commit | e6a011b96928be3be271d98ce0f649040a101982 (patch) | |
tree | 56835de59150071c6deb723b4c0f291c597055a6 /gtk2_ardour/bundle_env_msvc.cc | |
parent | 6bcee4e9c83f8b48e75058a61cae0ff351800b67 (diff) |
Add the code for 'load_custom_fonts()' (though not entirely sure if it's actually doing enything...)
Diffstat (limited to 'gtk2_ardour/bundle_env_msvc.cc')
-rw-r--r-- | gtk2_ardour/bundle_env_msvc.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk2_ardour/bundle_env_msvc.cc b/gtk2_ardour/bundle_env_msvc.cc index d2c85b7935..826e84fdff 100644 --- a/gtk2_ardour/bundle_env_msvc.cc +++ b/gtk2_ardour/bundle_env_msvc.cc @@ -30,6 +30,8 @@ #include <glibmm.h> #include <glib/gstdio.h> +#include <fontconfig/fontconfig.h> + #include "ardour/ardour.h" #include "ardour/search_paths.h" #include "ardour/filesystem_paths.h" @@ -470,4 +472,22 @@ fixup_bundle_environment (int argc, char* argv[], const char** localedir) void load_custom_fonts() { + std::string ardour_mono_file; + + if (!find_file_in_search_path (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; + } } |