• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
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 /**
17  * @addtogroup Drawing
18  * @{
19  *
20  * @brief Provides the global text capability.
21  *
22  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
23  *
24  * @since 20
25  * @version 1.0
26  */
27 
28 /**
29  * @file drawing_text_global.h
30  *
31  * @brief Declares functions related to <b>run</b> in the drawing module.
32  *
33  * @kit ArkGraphics2D
34  * @library libnative_drawing.so
35  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
36  * @since 20
37  * @version 1.0
38  */
39 
40 #ifndef DRAWING_TEXT_GLOBAL_H
41 #define DRAWING_TEXT_GLOBAL_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /**
48  * @brief Defines text rendering high contrast mode to enhance readability.
49  * @since 20
50  * @version 1.0
51  */
52 typedef enum {
53     /** Follow system's high contrast settings for text rendering */
54     TEXT_FOLLOW_SYSTEM_HIGH_CONTRAST,
55     /** Disable high contrast rendering regardless of system settings */
56     TEXT_APP_DISABLE_HIGH_CONTRAST,
57     /** Enable high contrast rendering regardless of system settings */
58     TEXT_APP_ENABLE_HIGH_CONTRAST
59 } OH_Drawing_TextHighContrast;
60 
61 /**
62  * @brief Visual representations for undefined (.notdef) glyphs.
63  *
64  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
65  * @since 20
66  */
67 typedef enum {
68     /** Uses the glyph defined in the font file, which could be an empty box, blank space, or custom symbol etc. */
69     TEXT_NO_GLYPH_USE_DEFAULT = 0,
70     /** Always render tofu blocks for missing glyphs. */
71     TEXT_NO_GLYPH_USE_TOFU = 1,
72 } OH_Drawing_TextUndefinedGlyphDisplay;
73 
74 /**
75  * @brief Sets high contrast mode of text rendering.
76  *
77  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
78  * @param action <b>OH_Drawing_TextHighContrast</b> object.
79  * @since 20
80  */
81 void OH_Drawing_SetTextHighContrast(OH_Drawing_TextHighContrast action);
82 
83 /**
84  * @brief Controls how undefined glyphs are visually presented, affects all text rendered after this call.
85  *
86  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
87  * @param undefinedGlyphDisplay Indicates a <b>OH_Drawing_TextUndefinedGlyphDisplay</b> to be set.
88  * @since 20
89  */
90 void OH_Drawing_SetTextUndefinedGlyphDisplay(OH_Drawing_TextUndefinedGlyphDisplay undefinedGlyphDisplay);
91 #ifdef __cplusplus
92 }
93 #endif
94 #endif // DRAWING_TEXT_GLOBAL_H
95 
96 /** @} */