| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "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/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_string_conversions.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "gfx/canvas_skia.h" | 13 #include "ui/gfx/canvas_skia.h" |
| 14 #include "gfx/font.h" | 14 #include "ui/gfx/font.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 | 17 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
| 19 // PlatformFontMac, public: | 19 // PlatformFontMac, public: |
| 20 | 20 |
| 21 PlatformFontMac::PlatformFontMac() { | 21 PlatformFontMac::PlatformFontMac() { |
| 22 font_size_ = [NSFont systemFontSize]; | 22 font_size_ = [NSFont systemFontSize]; |
| 23 style_ = gfx::Font::NORMAL; | 23 style_ = gfx::Font::NORMAL; |
| 24 NSFont* system_font = [NSFont systemFontOfSize:font_size_]; | 24 NSFont* system_font = [NSFont systemFontOfSize:font_size_]; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 // static | 136 // static |
| 137 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name, | 137 PlatformFont* PlatformFont::CreateFromNameAndSize(const string16& font_name, |
| 138 int font_size) { | 138 int font_size) { |
| 139 return new PlatformFontMac(font_name, font_size); | 139 return new PlatformFontMac(font_name, font_size); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace gfx | 142 } // namespace gfx |
| 143 | 143 |
| OLD | NEW |