diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-14 19:40:55 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-14 19:40:55 +0000 |
commit | 1e8f699bfc66280866ab999cdacaae424b2c3658 (patch) | |
tree | 7ded0d91bb664786a44842a1d1d39debffff5b77 /ui/gfx/platform_font_pango.h | |
parent | 171207bca202d31efa3157227eff11d398ffdf1f (diff) | |
download | chromium_src-1e8f699bfc66280866ab999cdacaae424b2c3658.zip chromium_src-1e8f699bfc66280866ab999cdacaae424b2c3658.tar.gz chromium_src-1e8f699bfc66280866ab999cdacaae424b2c3658.tar.bz2 |
ui/gfx: Allow for font-specific rendering settings.
Let implementations attach a FontRenderParams to a
gfx::PlatformFont rather than using a single default
everywhere. On Linux and Chrome OS, query FontConfig for
font-specific rendering settings.
BUG=125235,375824
TBR=jorgelo@chromium.org
Review URL: https://codereview.chromium.org/382273002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/platform_font_pango.h')
-rw-r--r-- | ui/gfx/platform_font_pango.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ui/gfx/platform_font_pango.h b/ui/gfx/platform_font_pango.h index 3c3b46a..d0132eb 100644 --- a/ui/gfx/platform_font_pango.h +++ b/ui/gfx/platform_font_pango.h @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "skia/ext/refptr.h" #include "third_party/skia/include/core/SkRefCnt.h" +#include "ui/gfx/font_render_params.h" #include "ui/gfx/platform_font.h" class SkTypeface; @@ -22,7 +23,7 @@ class GFX_EXPORT PlatformFontPango : public PlatformFont { public: PlatformFontPango(); explicit PlatformFontPango(NativeFont native_font); - PlatformFontPango(const std::string& font_name, int font_size); + PlatformFontPango(const std::string& font_name, int font_size_pixels); // Converts |gfx_font| to a new pango font. Free the returned font with // pango_font_description_free(). @@ -55,6 +56,7 @@ class GFX_EXPORT PlatformFontPango : public PlatformFont { virtual std::string GetFontName() const OVERRIDE; virtual std::string GetActualFontNameForTesting() const OVERRIDE; virtual int GetFontSize() const OVERRIDE; + virtual const FontRenderParams& GetFontRenderParams() const OVERRIDE; virtual NativeFont GetNativeFont() const OVERRIDE; private: @@ -62,8 +64,9 @@ class GFX_EXPORT PlatformFontPango : public PlatformFont { // from DeriveFont. PlatformFontPango(const skia::RefPtr<SkTypeface>& typeface, const std::string& name, - int size, - int style); + int size_pixels, + int style, + const FontRenderParams& params); virtual ~PlatformFontPango(); // Initializes this object based on the passed-in details. If |typeface| is @@ -71,8 +74,9 @@ class GFX_EXPORT PlatformFontPango : public PlatformFont { void InitFromDetails( const skia::RefPtr<SkTypeface>& typeface, const std::string& font_family, - int font_size, - int style); + int font_size_pixels, + int style, + const FontRenderParams& params); // Initializes this object as a copy of another PlatformFontPango. void InitFromPlatformFont(const PlatformFontPango* other); @@ -91,12 +95,15 @@ class GFX_EXPORT PlatformFontPango : public PlatformFont { skia::RefPtr<SkTypeface> typeface_; - // Additional information about the face + // Additional information about the face. // Skia actually expects a family name and not a font name. std::string font_family_; int font_size_pixels_; int style_; + // Information describing how the font should be rendered. + FontRenderParams font_render_params_; + // Cached metrics, generated at construction. int ascent_pixels_; int height_pixels_; |