• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 11
25  * @version 1.0
26  */
27 
28 /**
29  * @file drawing_register_font.h
30  *
31  * @brief Declares functions related to <b>FontManager</b> in the drawing module.
32  *
33  * @kit ArkGraphics2D
34  * @library libnative_drawing.so
35  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
36  * @since 11
37  * @version 1.0
38  */
39 
40 #ifndef C_INCLUDE_DRAWING_REGISTER_FONT_H
41 #define C_INCLUDE_DRAWING_REGISTER_FONT_H
42 
43 #include "drawing_text_declaration.h"
44 #include "drawing_types.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 /**
50  * @brief Defines an <b>OH_Drawing_RegisterFont</b>, which is used to register a customized font in the FontManager.
51  *
52  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
53  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
54  * @param fontFamily Indicates the family-name of the font which need to register.
55  * @param familySrc Indicates the path of the font file which need to register.
56  * @return error code.
57  * @since 11
58  * @version 1.0
59  */
60 uint32_t OH_Drawing_RegisterFont(OH_Drawing_FontCollection*, const char* fontFamily, const char* familySrc);
61 
62 /**
63  * @brief Defines an <b>OH_Drawing_RegisterFontBuffer</b>, which is used to register a customized font in the
64  *        FontManager.
65  *
66  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
67  * @param OH_Drawing_FontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
68  * @param fontFamily Indicates the family-name of the font which need to register.
69  * @param fontBuffer Indicates the buffer of the font file which need to register.
70  * @param length Indicates the length of the font file which need to register.
71  * @return error code.
72  * @since 11
73  * @version 1.0
74  */
75 uint32_t OH_Drawing_RegisterFontBuffer(OH_Drawing_FontCollection*, const char* fontFamily, uint8_t* fontBuffer,
76     size_t length);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 /** @} */
82 #endif