| 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 #ifndef CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ | 5 #ifndef CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ |
| 6 #define CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ | 6 #define CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 #ifdef __OBJC__ | 11 #ifdef __OBJC__ |
| 12 @class NSFont; | 12 @class NSFont; |
| 13 #else | 13 #else |
| 14 class NSFont; | 14 class NSFont; |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 // Container to allow serializing an NSFont over IPC. | 17 // Container to allow serializing an NSFont over IPC. |
| 18 struct CONTENT_EXPORT FontDescriptor { | 18 struct CONTENT_EXPORT FontDescriptor { |
| 19 explicit FontDescriptor(NSFont* font); | 19 explicit FontDescriptor(NSFont* font); |
| 20 FontDescriptor(base::string16 name, float size); | 20 FontDescriptor(base::string16 name, float size); |
| 21 | 21 |
| 22 FontDescriptor() : font_point_size(0) {} | 22 FontDescriptor() : font_point_size(0) {} |
| 23 | 23 |
| 24 // Return an autoreleased NSFont corresponding to the font description. | 24 // Return an autoreleased NSFont corresponding to the font description. Note |
| 25 // that this will return nil if the font specified isn't available in this |
| 26 // process. |
| 25 NSFont* ToNSFont() const; | 27 NSFont* ToNSFont() const; |
| 26 | 28 |
| 27 // Name of the font. | 29 // Name of the font. |
| 28 base::string16 font_name; | 30 base::string16 font_name; |
| 29 | 31 |
| 30 // Size in points. | 32 // Size in points. |
| 31 float font_point_size; | 33 float font_point_size; |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 #endif // CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ | 36 #endif // CONTENT_COMMON_MAC_FONT_DESCRIPTOR_H_ |
| OLD | NEW |