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 std::string PlatformFontMac::GetActualFontNameForTesting() const { | 121 std::string PlatformFontMac::GetActualFontNameForTesting() const { |
122 return base::SysNSStringToUTF8([native_font_ familyName]); | 122 return base::SysNSStringToUTF8([native_font_ familyName]); |
123 } | 123 } |
124 | 124 |
125 int PlatformFontMac::GetFontSize() const { | 125 int PlatformFontMac::GetFontSize() const { |
126 return font_size_; | 126 return font_size_; |
127 } | 127 } |
128 | 128 |
129 const FontRenderParams& PlatformFontMac::GetFontRenderParams() const { | 129 const FontRenderParams& PlatformFontMac::GetFontRenderParams() { |
130 return render_params_; | 130 return render_params_; |
131 } | 131 } |
132 | 132 |
133 NativeFont PlatformFontMac::GetNativeFont() const { | 133 NativeFont PlatformFontMac::GetNativeFont() const { |
134 return [[native_font_.get() retain] autorelease]; | 134 return [[native_font_.get() retain] autorelease]; |
135 } | 135 } |
136 | 136 |
137 //////////////////////////////////////////////////////////////////////////////// | 137 //////////////////////////////////////////////////////////////////////////////// |
138 // PlatformFontMac, private: | 138 // PlatformFontMac, private: |
139 | 139 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return new PlatformFontMac(native_font); | 190 return new PlatformFontMac(native_font); |
191 } | 191 } |
192 | 192 |
193 // static | 193 // static |
194 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, | 194 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, |
195 int font_size) { | 195 int font_size) { |
196 return new PlatformFontMac(font_name, font_size); | 196 return new PlatformFontMac(font_name, font_size); |
197 } | 197 } |
198 | 198 |
199 } // namespace gfx | 199 } // namespace gfx |
OLD | NEW |