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

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: Found an issue in GetFonts() and fixed it. 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 | « no previous file | 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..1ec36dc3e7a72c33b14bb7a6f773050bfdf716d8 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 has already
Alexei Svitkine (slow) 2013/12/20 17:52:19 Nit: it has -> it's
Yuki 2013/12/24 05:55:17 Done.
+ // 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 | « no previous file | ui/gfx/font_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698