1 
2 /*
3  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef C_INCLUDE_DRAWING_FONT_COLLECTION_H
18 #define C_INCLUDE_DRAWING_FONT_COLLECTION_H
19 
20 /**
21  * @addtogroup Drawing
22  * @{
23  *
24  * @brief Provides the 2D drawing capability.
25  *
26  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
27  *
28  * @since 8
29  * @version 1.0
30  */
31 
32 /**
33  * @file drawing_font_collection.h
34  *
35  * @brief Declares functions related to <b>FontCollection</b> in the drawing module.
36  *
37  * @since 8
38  * @version 1.0
39  */
40 
41 #include "drawing_text_declaration.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 /**
47  * @brief Creates an <b>OH_Drawing_FontCollection</b> object.
48  *
49  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
50  * @return Returns the pointer to the <b>OH_Drawing_FontCollection</b> object created.
51  * @since 8
52  * @version 1.0
53  */
54 OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection(void);
55 
56 /**
57  * @brief Creates an <b>OH_Drawing_FontCollection</b> object with shared usage between
58  * <b>OH_Drawing_TypographyCreate</b>.
59  *
60  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
61  * @return Returns the pointer to the <b>OH_Drawing_FontCollection</b> object created.
62  * @since 12
63  * @version 1.0
64  */
65 OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection(void);
66 
67 /**
68  * @brief Releases the memory occupied by an <b>OH_Drawing_FontCollection</b> object.
69  *
70  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
71  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
72  * @since 8
73  * @version 1.0
74  */
75 void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*);
76 
77 /**
78  * @brief Disable the font collection fallback.
79  *
80  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
81  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
82  * @since 12
83  * @version 1.0
84  */
85 void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection*);
86 
87 /**
88  * @brief Disable the font collection systemfont.
89  *
90  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
91  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
92  * @since 12
93  * @version 1.0
94  */
95 void OH_Drawing_DisableFontCollectionSystemFont(OH_Drawing_FontCollection*);
96 
97 /**
98  * @brief Clear font caches.
99  *
100  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
101  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
102  * @since 12
103  * @version 1.0
104  */
105 void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection*);
106 
107 /**
108  * @brief Get the <b>OH_Drawing_FontCollection</b> global instance.
109  *
110  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
111  * @return Return the pointer to the <b>OH_Drawing_FontCollection</b> global instance.
112  * @since 14
113  * @version 1.0
114  */
115 OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance(void);
116 #ifdef __cplusplus
117 }
118 #endif
119 /** @} */
120 #endif
121