27 #include <glibmm/fileutils.h>
28 #include <glibmm/miscutils.h>
30 #include <fontconfig/fontconfig.h>
55 if (!g_getenv (
"ARDOUR_BUNDLED")) {
62 std::string dir_path = Glib::path_get_dirname (Glib::path_get_dirname (argv[0]));
66 localedir =
"/this/cannot/exist";
70 lpath.push_back (dir_path);
71 lpath.push_back (
"share");
72 lpath.push_back (
"locale");
89 g_setenv (
"SUIL_MODULE_DIR", (dir_path +
"/lib").c_str(), 1);
90 g_setenv (
"PATH", (dir_path +
"/bin:" + std::string(g_getenv (
"PATH"))).c_str(), 1);
95 g_unsetenv (
"GTK_RC_FILES");
101 if (Glib::file_test (
"/etc/fonts/fonts.conf", Glib::FILE_TEST_EXISTS)) {
102 g_setenv (
"FONTCONFIG_FILE",
"/etc/fonts/fonts.conf", 1);
103 g_setenv (
"FONTCONFIG_PATH",
"/etc/fonts", 1);
105 error <<
_(
"No fontconfig file found on your system. Things may looked very odd or ugly") <<
endmsg;
111 g_setenv (
"CHARSETALIASDIR", dir_path.c_str(), 1);
118 std::string ardour_mono_file;
121 cerr <<
_(
"Cannot find ArdourMono TrueType font") << endl;
124 FcConfig *config = FcInitLoadConfigAndFonts();
125 FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(ardour_mono_file.c_str()));
127 if (ret == FcFalse) {
128 cerr <<
_(
"Cannot load ArdourMono TrueType font.") << endl;
131 ret = FcConfigSetCurrent(config);
133 if (ret == FcFalse) {
134 cerr <<
_(
"Failed to set fontconfig configuration.") << endl;
void fixup_bundle_environment(int, char *argv[], string &localedir)
LIBPBD_API Transmitter error
LIBARDOUR_API bool translations_are_enabled()
static void set_global_epa(EnvironmentalProtectionAgency *epa)
std::ostream & endmsg(std::ostream &ostr)
bool find_file(const Searchpath &search_path, const string &filename, std::string &result)
LIBPBD_API void export_search_path(const std::string &base_dir, const char *varname, const char *dir)
static const char * localedir
LIBARDOUR_API PBD::Searchpath ardour_data_search_path()
LIBPBD_API std::string canonical_path(const std::string &path)