blob: 72738bb7a22e7fe62108d94ff1050c309e54c442 [file] [log] [blame]
acondor03c0b572017-05-10 21:09:251// 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 Vollick4e26ac322017-07-11 14:58:215#ifndef CHROME_BROWSER_VR_FONT_FALLBACK_H_
6#define CHROME_BROWSER_VR_FONT_FALLBACK_H_
acondor03c0b572017-05-10 21:09:257
8#include <string>
9
10#include "third_party/icu/source/common/unicode/uchar.h"
11
12namespace gfx {
13class Font;
14} // namespace gfx
15
Ian Vollick4e26ac322017-07-11 14:58:2116namespace vr {
acondor03c0b572017-05-10 21:09:2517
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//
vollick3181fb562017-05-27 02:34:3725// 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//
34bool GetFallbackFontNameForChar(const gfx::Font& default_font,
35 UChar32 c,
36 const std::string& preferred_locale,
37 std::string* font_name);
acondor03c0b572017-05-10 21:09:2538
Ian Vollick4e26ac322017-07-11 14:58:2139} // namespace vr
acondor03c0b572017-05-10 21:09:2540
Ian Vollick4e26ac322017-07-11 14:58:2141#endif // CHROME_BROWSER_VR_FONT_FALLBACK_H_