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" |
10 #include "ui/gfx/font.h" | 12 #include "ui/gfx/font.h" |
11 #include "ui/gfx/gfx_export.h" | 13 #include "ui/gfx/gfx_export.h" |
12 | 14 |
13 namespace gfx { | 15 namespace gfx { |
14 | 16 |
15 class Font; | 17 class Font; |
16 | 18 |
17 // Given a font, returns the fonts that are suitable for fallback. | 19 // Given a font, returns the fonts that are suitable for fallback. |
18 GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font); | 20 GFX_EXPORT std::vector<Font> GetFallbackFonts(const Font& font); |
19 | 21 |
| 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 |
20 } // namespace gfx | 34 } // namespace gfx |
21 | 35 |
22 #endif // UI_GFX_FONT_FALLBACK_H_ | 36 #endif // UI_GFX_FONT_FALLBACK_H_ |
OLD | NEW |