| Index: ui/gfx/platform_font_ios.mm
|
| diff --git a/ui/gfx/platform_font_ios.mm b/ui/gfx/platform_font_ios.mm
|
| index c51b8cb7960673f1254b67d9e6adec7485b6cf39..350191b1a5d30d3fba806da0d8a9829392d3584f 100644
|
| --- a/ui/gfx/platform_font_ios.mm
|
| +++ b/ui/gfx/platform_font_ios.mm
|
| @@ -22,6 +22,7 @@ namespace gfx {
|
| PlatformFontIOS::PlatformFontIOS() {
|
| font_size_ = [UIFont systemFontSize];
|
| style_ = gfx::Font::NORMAL;
|
| + weight_ = gfx::Font::Weight::NORMAL;
|
| UIFont* system_font = [UIFont systemFontOfSize:font_size_];
|
| font_name_ = base::SysNSStringToUTF8([system_font fontName]);
|
| CalculateMetrics();
|
| @@ -29,21 +30,23 @@ PlatformFontIOS::PlatformFontIOS() {
|
|
|
| PlatformFontIOS::PlatformFontIOS(NativeFont native_font) {
|
| std::string font_name = base::SysNSStringToUTF8([native_font fontName]);
|
| - InitWithNameSizeAndStyle(font_name,
|
| - [native_font pointSize],
|
| - gfx::Font::NORMAL);
|
| + InitWithNameSizeAndStyle(font_name, [native_font pointSize],
|
| + gfx::Font::NORMAL, gfx::Font::Weight::NORMAL);
|
| }
|
|
|
| -PlatformFontIOS::PlatformFontIOS(const std::string& font_name,
|
| - int font_size) {
|
| - InitWithNameSizeAndStyle(font_name, font_size, gfx::Font::NORMAL);
|
| +PlatformFontIOS::PlatformFontIOS(const std::string& font_name, int font_size) {
|
| + InitWithNameSizeAndStyle(font_name, font_size, gfx::Font::NORMAL,
|
| + gfx::Font::Weight::NORMAL);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // PlatformFontIOS, PlatformFont implementation:
|
|
|
| -Font PlatformFontIOS::DeriveFont(int size_delta, int style) const {
|
| - return Font(new PlatformFontIOS(font_name_, font_size_ + size_delta, style));
|
| +Font PlatformFontIOS::DeriveFont(int size_delta,
|
| + int style,
|
| + gfx::Font::Weight weight) const {
|
| + return Font(
|
| + new PlatformFontIOS(font_name_, font_size_ + size_delta, style, weight));
|
| }
|
|
|
| int PlatformFontIOS::GetHeight() {
|
| @@ -66,6 +69,10 @@ int PlatformFontIOS::GetStyle() const {
|
| return style_;
|
| }
|
|
|
| +gfx::Font::Weight PlatformFontIOS::GetWeight() const {
|
| + return weight_;
|
| +}
|
| +
|
| const std::string& PlatformFontIOS::GetFontName() const {
|
| return font_name_;
|
| }
|
| @@ -94,16 +101,19 @@ NativeFont PlatformFontIOS::GetNativeFont() const {
|
|
|
| PlatformFontIOS::PlatformFontIOS(const std::string& font_name,
|
| int font_size,
|
| - int style) {
|
| - InitWithNameSizeAndStyle(font_name, font_size, style);
|
| + int style,
|
| + gfx::Font::Weight weight) {
|
| + InitWithNameSizeAndStyle(font_name, font_size, style, weight);
|
| }
|
|
|
| void PlatformFontIOS::InitWithNameSizeAndStyle(const std::string& font_name,
|
| int font_size,
|
| - int style) {
|
| + int style,
|
| + gfx::Font::Weight weight) {
|
| font_name_ = font_name;
|
| font_size_ = font_size;
|
| style_ = style;
|
| + weight_ = weight;
|
| CalculateMetrics();
|
| }
|
|
|
|
|