diff options
author | Robin Gareus <robin@gareus.org> | 2013-01-29 15:25:30 +0000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-01-29 15:25:30 +0000 |
commit | eb369215ae4564da89b63831f474e094181ec7f0 (patch) | |
tree | fa278202100e8127904f63b31b1e01f7fbbba6b8 /gtk2_ardour | |
parent | abc9e6405a10028d3d757f33d4054f9f03216f03 (diff) |
Custom Monospace font for clocks and such (no dot in zero).
ArdourMono is a renamed version of
https://www.google.com/webfonts/specimen/Droid+Sans+Mono
distributed under Apache License, version 2.0.
Since the name Droid(R) is registered by Google Inc it was
renamed to ArdourMono - otherwise the .tff is unchanged (build 112)
git-svn-id: svn://localhost/ardour2/branches/3.0@14026 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour3_fonts.rc.in | 4 | ||||
-rw-r--r-- | gtk2_ardour/main.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/wscript | 6 |
3 files changed, 21 insertions, 4 deletions
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 <gtkmm2ext/popup.h> #include <gtkmm2ext/utils.h> +#include <fontconfig/fontconfig.h> + #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<const FcChar8*>(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') |