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_PANGO_H_ | 5 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_ |
6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ | 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/skia/include/core/SkRefCnt.h" | 11 #include "third_party/skia/include/core/SkRefCnt.h" |
12 #include "ui/gfx/platform_font.h" | 12 #include "ui/gfx/platform_font.h" |
13 | 13 |
14 class SkTypeface; | 14 class SkTypeface; |
15 class SkPaint; | 15 class SkPaint; |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 | 18 |
19 class UI_EXPORT PlatformFontPango : public PlatformFont { | 19 class UI_EXPORT PlatformFontPango : public PlatformFont { |
20 public: | 20 public: |
21 PlatformFontPango(); | 21 PlatformFontPango(); |
22 explicit PlatformFontPango(const Font& other); | |
23 explicit PlatformFontPango(NativeFont native_font); | 22 explicit PlatformFontPango(NativeFont native_font); |
24 PlatformFontPango(const std::string& font_name, int font_size); | 23 PlatformFontPango(const std::string& font_name, int font_size); |
25 | 24 |
26 // Converts |gfx_font| to a new pango font. Free the returned font with | 25 // Converts |gfx_font| to a new pango font. Free the returned font with |
27 // pango_font_description_free(). | 26 // pango_font_description_free(). |
28 static PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font); | 27 static PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font); |
29 | 28 |
30 // Resets and reloads the cached system font used by the default constructor. | 29 // Resets and reloads the cached system font used by the default constructor. |
31 // This function is useful when the system font has changed, for example, when | 30 // This function is useful when the system font has changed, for example, when |
32 // the locale has changed. | 31 // the locale has changed. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 double underline_position_pixels_; | 102 double underline_position_pixels_; |
104 double underline_thickness_pixels_; | 103 double underline_thickness_pixels_; |
105 | 104 |
106 // The default font, used for the default constructor. | 105 // The default font, used for the default constructor. |
107 static Font* default_font_; | 106 static Font* default_font_; |
108 }; | 107 }; |
109 | 108 |
110 } // namespace gfx | 109 } // namespace gfx |
111 | 110 |
112 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ | 111 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ |
OLD | NEW |