• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef TEXT_GLOBAL_CONFIG_H
17 #define TEXT_GLOBAL_CONFIG_H
18 
19 #include <atomic>
20 #include <cstddef>
21 #include <cstdint>
22 #include <string>
23 
24 namespace skia {
25 namespace textlayout {
26 constexpr const char* NOTDEF_FAMILY = "notdef";
27 
28 class TextGlobalConfig {
29 public:
30     static bool IsTargetApiVersion(uint32_t targetVersion);
31 
SetTargetVersion(uint32_t targetVersion)32     static void SetTargetVersion(uint32_t targetVersion)
33     {
34         bundleApiVersion_ = targetVersion;
35     }
36 
37     static void SetUndefinedGlyphDisplay(uint32_t undefinedGlyphDisplay);
38 
39     static bool UndefinedGlyphDisplayUseTofu(const std::string& family = NOTDEF_FAMILY);
40 
41 private:
42     static uint32_t bundleApiVersion_;
43     static std::atomic<bool> undefinedGlyphDisplayTofu_;
44 };
45 }  // namespace textlayout
46 }  // namespace skia
47 
48 #endif  // TEXT_GLOBAL_CONFIG_H