acondor | 03c0b57 | 2017-05-10 21:09:25 | [diff] [blame] | 1 | // Copyright 2017 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 | |
Ian Vollick | 4e26ac32 | 2017-07-11 14:58:21 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_VR_FONT_FALLBACK_H_ |
| 6 | #define CHROME_BROWSER_VR_FONT_FALLBACK_H_ |
acondor | 03c0b57 | 2017-05-10 21:09:25 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "third_party/icu/source/common/unicode/uchar.h" |
| 11 | |
| 12 | namespace gfx { |
| 13 | class Font; |
| 14 | } // namespace gfx |
| 15 | |
Ian Vollick | 4e26ac32 | 2017-07-11 14:58:21 | [diff] [blame] | 16 | namespace vr { |
acondor | 03c0b57 | 2017-05-10 21:09:25 | [diff] [blame] | 17 | |
| 18 | // Return a font name which provides a glyph for the Unicode code point |
| 19 | // specified by character. |
| 20 | // default_font: The main font for which fallbacks are required |
| 21 | // c: a UTF-32 code point |
| 22 | // preferred_locale: preferred locale identifier (if any) for |c| |
| 23 | // (e.g. "en", "ja", "zh-CN") |
| 24 | // |
vollick | 3181fb56 | 2017-05-27 02:34:37 | [diff] [blame] | 25 | // The funtion, if it succeeds, sets |font_name|. Even if it succeeds, it may |
| 26 | // set |font_name| to the empty string if the character is supported by the |
| 27 | // default font. |
| 28 | // |
| 29 | // Returns: |
| 30 | // * false, if the request could not be satisfied or if the provided default |
| 31 | // font supports it. |
| 32 | // * true, otherwis. |
| 33 | // |
| 34 | bool GetFallbackFontNameForChar(const gfx::Font& default_font, |
| 35 | UChar32 c, |
| 36 | const std::string& preferred_locale, |
| 37 | std::string* font_name); |
acondor | 03c0b57 | 2017-05-10 21:09:25 | [diff] [blame] | 38 | |
Ian Vollick | 4e26ac32 | 2017-07-11 14:58:21 | [diff] [blame] | 39 | } // namespace vr |
acondor | 03c0b57 | 2017-05-10 21:09:25 | [diff] [blame] | 40 | |
Ian Vollick | 4e26ac32 | 2017-07-11 14:58:21 | [diff] [blame] | 41 | #endif // CHROME_BROWSER_VR_FONT_FALLBACK_H_ |