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 UI_GFX_PLATFORM_FONT_H_ | 5 #ifndef UI_GFX_PLATFORM_FONT_H_ |
6 #define UI_GFX_PLATFORM_FONT_H_ | 6 #define UI_GFX_PLATFORM_FONT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 virtual int GetStringWidth(const base::string16& text) const = 0; | 53 virtual int GetStringWidth(const base::string16& text) const = 0; |
54 | 54 |
55 // Returns the expected number of horizontal pixels needed to display the | 55 // Returns the expected number of horizontal pixels needed to display the |
56 // specified length of characters. Call GetStringWidth() to retrieve the | 56 // specified length of characters. Call GetStringWidth() to retrieve the |
57 // actual number. | 57 // actual number. |
58 virtual int GetExpectedTextWidth(int length) const = 0; | 58 virtual int GetExpectedTextWidth(int length) const = 0; |
59 | 59 |
60 // Returns the style of the font. | 60 // Returns the style of the font. |
61 virtual int GetStyle() const = 0; | 61 virtual int GetStyle() const = 0; |
62 | 62 |
63 // Returns the font name in UTF-8. | 63 // Returns the specified font name in UTF-8. |
64 virtual std::string GetFontName() const = 0; | 64 virtual std::string GetFontName() const = 0; |
65 | 65 |
| 66 // Returns the actually used font name in UTF-8. |
| 67 virtual std::string GetActualFontNameForTesting() const = 0; |
| 68 |
66 // Returns the font size in pixels. | 69 // Returns the font size in pixels. |
67 virtual int GetFontSize() const = 0; | 70 virtual int GetFontSize() const = 0; |
68 | 71 |
69 // Returns the native font handle. | 72 // Returns the native font handle. |
70 virtual NativeFont GetNativeFont() const = 0; | 73 virtual NativeFont GetNativeFont() const = 0; |
71 | 74 |
72 protected: | 75 protected: |
73 virtual ~PlatformFont() {} | 76 virtual ~PlatformFont() {} |
74 | 77 |
75 private: | 78 private: |
76 friend class base::RefCounted<PlatformFont>; | 79 friend class base::RefCounted<PlatformFont>; |
77 }; | 80 }; |
78 | 81 |
79 } // namespace gfx | 82 } // namespace gfx |
80 | 83 |
81 #endif // UI_GFX_PLATFORM_FONT_H_ | 84 #endif // UI_GFX_PLATFORM_FONT_H_ |
OLD | NEW |