• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 2D drawing capability.
21  *
22  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
23  *
24  * @since 8
25  * @version 1.0
26  */
27 
28 /**
29  * @file drawing_font_collection.h
30  *
31  * @brief Declares functions related to <b>FontCollection</b> in the drawing module.
32  *
33  * @kit ArkGraphics2D
34  * @library libnative_drawing.so
35  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
36  * @since 8
37  * @version 1.0
38  */
39 
40 #ifndef C_INCLUDE_DRAWING_FONT_COLLECTION_H
41 #define C_INCLUDE_DRAWING_FONT_COLLECTION_H
42 
43 #include "drawing_text_declaration.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 /**
49  * @brief Creates an <b>OH_Drawing_FontCollection</b> object.
50  *
51  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
52  * @return Returns the pointer to the <b>OH_Drawing_FontCollection</b> object created.
53  * @since 8
54  * @version 1.0
55  */
56 OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection(void);
57 
58 /**
59  * @brief Releases the memory occupied by an <b>OH_Drawing_FontCollection</b> object.
60  *
61  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
62  * @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
63  * @since 8
64  * @version 1.0
65  */
66 void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection* fontCollection);
67 
68 /**
69  * @brief Disable the font collection fallback.
70  *
71  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
72  * @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
73  * @since 12
74  * @version 1.0
75  * @deprecated since 18
76  * @useinstead OH_Drawing_DisableFontCollectionSystemFont
77  */
78 void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection* fontCollection);
79 
80 /**
81  * @brief Disable the font collection systemfont.
82  *
83  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
84  * @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
85  * @since 12
86  * @version 1.0
87  */
88 void OH_Drawing_DisableFontCollectionSystemFont(OH_Drawing_FontCollection* fontCollection);
89 
90 /**
91  * @brief Creates an <b>OH_Drawing_FontCollection</b> object with shared usage between
92  * <b>OH_Drawing_TypographyCreate</b>.
93  *
94  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
95  * @return Returns the pointer to the <b>OH_Drawing_FontCollection</b> object created.
96  * @since 12
97  * @version 1.0
98  */
99 OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection(void);
100 
101 /**
102  * @brief Clear font caches.
103  *
104  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
105  * @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
106  * @since 12
107  * @version 1.0
108  */
109 void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection* fontCollection);
110 
111 /**
112  * @brief Get the <b>OH_Drawing_FontCollection</b> global instance.
113  *
114  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
115  * @return Return the pointer to the <b>OH_Drawing_FontCollection</b> global instance.
116  * @since 14
117  * @version 1.0
118  */
119 OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance(void);
120 #ifdef __cplusplus
121 }
122 #endif
123 /** @} */
124 #endif