diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
commit | 997e4b1f9cd7ccfc704b7c035051da7f60d831e7 (patch) | |
tree | 1236e40183b677abf4a2882e4cfe8e0a345eb24d /gtk2_ardour/utils.cc | |
parent | 19a4b990325577fc949ccd5d5fbad4520eb1df56 (diff) |
merge with 2.0-ongoing @ rev 3147
git-svn-id: svn://localhost/ardour2/branches/3.0@3152 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 5b67022ee0..a52969268a 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -17,6 +17,9 @@ */ +#include <pango/pangoft2.h> // for fontmap resolution control for GnomeCanvas +#include <pango/pangocairo.h> // for fontmap resolution control for GnomeCanvas + #include <cstdlib> #include <cctype> #include <fstream> @@ -32,6 +35,7 @@ #include <pbd/file_utils.h> #include <gtkmm2ext/utils.h> +#include <ardour/configuration.h> #include <ardour/filesystem_paths.h> @@ -48,6 +52,8 @@ using namespace sigc; using namespace Glib; using namespace PBD; +sigc::signal<void> DPIReset; + int pixel_width (const ustring& str, Pango::FontDescription& font) { @@ -706,6 +712,29 @@ key_is_legal_for_numeric_entry (guint keyval) return false; } +void +set_pango_fontsize () +{ + long val = ARDOUR::Config->get_font_scale(); + + /* FT2 rendering */ + + pango_ft2_font_map_set_resolution ((PangoFT2FontMap*) pango_ft2_font_map_for_display(), val/1024, val/1024); + + /* Cairo rendering, in case there is any */ + + pango_cairo_font_map_set_resolution ((PangoCairoFontMap*) pango_cairo_font_map_get_default(), val/1024); +} +void +reset_dpi () +{ + long val = ARDOUR::Config->get_font_scale(); + set_pango_fontsize (); + /* Xft rendering */ + gtk_settings_set_long_property (gtk_settings_get_default(), + "gtk-xft-dpi", val, "ardour"); + DPIReset();//Emit Signal +} |