merge with 2.0-ongoing @ rev 3147

git-svn-id: svn://localhost/ardour2/branches/3.0@3152 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-03-17 20:54:03 +00:00
parent 19a4b99032
commit 997e4b1f9c
141 changed files with 3391 additions and 26001 deletions

View file

@ -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
}