jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_GFX_FONT_FALLBACK_LINUX_H_ |
| 6 | #define UI_GFX_FONT_FALLBACK_LINUX_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
Henrique Ferreiro | f6ba3bf | 2019-11-21 01:27:43 | [diff] [blame] | 10 | #include "base/files/file_path.h" |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 11 | #include "third_party/icu/source/common/unicode/uchar.h" |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 12 | #include "ui/gfx/gfx_export.h" |
| 13 | |
| 14 | namespace gfx { |
| 15 | |
Etienne Bergeron | ee1a599 | 2019-10-08 16:01:22 | [diff] [blame] | 16 | // Exposed fallback font caches methods for testing. |
| 17 | GFX_EXPORT size_t GetFallbackFontEntriesCacheSizeForTesting(); |
| 18 | GFX_EXPORT size_t GetFallbackFontListCacheSizeForTesting(); |
| 19 | GFX_EXPORT void ClearAllFontFallbackCachesForTesting(); |
Etienne Bergeron | b27aab5 | 2019-09-30 16:51:42 | [diff] [blame] | 20 | |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 21 | // Return a font family which provides a glyph for the Unicode code point |
| 22 | // specified by character. |
| 23 | // c: a UTF-32 code point |
| 24 | // preferred_locale: preferred locale identifier for the |characters| |
| 25 | // (e.g. "en", "ja", "zh-CN") |
| 26 | // |
| 27 | // Returns: the font family instance. The instance has an empty font name if the |
| 28 | // request could not be satisfied. |
| 29 | // |
| 30 | // Previously blink::WebFontInfo::fallbackFontForChar. |
Henrique Ferreiro | 33fab43 | 2019-11-21 10:58:38 | [diff] [blame^] | 31 | struct GFX_EXPORT FallbackFontData { |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 32 | std::string name; |
Henrique Ferreiro | f6ba3bf | 2019-11-21 01:27:43 | [diff] [blame] | 33 | base::FilePath filepath; |
Henrique Ferreiro | 33fab43 | 2019-11-21 10:58:38 | [diff] [blame^] | 34 | int fontconfig_interface_id = 0; |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 35 | int ttc_index = 0; |
| 36 | bool is_bold = false; |
| 37 | bool is_italic = false; |
Henrique Ferreiro | 33fab43 | 2019-11-21 10:58:38 | [diff] [blame^] | 38 | |
| 39 | FallbackFontData(); |
| 40 | FallbackFontData(const FallbackFontData& other); |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 41 | }; |
Henrique Ferreiro | 33fab43 | 2019-11-21 10:58:38 | [diff] [blame^] | 42 | |
jbroman | a48801c | 2016-04-06 17:48:17 | [diff] [blame] | 43 | GFX_EXPORT FallbackFontData |
| 44 | GetFallbackFontForChar(UChar32 c, const std::string& preferred_locale); |
| 45 | |
| 46 | } // namespace gfx |
| 47 | |
| 48 | #endif // UI_GFX_FONT_FALLBACK_LINUX_H_ |