summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:07:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 16:07:26 +0000
commiteb7ce94497639ec1e9a7a1549dc941d8e28e98ba (patch)
tree440135ee2459831953143bcfc6d3738bc4a61f8b /gfx
parent8a7cc2034c02b3754ebd79349eef9c06e85b9529 (diff)
downloadchromium_src-eb7ce94497639ec1e9a7a1549dc941d8e28e98ba.zip
chromium_src-eb7ce94497639ec1e9a7a1549dc941d8e28e98ba.tar.gz
chromium_src-eb7ce94497639ec1e9a7a1549dc941d8e28e98ba.tar.bz2
Fix bug in gfx::Font if the PangoFontDescription's size is absolute.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3293003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r--gfx/platform_font_gtk.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gfx/platform_font_gtk.cc b/gfx/platform_font_gtk.cc
index db2e0c0..6458a48 100644
--- a/gfx/platform_font_gtk.cc
+++ b/gfx/platform_font_gtk.cc
@@ -131,6 +131,13 @@ PlatformFontGtk::PlatformFontGtk(NativeFont native_font) {
gint size = pango_font_description_get_size(native_font);
const char* family_name = pango_font_description_get_family(native_font);
+ if (pango_font_description_get_size_is_absolute(native_font)) {
+ // font_size_ is treated as scaled (see comment in GetPangoScaleFactor). If
+ // we get here the font size is absolute though, and we need to invert the
+ // scale so that when scaled in the rest of this class everything lines up.
+ size /= PlatformFontGtk::GetPangoScaleFactor();
+ }
+
// Find best match font for |family_name| to make sure we can get
// a SkTypeface for the default font.
// TODO(agl): remove this.