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 |
| 22 // Returns the family name for the |IDWriteFont| interface passed in. |
| 23 // The family name is returned in the |family_name_ret| parameter. |
| 24 // Returns S_OK on success. |
| 25 HRESULT GetFamilyNameFromDirectWriteFont(IDWriteFont* dwrite_font, |
| 26 base::string16* family_name_ret); |
| 27 |
21 class GFX_EXPORT PlatformFontWin : public PlatformFont { | 28 class GFX_EXPORT PlatformFontWin : public PlatformFont { |
22 public: | 29 public: |
23 PlatformFontWin(); | 30 PlatformFontWin(); |
24 explicit PlatformFontWin(NativeFont native_font); | 31 explicit PlatformFontWin(NativeFont native_font); |
25 PlatformFontWin(const std::string& font_name, int font_size); | 32 PlatformFontWin(const std::string& font_name, int font_size); |
26 | 33 |
27 // Dialog units to pixels conversion. | 34 // Dialog units to pixels conversion. |
28 // See http://support.microsoft.com/kb/145994 for details. | 35 // See http://support.microsoft.com/kb/145994 for details. |
29 int horizontal_dlus_to_pixels(int dlus) const { | 36 int horizontal_dlus_to_pixels(int dlus) const { |
30 return dlus * font_ref_->GetDluBaseX() / 4; | 37 return dlus * font_ref_->GetDluBaseX() / 4; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 207 |
201 // Pointer to the global IDWriteFactory interface. | 208 // Pointer to the global IDWriteFactory interface. |
202 static IDWriteFactory* direct_write_factory_; | 209 static IDWriteFactory* direct_write_factory_; |
203 | 210 |
204 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); | 211 DISALLOW_COPY_AND_ASSIGN(PlatformFontWin); |
205 }; | 212 }; |
206 | 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 |