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_WIN_H_ | 5 #ifndef UI_GFX_PLATFORM_FONT_WIN_H_ |
6 #define UI_GFX_PLATFORM_FONT_WIN_H_ | 6 #define UI_GFX_PLATFORM_FONT_WIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "ui/gfx/gfx_export.h" | 14 #include "ui/gfx/gfx_export.h" |
15 #include "ui/gfx/platform_font.h" | 15 #include "ui/gfx/platform_font.h" |
16 | 16 |
17 struct IDWriteFactory; | 17 struct IDWriteFactory; |
| 18 struct IDWriteFont; |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 | 21 |
21 class GFX_EXPORT PlatformFontWin : public PlatformFont { | 22 class GFX_EXPORT PlatformFontWin : public PlatformFont { |
22 public: | 23 public: |
23 PlatformFontWin(); | 24 PlatformFontWin(); |
24 explicit PlatformFontWin(NativeFont native_font); | 25 explicit PlatformFontWin(NativeFont native_font); |
25 PlatformFontWin(const std::string& font_name, int font_size); | 26 PlatformFontWin(const std::string& font_name, int font_size); |
26 | 27 |
27 // Dialog units to pixels conversion. | 28 // Dialog units to pixels conversion. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 198 |
198 // Indirect reference to the HFontRef, which references the underlying HFONT. | 199 // Indirect reference to the HFontRef, which references the underlying HFONT. |
199 scoped_refptr<HFontRef> font_ref_; | 200 scoped_refptr<HFontRef> font_ref_; |
200 | 201 |
201 // Pointer to the global IDWriteFactory interface. | 202 // Pointer to the global IDWriteFactory interface. |
202 static IDWriteFactory* direct_write_factory_; | 203 static IDWriteFactory* direct_write_factory_; |
203 | 204 |
204 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); | 205 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); |
205 }; | 206 }; |
206 | 207 |
| 208 // Returns the family name for the |IDWriteFont| interface passed in. |
| 209 // The family name is returned in the |family_name| parameter. |
| 210 // Returns S_OK on success. |
| 211 HRESULT GetFamilyNameFromDirectWriteFont(IDWriteFont* dwrite_font, |
| 212 base::string16* family_name); |
| 213 |
207 } // namespace gfx | 214 } // namespace gfx |
208 | 215 |
209 #endif // UI_GFX_PLATFORM_FONT_WIN_H_ | 216 #endif // UI_GFX_PLATFORM_FONT_WIN_H_ |
OLD | NEW |