Index: ui/gfx/font_list.cc |
diff --git a/ui/gfx/font_list.cc b/ui/gfx/font_list.cc |
index 3c1b0146cd57998cdc002e15dd58a3f54f146726..cb6cc9763de556591cf561610d23db741866fa8f 100644 |
--- a/ui/gfx/font_list.cc |
+++ b/ui/gfx/font_list.cc |
@@ -208,6 +208,18 @@ const std::string& FontList::GetFontDescriptionString() const { |
return font_description_string_; |
} |
+int FontList::GetFontSize() const { |
+ if (!fonts_.empty()) |
+ return fonts_[0].GetFontSize(); |
+ |
+ std::vector<std::string> font_names; |
+ int font_style; |
+ int font_size; |
+ ParseFontDescriptionString(font_description_string_, &font_names, |
+ &font_style, &font_size); |
+ return font_size; |
+} |
+ |
const std::vector<Font>& FontList::GetFonts() const { |
if (fonts_.empty()) { |
DCHECK(!font_description_string_.empty()); |
@@ -230,4 +242,8 @@ const std::vector<Font>& FontList::GetFonts() const { |
return fonts_; |
} |
+const Font& FontList::GetPrimaryFont() const { |
+ return GetFonts()[0]; |
+} |
+ |
} // namespace gfx |