Index: ui/gfx/font_list.cc |
diff --git a/ui/gfx/font_list.cc b/ui/gfx/font_list.cc |
index 72c877754e59bfeeba9bf63af3ad8f652385d7af..cd8abc173af2cc2478f9019e16eecdd3f0932725 100644 |
--- a/ui/gfx/font_list.cc |
+++ b/ui/gfx/font_list.cc |
@@ -195,6 +195,13 @@ int FontList::GetStringWidth(const base::string16& text) const { |
return GetPrimaryFont().GetStringWidth(text); |
} |
+float FontList::GetStringWidthF(const base::string16& text) const { |
Alexei Svitkine (slow)
2013/10/07 21:43:39
Do we need this? Or can everything that needs it u
jianli
2013/10/07 23:18:45
Done.
|
+ // Rely on the primary font metrics for the time being. |
+ // TODO(yukishiino): Not only the first font, all the fonts in the list should |
+ // be taken into account to compute the pixels needed to display |text|. |
+ return GetPrimaryFont().GetStringWidthF(text); |
+} |
+ |
int FontList::GetExpectedTextWidth(int length) const { |
// Rely on the primary font metrics for the time being. |
return GetPrimaryFont().GetExpectedTextWidth(length); |