diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 16:10:27 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-10 16:10:27 +0000 |
commit | 7aba39cb5325f773053a90dfa7e6b87eb2a1cda1 (patch) | |
tree | d7692a12eb85935e540dd2f782b53aad03cb75ff /ui/gfx/render_text_win.h | |
parent | 2e2929bd78578081b5665fcea6d085793df2c233 (diff) | |
download | chromium_src-7aba39cb5325f773053a90dfa7e6b87eb2a1cda1.zip chromium_src-7aba39cb5325f773053a90dfa7e6b87eb2a1cda1.tar.gz chromium_src-7aba39cb5325f773053a90dfa7e6b87eb2a1cda1.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_win.h')
-rw-r--r-- | ui/gfx/render_text_win.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/gfx/render_text_win.h b/ui/gfx/render_text_win.h index ac04c9f..4cbcb35 100644 --- a/ui/gfx/render_text_win.h +++ b/ui/gfx/render_text_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -27,6 +27,8 @@ struct TextRun { // Otherwise, this breaks the glyph shaping process. // See the example at: http://www.catch22.net/tuts/neatpad/12. SkColor foreground; + // A gfx::Font::FontStyle flag to specify bold and italic styles. + int font_style; bool strike; bool underline; |