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

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: 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..423a6fdd8e129909b9665b9aab0bdfddbfad2b97 100644
--- a/ui/gfx/font_list.cc
+++ b/ui/gfx/font_list.cc
@@ -34,7 +34,6 @@ void ParseFontDescriptionString(const std::string& font_description_string,
DCHECK_GT(*font_size, 0);
font_names->pop_back();
- // Font supports BOLD and ITALIC; underline is supported via RenderText.
*font_style = 0;
for (size_t i = 0; i < styles_size.size() - 1; ++i) {
// Styles are separated by white spaces. base::SplitString splits styles
@@ -45,6 +44,8 @@ void ParseFontDescriptionString(const std::string& font_description_string,
*font_style |= gfx::Font::BOLD;
else if (!styles_size[i].compare("Italic"))
*font_style |= gfx::Font::ITALIC;
+ else if (!styles_size[i].compare("Underline"))
Alexei Svitkine (slow) 2013/12/20 16:28:09 So the description string comes from a format used
Yuki 2013/12/20 17:34:52 You're right. Since underline is NOT considered a
+ *font_style |= gfx::Font::UNDERLINE;
else
NOTREACHED();
}
@@ -57,6 +58,8 @@ std::string FontStyleAndSizeToString(int font_style, int font_size) {
result += "Bold ";
if (font_style & gfx::Font::ITALIC)
result += "Italic ";
+ if (font_style & gfx::Font::UNDERLINE)
+ result += "Underline ";
result += base::IntToString(font_size);
result += "px";
return result;
« 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