Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/android/vr_shell/font_fallback.h

Issue 2914543002: [vr] Bail on unhandled code points. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "third_party/icu/source/common/unicode/uchar.h" 10 #include "third_party/icu/source/common/unicode/uchar.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 class Font; 13 class Font;
14 } // namespace gfx 14 } // namespace gfx
15 15
16 namespace vr_shell { 16 namespace vr_shell {
17 17
18 // Return a font name which provides a glyph for the Unicode code point 18 // Return a font name which provides a glyph for the Unicode code point
19 // specified by character. 19 // specified by character.
20 // default_font: The main font for which fallbacks are required 20 // default_font: The main font for which fallbacks are required
21 // c: a UTF-32 code point 21 // c: a UTF-32 code point
22 // preferred_locale: preferred locale identifier (if any) for |c| 22 // preferred_locale: preferred locale identifier (if any) for |c|
23 // (e.g. "en", "ja", "zh-CN") 23 // (e.g. "en", "ja", "zh-CN")
24 // 24 //
25 // Returns: the font name. The value is empty if the request could not be 25 // The funtion, if it succeeds, sets |font_name|. Even if it succeeds, it may
26 // satisfied or if the provided default font supports it. 26 // set |font_name| to the empty string if the character is supported by the
27 std::string GetFallbackFontNameForChar(const gfx::Font& default_font, 27 // default font.
28 UChar32 c, 28 //
29 const std::string& preferred_locale); 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);
30 38
31 } // namespace vr_shell 39 } // namespace vr_shell
32 40
33 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_ 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_FONT_FALLBACK_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/font_fallback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698