Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: ui/gfx/font_list.cc

Issue 119993002: Makes gfx::FontList carry UNDERLINE flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled FontListTest.FontDescString_DeriveFontListWithSizeDeltaAndStyle on Android. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/gtest/filter/ui_unittests_disabled ('k') | ui/gfx/font_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_list.cc
diff --git a/ui/gfx/font_list.cc b/ui/gfx/font_list.cc
index 3b1ab9bcd1f0a405cd300907a5bf63e7b2781160..e977882bed90ea4d96a30e8e4859e4423839ca8e 100644
--- a/ui/gfx/font_list.cc
+++ b/ui/gfx/font_list.cc
@@ -254,8 +254,15 @@ const std::vector<Font>& FontList::GetFonts() const {
DCHECK(!font_description_string_.empty());
std::vector<std::string> font_names;
+ // It's possible that gfx::Font::UNDERLINE is specified and it's already
+ // stored in |font_style_| but |font_description_string_| doesn't have the
+ // underline info. So we should respect |font_style_| as long as it's
+ // valid.
+ int style = 0;
ParseFontDescriptionString(font_description_string_, &font_names,
- &font_style_, &font_size_);
+ &style, &font_size_);
+ if (font_style_ == -1)
+ font_style_ = style;
for (size_t i = 0; i < font_names.size(); ++i) {
DCHECK(!font_names[i].empty());
« no previous file with comments | « build/android/pylib/gtest/filter/ui_unittests_disabled ('k') | ui/gfx/font_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698