OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FONT_FALLBACK_H_ | 5 #ifndef UI_GFX_FONT_FALLBACK_H_ |
6 #define UI_GFX_FONT_FALLBACK_H_ | 6 #define UI_GFX_FONT_FALLBACK_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string16.h" | |
11 #include "build/build_config.h" | |
12 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
13 #include "ui/gfx/gfx_export.h" | 11 #include "ui/gfx/gfx_export.h" |
14 | 12 |
15 namespace gfx { | 13 namespace gfx { |
16 | 14 |
17 class Font; | 15 class Font; |
18 | 16 |
19 // Given a font, returns the fonts that are suitable for fallback. | 17 // Given a font, returns the fonts that are suitable for fallback. |
20 GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font); | 18 GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font); |
21 | 19 |
22 #if defined(OS_MACOSX) || defined(OS_WIN) | |
23 | |
24 // Finds a fallback font to render the specified |text| with respect to an | |
25 // initial |font|. Returns the resulting font via out param |result|. Returns | |
26 // |true| if a fallback font was found. | |
27 bool GFX_EXPORT GetFallbackFont(const Font& font, | |
28 const base::char16* text, | |
29 int text_length, | |
30 Font* result); | |
31 | |
32 #endif | |
33 | |
34 } // namespace gfx | 20 } // namespace gfx |
35 | 21 |
36 #endif // UI_GFX_FONT_FALLBACK_H_ | 22 #endif // UI_GFX_FONT_FALLBACK_H_ |
OLD | NEW |