27 #include <glibmm/fileutils.h>
28 #include <glibmm/miscutils.h>
30 #include <fontconfig/fontconfig.h>
44 #include <Carbon/Carbon.h>
45 #include <mach-o/dyld.h>
46 #include <sys/param.h>
57 if (!g_getenv (
"ARDOUR_BUNDLED")) {
65 char execpath[MAXPATHLEN+1];
66 uint32_t pathsz =
sizeof (execpath);
68 _NSGetExecutablePath (execpath, &pathsz);
71 std::string exec_dir = Glib::path_get_dirname (execpath);
72 std::string bundle_dir;
75 bundle_dir = Glib::path_get_dirname (exec_dir);
79 localedir =
"/this/cannot/exist";
84 lpath.push_back (bundle_dir);
85 lpath.push_back (
"Resources");
86 lpath.push_back (
"locale");
87 localedir = Glib::build_filename (lpath).c_str();
106 g_setenv (
"SUIL_MODULE_DIR", (bundle_dir +
"/lib").c_str(), 1);
107 g_setenv (
"PATH", (bundle_dir +
"/MacOS:" + std::string(g_getenv (
"PATH"))).c_str(), 1);
112 g_unsetenv (
"GTK_RC_FILES");
113 g_setenv (
"CHARSETALIASDIR", bundle_dir.c_str(), 1);
114 g_setenv (
"FONTCONFIG_FILE", Glib::build_filename (bundle_dir,
"Resources/fonts.conf").c_str(), 1);
124 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
125 std::string ardour_mono_file;
128 cerr <<
_(
"Cannot find ArdourMono TrueType font") << endl;
134 ttf = CFStringCreateWithBytes(
135 kCFAllocatorDefault, (UInt8*) ardour_mono_file.c_str(),
136 ardour_mono_file.length(),
137 kCFStringEncodingUTF8, FALSE);
138 fontURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, ttf, kCFURLPOSIXPathStyle, TRUE);
139 if (CTFontManagerRegisterFontsForURL(fontURL, kCTFontManagerScopeProcess, &error) !=
true) {
140 cerr <<
_(
"Cannot load ArdourMono TrueType font.") << endl;
LIBPBD_API Transmitter error
LIBARDOUR_API bool translations_are_enabled()
static void set_global_epa(EnvironmentalProtectionAgency *epa)
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)
LIBARDOUR_API std::string user_config_directory(int version=-1)
static const char * localedir
void fixup_bundle_environment(int, char *[], string &localedir)
void set_language_preference()
LIBARDOUR_API PBD::Searchpath ardour_data_search_path()