From 7aba39cb5325f773053a90dfa7e6b87eb2a1cda1 Mon Sep 17 00:00:00 2001 From: "asvitkine@chromium.org" Date: Tue, 10 Jan 2012 16:10:27 +0000 Subject: 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 --- ui/gfx/render_text_win.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/gfx/render_text_win.h') 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; -- cgit v1.1