diff options
author | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 23:21:11 +0000 |
---|---|---|
committer | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 23:21:11 +0000 |
commit | 4909ecaf28e4b3bbc6171814548cf51e249ad45a (patch) | |
tree | 9b5220653638c509a1cece937d817578455bf174 /ui/gfx/render_text.h | |
parent | 106b09d97d773b9c0fff77ce2b44f32f43cad34c (diff) | |
download | chromium_src-4909ecaf28e4b3bbc6171814548cf51e249ad45a.zip chromium_src-4909ecaf28e4b3bbc6171814548cf51e249ad45a.tar.gz chromium_src-4909ecaf28e4b3bbc6171814548cf51e249ad45a.tar.bz2 |
Revert 116945 - Enable bold and italic text styles in RenderText*.
To do this, the following changes were made:
Added functions GetStyle() and DeriveFontList(style) to FontList. Changed font list to use strings "Bold" and "Italic" instead of PANGO_STYLE_ITALIC and PANGO_WEIGHT_BOLD - where were actually compile constants for setting attributes and weren't recognized by Pango in a font string. (Whereas "Bold" and "Italic" are recognized).
Add RenderText test that checks that the width of a bold string > the width of a non-bold string.
Add FontList tests for the new functions.
BUG=107893
TEST=Run views_examples_exe "Text Styles" examples and try bold and italic styles (this depends on an unreleased CL). Also, new tests in FontListTest and RenderTextTest.
Review URL: http://codereview.chromium.org/8963027
TBR=asvitkine@chromium.org
Review URL: http://codereview.chromium.org/9147016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.h')
-rw-r--r-- | ui/gfx/render_text.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h index 217f846..2a69ed0 100644 --- a/ui/gfx/render_text.h +++ b/ui/gfx/render_text.h @@ -39,13 +39,13 @@ class SkiaTextRenderer { void SetTypeface(SkTypeface* typeface); void SetTextSize(int size); void SetFont(const gfx::Font& font); - void SetFontStyle(int font_style); void SetForegroundColor(SkColor foreground); void DrawSelection(const std::vector<Rect>& selection, SkColor color); void DrawPosText(const SkPoint* pos, const uint16* glyphs, size_t glyph_count); void DrawDecorations(int x, int y, int width, bool underline, bool strike); + void DrawCursor(const gfx::Rect& bounds); private: SkCanvas* canvas_skia_; @@ -70,9 +70,12 @@ const SkColor kCursorColor = SK_ColorBLACK; struct UI_EXPORT StyleRange { StyleRange(); + // TODO(asvitkine): Add RenderText support for font weight. Add a |bold| style + // flag here, to be handled in RenderText's layout phase. For example, in + // RenderTextLinux, generate the new font description with font weight style + // option, create a Pango attribute from it, and append the attribute to + // layout. SkColor foreground; - // A gfx::Font::FontStyle flag to specify bold and italic styles. - int font_style; bool strike; bool underline; ui::Range range; |