diff --git a/gtk2_ardour/ardour3_fonts.rc.in b/gtk2_ardour/ardour3_fonts.rc.in index 5024c7759a..2ed1a57881 100644 --- a/gtk2_ardour/ardour3_fonts.rc.in +++ b/gtk2_ardour/ardour3_fonts.rc.in @@ -10,7 +10,7 @@ style "small_text" style "small_mono_text" { - font_name = "monospace bold @FONT_SMALL@" + font_name = "ArdourMono @FONT_SMALL@" } style "small_italic_text" @@ -35,7 +35,7 @@ style "medium_text" style "medium_monospace_text" { - font_name = "monospace @FONT_SIZE_NORMAL@" + font_name = "ArdourMono @FONT_SIZE_NORMAL@" } style "red_medium_text" = "medium_text" diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index fd03db115b..8a0cf1e857 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -50,6 +50,8 @@ #include #include +#include + #include "version.h" #include "utils.h" #include "ardour_ui.h" @@ -323,6 +325,17 @@ 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)) { + cerr << _("Cannot find ArdourMono TrueType font") << endl; + } + + FcConfig *config = FcInitLoadConfigAndFonts(); + FcBool ret = FcConfigAppFontAddFile(config, reinterpret_cast(ardour_mono_file.c_str())); + ret = FcConfigSetCurrent(config); +} + static gboolean tell_about_jack_death (void* /* ignored */) { @@ -387,6 +400,8 @@ int main (int argc, char *argv[]) { fixup_bundle_environment (argc, argv); + load_custom_fonts(); /* needs to happend before any gtk and pango init calls */ + if (!Glib::thread_supported()) { Glib::thread_init(); } diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 43bfc562b8..df91f4103a 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -273,6 +273,7 @@ def configure(conf): uselib_store='GNOMECANVASMM', atleast_version='2.16') autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2') autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False) + autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG') conf.write_config_header('gtk2ardour-config.h', remove=False) @@ -393,7 +394,7 @@ def build(bld): obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3') - obj.uselib = 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL' + obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG ALSA CURL DL' obj.uselib += ' GTKMM GNOMECANVASMM GNOMECANVAS ' obj.uselib += ' AUDIOUNITS OSX GTKOSX ' obj.use = [ 'libpbd', @@ -528,7 +529,7 @@ def build(bld): 'MASSIVE' : '60', } font_names = { - 'BOLD_MONOSPACE' : 'monospace bold' + 'BOLD_MONOSPACE' : 'ArdourMono' } # Set up font substitution dictionary @@ -659,6 +660,7 @@ def build(bld): bld.install_files('${DATADIR}/ardour3/icons', bld.path.ant_glob('icons/*.png')) bld.install_files('${DATADIR}/ardour3/pixmaps', bld.path.ant_glob('pixmaps/*.xpm')) bld.install_files('${DATADIR}/ardour3', 'splash.png') + bld.install_files('${DATADIR}/ardour3', 'ArdourMono.ttf') # Default UI configuration bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf') diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index 194a056b60..49a0bdfd6d 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -520,6 +520,7 @@ fi # share stuff cp -R ../../gtk2_ardour/splash.png $Shared +cp -R ../../gtk2_ardour/ArdourMono.ttf $Shared # go through and recursively remove any .svn dirs in the bundle for svndir in `find $APPDIR -name .svn -type d`; do