| Index: ui/gfx/platform_font_ios.mm
|
| diff --git a/ui/gfx/platform_font_ios.mm b/ui/gfx/platform_font_ios.mm
|
| index 92608d322c0ec46295a393aef085e4e2ac79785f..1c373d332da70474ac14dfc5ad0f88ac51399c73 100644
|
| --- a/ui/gfx/platform_font_ios.mm
|
| +++ b/ui/gfx/platform_font_ios.mm
|
| @@ -6,6 +6,8 @@
|
|
|
| #import <UIKit/UIKit.h>
|
|
|
| +#include <cmath>
|
| +
|
| #include "base/basictypes.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| @@ -60,6 +62,10 @@ int PlatformFontIOS::GetAverageCharacterWidth() const {
|
| }
|
|
|
| int PlatformFontIOS::GetStringWidth(const base::string16& text) const {
|
| + return std::ceil(GetStringWidthF(text));
|
| +}
|
| +
|
| +float PlatformFontIOS::GetStringWidthF(const base::string16& text) const {
|
| NSString* ns_text = base::SysUTF16ToNSString(text);
|
| return [ns_text sizeWithFont:GetNativeFont()].width;
|
| }
|
|
|