OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LINUX_FONT_DELEGATE_H_ | 5 #ifndef UI_GFX_LINUX_FONT_DELEGATE_H_ |
6 #define UI_GFX_LINUX_FONT_DELEGATE_H_ | 6 #define UI_GFX_LINUX_FONT_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | |
10 #include "ui/gfx/font_render_params.h" | 11 #include "ui/gfx/font_render_params.h" |
11 #include "ui/gfx/gfx_export.h" | 12 #include "ui/gfx/gfx_export.h" |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 | 15 |
15 // Allows a Linux platform specific overriding of font preferences. | 16 class ScopedPangoFontDescription; |
17 | |
18 // Allows a Linux platform-specific overriding of font preferences. | |
16 class GFX_EXPORT LinuxFontDelegate { | 19 class GFX_EXPORT LinuxFontDelegate { |
17 public: | 20 public: |
18 virtual ~LinuxFontDelegate() {} | 21 virtual ~LinuxFontDelegate() {} |
19 | 22 |
20 // Sets the dynamically loaded singleton that provides font preferences. | 23 // Sets the dynamically loaded singleton that provides font preferences. |
21 // This pointer is not owned, and if this method is called a second time, | 24 // This pointer is not owned, and if this method is called a second time, |
22 // the first instance is not deleted. | 25 // the first instance is not deleted. |
23 static void SetInstance(LinuxFontDelegate* instance); | 26 static void SetInstance(LinuxFontDelegate* instance); |
24 | 27 |
25 // Returns a LinuxFontDelegate instance for the toolkit used in | 28 // Returns a LinuxFontDelegate instance for the toolkit used in |
26 // the user's desktop environment. | 29 // the user's desktop environment. |
27 // | 30 // |
28 // Can return NULL, in case no toolkit has been set. (For example, if we're | 31 // Can return NULL, in case no toolkit has been set. (For example, if we're |
29 // running with the "--ash" flag.) | 32 // running with the "--ash" flag.) |
30 static const LinuxFontDelegate* instance(); | 33 static const LinuxFontDelegate* instance(); |
31 | 34 |
32 // Whether we should antialias our text. | 35 // Returns the default font rendering settings. |
33 virtual bool UseAntialiasing() const = 0; | 36 virtual FontRenderParams GetDefaultFontRenderParams() const = 0; |
34 | 37 |
35 // What sort of text hinting should we apply? | 38 // Returns the Pango description for the default UI font. |
36 virtual FontRenderParams::Hinting GetHintingStyle() const = 0; | 39 virtual scoped_ptr<ScopedPangoFontDescription> |
Daniel Erat
2014/07/18 17:19:11
(i was concerned that the string that used to be r
msw
2014/07/18 19:14:44
Acknowledged.
| |
37 | 40 GetDefaultPangoFontDescription() const = 0; |
38 // What sort of subpixel rendering should we perform. | |
39 virtual FontRenderParams::SubpixelRendering | |
40 GetSubpixelRenderingStyle() const = 0; | |
41 | |
42 // Returns the Pango description for the default UI font. The format matches | |
43 // that returned by pango_font_description_to_string(). | |
44 virtual std::string GetDefaultFontDescription() const = 0; | |
45 }; | 41 }; |
46 | 42 |
47 } // namespace gfx | 43 } // namespace gfx |
48 | 44 |
49 #endif // UI_GFX_LINUX_FONT_DELEGATE_H_ | 45 #endif // UI_GFX_LINUX_FONT_DELEGATE_H_ |
OLD | NEW |