Index: ui/gfx/platform_font_pango.cc |
diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc |
index 856acc2c432a209b0e451bfa86c8883db92d7e90..d8764b3c8a43239ec423846423148cac447285a2 100644 |
--- a/ui/gfx/platform_font_pango.cc |
+++ b/ui/gfx/platform_font_pango.cc |
@@ -18,6 +18,7 @@ |
#include "third_party/skia/include/core/SkTypeface.h" |
#include "ui/gfx/canvas.h" |
#include "ui/gfx/font.h" |
+#include "ui/gfx/font_list.h" |
#include "ui/gfx/pango_util.h" |
#if defined(TOOLKIT_GTK) |
@@ -202,6 +203,11 @@ int PlatformFontPango::GetStringWidth(const base::string16& text) const { |
Font(const_cast<PlatformFontPango*>(this))); |
} |
+float PlatformFontPango::GetStringWidthF(const base::string16& text) const { |
+ return Canvas::GetStringWidthF( |
+ text, FontList(Font(const_cast<PlatformFontPango*>(this)))); |
+} |
+ |
int PlatformFontPango::GetExpectedTextWidth(int length) const { |
double char_width = const_cast<PlatformFontPango*>(this)->GetAverageWidth(); |
return round(static_cast<float>(length) * char_width); |