blob: 1153bb136adc206afd3db72c1a0709f0b0afec43 [file] [log] [blame]
jbromana48801c2016-04-06 17:48:171// 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 Ferreirof6ba3bf2019-11-21 01:27:4310#include "base/files/file_path.h"
jbromana48801c2016-04-06 17:48:1711#include "third_party/icu/source/common/unicode/uchar.h"
jbromana48801c2016-04-06 17:48:1712#include "ui/gfx/gfx_export.h"
13
14namespace gfx {
15
Etienne Bergeronee1a5992019-10-08 16:01:2216// Exposed fallback font caches methods for testing.
17GFX_EXPORT size_t GetFallbackFontEntriesCacheSizeForTesting();
18GFX_EXPORT size_t GetFallbackFontListCacheSizeForTesting();
19GFX_EXPORT void ClearAllFontFallbackCachesForTesting();
Etienne Bergeronb27aab52019-09-30 16:51:4220
jbromana48801c2016-04-06 17:48:1721// 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 Ferreiro33fab432019-11-21 10:58:3831struct GFX_EXPORT FallbackFontData {
jbromana48801c2016-04-06 17:48:1732 std::string name;
Henrique Ferreirof6ba3bf2019-11-21 01:27:4333 base::FilePath filepath;
Henrique Ferreiro33fab432019-11-21 10:58:3834 int fontconfig_interface_id = 0;
jbromana48801c2016-04-06 17:48:1735 int ttc_index = 0;
36 bool is_bold = false;
37 bool is_italic = false;
Henrique Ferreiro33fab432019-11-21 10:58:3838
39 FallbackFontData();
40 FallbackFontData(const FallbackFontData& other);
jbromana48801c2016-04-06 17:48:1741};
Henrique Ferreiro33fab432019-11-21 10:58:3842
jbromana48801c2016-04-06 17:48:1743GFX_EXPORT FallbackFontData
44GetFallbackFontForChar(UChar32 c, const std::string& preferred_locale);
45
46} // namespace gfx
47
48#endif // UI_GFX_FONT_FALLBACK_LINUX_H_