OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/platform_font_mac.h" | 5 #include "ui/gfx/platform_font_mac.h" |
6 | 6 |
7 #include <Cocoa/Cocoa.h> | 7 #include <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 int PlatformFontMac::GetStyle() const { | 121 int PlatformFontMac::GetStyle() const { |
122 return font_style_; | 122 return font_style_; |
123 } | 123 } |
124 | 124 |
125 std::string PlatformFontMac::GetFontName() const { | 125 std::string PlatformFontMac::GetFontName() const { |
126 return font_name_; | 126 return font_name_; |
127 } | 127 } |
128 | 128 |
| 129 std::string PlatformFontMac::GetActualFontNameForTesting() const { |
| 130 return base::SysNSStringToUTF8([native_font_ familyName]); |
| 131 } |
| 132 |
129 int PlatformFontMac::GetFontSize() const { | 133 int PlatformFontMac::GetFontSize() const { |
130 return font_size_; | 134 return font_size_; |
131 } | 135 } |
132 | 136 |
133 NativeFont PlatformFontMac::GetNativeFont() const { | 137 NativeFont PlatformFontMac::GetNativeFont() const { |
134 return [[native_font_.get() retain] autorelease]; | 138 return [[native_font_.get() retain] autorelease]; |
135 } | 139 } |
136 | 140 |
137 //////////////////////////////////////////////////////////////////////////////// | 141 //////////////////////////////////////////////////////////////////////////////// |
138 // PlatformFontMac, private: | 142 // PlatformFontMac, private: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 return new PlatformFontMac(native_font); | 188 return new PlatformFontMac(native_font); |
185 } | 189 } |
186 | 190 |
187 // static | 191 // static |
188 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, | 192 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, |
189 int font_size) { | 193 int font_size) { |
190 return new PlatformFontMac(font_name, font_size); | 194 return new PlatformFontMac(font_name, font_size); |
191 } | 195 } |
192 | 196 |
193 } // namespace gfx | 197 } // namespace gfx |
OLD | NEW |