OSX CoreText font loading, updated ArdourMono font-family name

git-svn-id: svn://localhost/ardour2/branches/3.0@14042 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2013-01-31 07:41:37 +00:00
parent 56fd9e9b85
commit 38374e7aa5
2 changed files with 26 additions and 2 deletions

Binary file not shown.

View File

@ -217,6 +217,30 @@ fixup_bundle_environment (int, char* [])
setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (bundle_dir, "Resources/gdk-pixbuf.loaders").c_str(), 1);
}
#include <Carbon/Carbon.h>
static void load_custom_fonts() {
#if 0 // untested OSX code
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;
}
CFStringRef ttf;
CFURLRef fontURL;
CFErrorRef error;
ttf = CFStringCreateWithBytes(
kCFAllocatorDefault, ardour_mono_filec_str(),
ardour_mono_file.length(),
kCFStringEncodingUTF8, FALSE);
fontURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, ttf, kCFURLPOSIXPathStyle, TRUE);
if (CTFontManagerRegisterFontsForURL(fontURL, kCTFontManagerScopeProcess, &error) != true) {
cerr << _("Cannot load ArdourMono TrueType font.") << endl;
}
#endif
}
#else
void
@ -319,8 +343,6 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
}
#endif
static void load_custom_fonts() {
std::string ardour_mono_file;
if (!find_file_in_search_path (ardour_data_search_path(), "ArdourMono.ttf", ardour_mono_file)) {
@ -338,6 +360,8 @@ static void load_custom_fonts() {
}
}
#endif
static gboolean
tell_about_jack_death (void* /* ignored */)
{