26 #include <fontconfig/fontconfig.h>
27 #include <pango/pangoft2.h>
28 #include <pango/pangocairo.h>
54 const gchar* pExeRoot = g_win32_get_package_installation_directory_of_module (0);
62 (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE,
"Software\\" PROGRAM_NAME
"\\v" PROGRAM_VERSION
"\\w64", 0, KEY_READ, &key))
64 (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE,
"Software\\" PROGRAM_NAME
"\\v" PROGRAM_VERSION
"\\w32", 0, KEY_READ, &key))
66 &&(ERROR_SUCCESS == RegQueryValueExA (key,
"Install_Dir", 0, NULL, reinterpret_cast<LPBYTE>(tmp), &size))
69 pExeRoot = Glib::locale_to_utf8(tmp).c_str();
76 pExeRoot = g_build_filename(program_files, PROGRAM_NAME, NULL);
80 if (pExeRoot && Glib::file_test(pExeRoot, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
81 return std::string (pExeRoot);
97 Glib::unsetenv (
"GTK_RC_FILES");
102 path = windows_search_path().to_string();
104 Glib::setenv (
"GTK_LOCALEDIR", path,
true);
111 cstr = getenv (
"VAMP_PATH");
114 path += G_SEARCHPATH_SEPARATOR;
119 path += G_SEARCHPATH_SEPARATOR;
120 path +=
"%ProgramFiles%\\Vamp Plugins";
121 path += G_SEARCHPATH_SEPARATOR;
122 path +=
"%COMMONPROGRAMFILES%\\Vamp Plugins";
123 Glib::setenv (
"VAMP_PATH", path,
true);
140 std::string ardour_mono_file;
144 RemoveFontResource(ardour_mono_file.c_str());
150 std::string ardour_mono_file;
153 cerr <<
_(
"Cannot find ArdourMono TrueType font") << endl;
157 if (pango_font_map_get_type() == PANGO_TYPE_FT2_FONT_MAP) {
158 FcConfig *config = FcInitLoadConfigAndFonts();
159 FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(ardour_mono_file.c_str()));
161 if (ret == FcFalse) {
162 cerr <<
_(
"Cannot load ArdourMono TrueType font.") << endl;
165 ret = FcConfigSetCurrent(config);
167 if (ret == FcFalse) {
168 cerr <<
_(
"Failed to set fontconfig configuration.") << endl;
172 if (0 == AddFontResource(ardour_mono_file.c_str())) {
173 cerr <<
_(
"Cannot register ArdourMono TrueType font with windows gdi.") << endl;
void fixup_bundle_environment(int, char *[], string &localedir)
LIBPBD_API char * get_win_special_folder(int csidl)
static __cdecl void unload_custom_fonts()
LIBARDOUR_API bool translations_are_enabled()
bool find_file(const Searchpath &search_path, const string &filename, std::string &result)
static const char * localedir
const std::string get_install_path()
LIBARDOUR_API std::string ardour_dll_directory()
LIBARDOUR_API PBD::Searchpath ardour_data_search_path()