• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Drawing
2
3
4## Overview
5
6The Drawing module provides the functions for 2D graphics rendering, text drawing, and image display. It uses the physical pixel unit, px. The module operates under a single-threaded model. The caller needs to manage thread safety and context state transitions.
7
8**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9
10**Since**: 8
11
12
13## Summary
14
15
16### Files
17
18| Name| Description|
19| -------- | -------- |
20| [drawing_bitmap.h](drawing__bitmap_8h.md) | Declares the functions related to the bitmap in the drawing module.|
21| [drawing_brush.h](drawing__brush_8h.md) | Declares the functions related to the brush in the drawing module.|
22| [drawing_canvas.h](drawing__canvas_8h.md) | Declares the functions related to the canvas in the drawing module. By default, the canvas has a black brush with anti-aliasing enabled but no any other style. This default brush takes effect only when no brush or pen is proactively set in the canvas. Canvases that are not set for recording will immediately draw the commands onto the bound bitmap, whereas canvases designated for recording will store the drawing commands for future replay.|
23| [drawing_color.h](drawing__color_8h.md) | Declares the functions related to the color in the drawing module.|
24| [drawing_color_filter.h](drawing__color__filter_8h.md) | Declares the functions related to the color filter in the drawing module.|
25| [drawing_error_code.h](drawing__error__code_8h.md) | Declares the functions related to the error code in the drawing module.|
26| [drawing_color_space.h](drawing__color__space_8h.md) | Declares the functions related to the color space in the drawing module.|
27| [drawing_filter.h](drawing__filter_8h.md) | Declares the functions related to the filter in the drawing module.|
28| [drawing_font.h](drawing__font_8h.md) | Declares the functions related to the font in the drawing module.|
29| [drawing_font_collection.h](drawing__font__collection_8h.md) | Declares the functions related to the font collection in the drawing module.|
30| [drawing_font_mgr.h](drawing__font__mgr_8h.md) | Declares the functions related to font management in the drawing module. The functions can be used to load fonts and match available fonts in the system.|
31| [drawing_gpu_context.h](drawing__gpu__context_8h.md) | Declares the functions related to the GPU context in the drawing module.|
32| [drawing_image.h](drawing__image_8h.md) | Declares the functions related to the image in the drawing module.|
33| [drawing_image_filter.h](drawing__image__filter_8h.md) | Declares the functions related to the image filter in the drawing module.|
34| [drawing_mask_filter.h](drawing__mask__filter_8h.md) | Declares the functions related to the mask filter in the drawing module.|
35| [drawing_matrix.h](drawing__matrix_8h.md) | Declares the functions related to the matrix in the drawing module.|
36| [drawing_memory_stream.h](drawing__memory__stream_8h.md) | Declares the functions related to the memory stream in the drawing module.|
37| [drawing_path.h](drawing__path_8h.md) | Declares the functions related to the path in the drawing module.|
38| [drawing_path_effect.h](drawing__path__effect_8h.md) | Declares the functions related to the bitmap in the drawing module.|
39| [drawing_pen.h](drawing__pen_8h.md) | Declares the functions related to the pen in the drawing module.|
40| [drawing_pixel_map.h](drawing__pixel__map_8h.md) | Declares the functions related to the pixel map in the drawing module.|
41| [drawing_point.h](drawing__point_8h.md) | Declares the functions related to the coordinate point in the drawing module.|
42| [drawing_record_cmd.h](drawing__record__cmd_8h.md) | Declares the functions related to a recording command object.|
43| [drawing_rect.h](drawing__rect_8h.md) | Declares the functions related to the rectangle in the drawing module.|
44| [drawing_region.h](drawing__region_8h.md) | Declares the functions related to the region in the drawing module, including creating a region, setting the boundary, and destroying a region.|
45| [drawing_register_font.h](drawing__register__font_8h.md) | Declares the functions related to the font manager in the drawing module.|
46| [drawing_round_rect.h](drawing__round__rect_8h.md) | Declares the functions related to the rounded rectangle in the drawing module.|
47| [drawing_sampling_options.h](drawing__sampling__options_8h.md) | Declares the functions related to the sampling options in the drawing module. It is used for image or texture sampling.|
48| [drawing_shader_effect.h](drawing__shader__effect_8h.md) | Declares the functions related to the shader effect in the drawing module.|
49| [drawing_shadow_layer.h](drawing__shadow__layer_8h.md) | Declares the functions related to the shadow in the drawing module.|
50| [drawing_surface.h](drawing__surface_8h.md) | Declares the functions related to the surface in the drawing module, including creating, destroying, and using the surface.|
51| [drawing_text_blob.h](drawing__text__blob_8h.md) | Declares the functions related to the text blob in the drawing module.|
52| [drawing_text_declaration.h](drawing__text__declaration_8h.md) | Declares the structs related to text in 2D drawing.|
53| [drawing_text_font_descriptor.h](drawing__text__font__descriptor_8h.md) | Declares the capabilities of font information, such as obtaining font information and searching for a font.|
54| [drawing_text_line.h](drawing__text__line_8h.md) | Declares the capabilities for obtaining the character position in a text line, obtaining the run information, and truncating text by line.|
55| [drawing_text_lineTypography.h](drawing__text__line_typography_8h.md) | Declares the functions related to line typography, including functions to determine the number of characters that can be formatted from a given position within the text.|
56| [drawing_text_run.h](drawing__text__run_8h.md) | Declares the capabilities of runs, such as obtaining the typographic boundary and drawing. |
57| [drawing_text_typography.h](drawing__text__typography_8h.md) | Declares the functions related to typography in the drawing module.|
58| [drawing_typeface.h](drawing__typeface_8h.md) | Declares the functions related to the typeface in the drawing module. Different platforms have their own default typefaces. You can also parse the .ttf file to obtain the typefaces specified by the third party, such as SimSun and SimHei.|
59| [drawing_types.h](drawing__types_8h.md) | Declares the data types of the canvas, brush, pen, bitmap, and path used to draw 2D graphics.|
60
61
62### Structs
63
64| Name| Description|
65| -------- | -------- |
66| struct  [OH_Drawing_String](_o_h___drawing___string.md) | Describes a string of characters encoded in UTF-16.|
67| struct  [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | Describes the pixel format of a bitmap, including the color type and alpha type.|
68| struct  [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) | Describes the measurement information about a font.|
69| struct  [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md) | Describes the options about the GPU context.|
70| struct  [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md) | Describes a run, which provides storage for glyphs and positions.|
71| struct  [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) | Describes the placeholder that acts as a span.|
72| struct  [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Describes the detailed information about a system font.|
73| struct  [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Describes the measurement information about a line of text.|
74| struct  [OH_Drawing_FontFallbackInfo](_o_h___drawing___font_fallback_info.md) | Describes the information about a font fallback.|
75| struct  [OH_Drawing_FontFallbackGroup](_o_h___drawing___font_fallback_group.md) | Describes the information about a font fallback group.|
76| struct  [OH_Drawing_FontAdjustInfo](_o_h___drawing___font_adjust_info.md) | Describes the information about a font weight mapping.|
77| struct  [OH_Drawing_FontAliasInfo](_o_h___drawing___font_alias_info.md) | Describes the information about a font alias.|
78| struct  [OH_Drawing_FontGenericInfo](_o_h___drawing___font_generic_info.md) | Describes the information about generic fonts supported by the system.|
79| struct  [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) | Describes the information about a system font configuration.|
80| struct  [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Describes a font style.|
81| struct  [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) | Describes a font feature.|
82| struct  [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Describes a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts.|
83| struct  [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Describes a two-dimensional coordinate point.|
84| struct  [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) | Describes a three-dimensional coordinate point.|
85| struct  [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | Describes the image information.|
86| struct  [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) | Describes the style of a rectangle.|
87
88
89### Types
90
91| Name| Description|
92| -------- | -------- |
93| typedef enum [OH_Drawing_PathDashStyle](#oh_drawing_pathdashstyle) [OH_Drawing_PathDashStyle](#oh_drawing_pathdashstyle) | Defines an enum for the drawing styles for path effects. |
94| typedef struct [OH_Drawing_String](_o_h___drawing___string.md) [OH_Drawing_String](#oh_drawing_string) | Defines a struct for a string of characters encoded in UTF-16.|
95| typedef enum [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype) [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype) | Defines an enum for the system font types.|
96| typedef bool(\* [Drawing_CaretOffsetsCallback](#drawing_caretoffsetscallback)) (double offset, int32_t index, bool leadingEdge) | Defines a custom callback used to receive the offset and index of each character in a text line object as its parameters.|
97| typedef struct [OH_Drawing_LineTypography](#oh_drawing_linetypography) [OH_Drawing_LineTypography](#oh_drawing_linetypography) | Defines a struct used to extract a single line of data from a piece of text for typography.|
98| typedef struct [OH_Drawing_TextTab](#oh_drawing_texttab) [OH_Drawing_TextTab](#oh_drawing_texttab) | Defines a struct used to manage text tabs.|
99| typedef struct [OH_Drawing_TextLine](#oh_drawing_textline) [OH_Drawing_TextLine](#oh_drawing_textline) | Defines a struct used to manage text lines.|
100| typedef struct [OH_Drawing_Run](#oh_drawing_run) [OH_Drawing_Run](#oh_drawing_run) | Defines a struct used to manage runs.|
101| typedef struct [OH_Drawing_Array](#oh_drawing_array) [OH_Drawing_Array](#oh_drawing_array) | Defines a struct for an array object, which is used to store multiple objects of the same type.|
102| typedef struct [OH_Drawing_FontArguments](#oh_drawing_fontarguments) [OH_Drawing_FontArguments](#oh_drawing_fontarguments) | Defines a struct for font arguments.|
103| typedef struct [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) | Defines the recording command tool, which is used to generate recording commands.|
104| typedef struct [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) | Defines the recording command class, which is used to store the set of recording commands.|
105| typedef enum [OH_Drawing_ErrorCode](#oh_drawing_errorcode)  [OH_Drawing_ErrorCode](#oh_drawing_errorcode) | Defines an enum for the error codes that may be generated by the module.|
106| typedef enum [OH_Drawing_PathOpMode](#oh_drawing_pathopmode)  [OH_Drawing_PathOpMode](#oh_drawing_pathopmode) | Defines an enum for the operation modes available for a path.|
107| typedef enum [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags)  [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags) | Defines an enum for the types of matrix information obtained during path measurement.|
108| typedef enum [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode)  [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode) | Defines an enum for the operation modes available for a region.|
109| typedef struct [OH_Drawing_ImageFilter](#oh_drawing_imagefilter)  [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) | Defines a struct for an image filter, which is used to operate all color bits that make up image pixels.|
110| typedef struct [OH_Drawing_Filter](#oh_drawing_filter)  [OH_Drawing_Filter](#oh_drawing_filter) | Defines a struct for a filter, which consists of a color filter, mask filter, and image filter.|
111| typedef struct [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md)  [OH_Drawing_BitmapFormat](#oh_drawing_bitmapformat) | Defines a struct for the pixel format of a bitmap, including the color type and alpha type.|
112| typedef enum [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint)  [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint) | Defines an enum for the constraint types of the source rectangle.|
113| typedef enum [OH_Drawing_PointMode](#oh_drawing_pointmode)  [OH_Drawing_PointMode](#oh_drawing_pointmode) | Defines an enum for the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.|
114| typedef enum [OH_Drawing_VertexMode](#oh_drawing_vertexmode)  [OH_Drawing_VertexMode](#oh_drawing_vertexmode) | Defines an enum for the modes of interpreting the geometry of a given vertex.|
115| typedef enum [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop)  [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) | Defines an enum for the canvas clipping modes.|
116| typedef enum [OH_Drawing_FontEdging](#oh_drawing_fontedging)  [OH_Drawing_FontEdging](#oh_drawing_fontedging) | Defines an enum for the font edging types.|
117| typedef enum [OH_Drawing_FontHinting](#oh_drawing_fonthinting)  [OH_Drawing_FontHinting](#oh_drawing_fonthinting) | Defines an enum for the font hinting types.|
118| typedef struct [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md)  [OH_Drawing_Font_Metrics](#oh_drawing_font_metrics) | Defines a struct for the measurement information about a font.|
119| typedef struct [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md)  [OH_Drawing_GpuContextOptions](#oh_drawing_gpucontextoptions) | Defines a struct for the options about the GPU context.|
120| typedef enum [OH_Drawing_BlurType](#oh_drawing_blurtype)  [OH_Drawing_BlurType](#oh_drawing_blurtype) | Defines an enum for the blur types.|
121| typedef enum [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit)  [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit) | Defines an enum for the matrix scaling modes.|
122| typedef enum [OH_Drawing_PathDirection](#oh_drawing_pathdirection)  [OH_Drawing_PathDirection](#oh_drawing_pathdirection) | Defines an enum for the directions of a closed contour.|
123| typedef enum [OH_Drawing_PathFillType](#oh_drawing_pathfilltype)  [OH_Drawing_PathFillType](#oh_drawing_pathfilltype) | Defines an enum for the fill types of a path.|
124| typedef enum [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)  [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode) | Defines an enum for the path adding modes.|
125| typedef enum [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle)  [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) | Defines an enum for the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.|
126| typedef enum [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle)  [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) | Defines an enum for the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.|
127| typedef enum [OH_Drawing_CornerPos](#oh_drawing_cornerpos)  [OH_Drawing_CornerPos](#oh_drawing_cornerpos) | Defines an enum for the corner positions of a rounded rectangle.|
128| typedef enum [OH_Drawing_FilterMode](#oh_drawing_filtermode)  [OH_Drawing_FilterMode](#oh_drawing_filtermode) | Defines an enum for the filter modes.|
129| typedef enum [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode)  [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode) | Defines an enum for the mipmap modes.|
130| typedef enum [OH_Drawing_TileMode](#oh_drawing_tilemode)  [OH_Drawing_TileMode](#oh_drawing_tilemode) | Defines an enum for the tile modes of the shader effect.|
131| typedef struct [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md)  [OH_Drawing_RunBuffer](#oh_drawing_runbuffer) | Defines a struct for a run, which provides storage for glyphs and positions.|
132| typedef struct [OH_Drawing_FontCollection](#oh_drawing_fontcollection)  [OH_Drawing_FontCollection](#oh_drawing_fontcollection) | Defines a struct used to load fonts.|
133| typedef struct [OH_Drawing_Typography](#oh_drawing_typography)  [OH_Drawing_Typography](#oh_drawing_typography) | Defines a struct used to manage the typography layout and display.|
134| typedef struct [OH_Drawing_TextStyle](#oh_drawing_textstyle)  [OH_Drawing_TextStyle](#oh_drawing_textstyle) | Defines a struct used to manage text colors and decorations.|
135| typedef struct [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle)  [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) | Defines a struct used to manage the typography style, such as the text direction.|
136| typedef struct [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate)  [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) | Defines a struct used to create an [OH_Drawing_Typography](#oh_drawing_typography) object.|
137| typedef struct [OH_Drawing_TextBox](#oh_drawing_textbox)  [OH_Drawing_TextBox](#oh_drawing_textbox) | Defines a struct for a text box, which is used to receive the rectangle size, direction, and quantity.|
138| typedef struct [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity)  [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) | Defines a struct used to receive the position and affinity of a glyph.|
139| typedef struct [OH_Drawing_Range](#oh_drawing_range)  [OH_Drawing_Range](#oh_drawing_range) | Defines a struct used to receive the start position and end position of a glyph.|
140| typedef struct [OH_Drawing_TextShadow](#oh_drawing_textshadow)  [OH_Drawing_TextShadow](#oh_drawing_textshadow) | Defines a struct used to manage text shadows.|
141| typedef struct [OH_Drawing_FontParser](#oh_drawing_fontparser)  [OH_Drawing_FontParser](#oh_drawing_fontparser) | Defines a struct used to parse system font files.|
142| typedef enum [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment)  [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment) | Defines an enum for the vertical alignment modes of placeholders.|
143| typedef struct [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md)  [OH_Drawing_PlaceholderSpan](#oh_drawing_placeholderspan) | Defines a struct for the placeholder that acts as a span.|
144| typedef enum [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle)  [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle) | Defines an enum for the text decoration styles.|
145| typedef enum [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal)  [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal) | Defines an enum for the ellipsis styles.|
146| typedef enum [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy)  [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy) | Defines an enum for the text break strategies.|
147| typedef enum [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype)  [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype) | Defines an enum for the word break types.|
148| typedef enum [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle)  [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle) | Defines an enum for the rectangle height styles.|
149| typedef enum [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle)  [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle) | Defines an enum for the rectangle width styles.|
150| typedef struct [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md)  [OH_Drawing_FontDescriptor](#oh_drawing_fontdescriptor) | Defines a struct for the detailed information about a system font.|
151| typedef struct [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md)  [OH_Drawing_LineMetrics](#oh_drawing_linemetrics) | Defines a struct for the measurement information about a line of text.|
152| typedef struct [OH_Drawing_FontFallbackInfo](_o_h___drawing___font_fallback_info.md)  [OH_Drawing_FontFallbackInfo](#oh_drawing_fontfallbackinfo) | Defines a struct for the information about a font fallback.|
153| typedef struct [OH_Drawing_FontFallbackGroup](_o_h___drawing___font_fallback_group.md)  [OH_Drawing_FontFallbackGroup](#oh_drawing_fontfallbackgroup) | Defines a struct for the information about a font fallback group.|
154| typedef struct [OH_Drawing_FontAdjustInfo](_o_h___drawing___font_adjust_info.md)  [OH_Drawing_FontAdjustInfo](#oh_drawing_fontadjustinfo) | Defines a struct for the information about a font weight mapping.|
155| typedef struct [OH_Drawing_FontAliasInfo](_o_h___drawing___font_alias_info.md)  [OH_Drawing_FontAliasInfo](#oh_drawing_fontaliasinfo) | Defines a struct for the information about a font alias.|
156| typedef struct [OH_Drawing_FontGenericInfo](_o_h___drawing___font_generic_info.md)  [OH_Drawing_FontGenericInfo](#oh_drawing_fontgenericinfo) | Defines a struct for the information about generic fonts supported by the system.|
157| typedef struct [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md)  [OH_Drawing_FontConfigInfo](#oh_drawing_fontconfiginfo) | Defines a struct for the information about a system font configuration.|
158| typedef struct [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md)  [OH_Drawing_FontStyleStruct](#oh_drawing_fontstylestruct) | Defines a struct for a font style.|
159| typedef struct [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md)  [OH_Drawing_StrutStyle](#oh_drawing_strutstyle) | Defines a struct for a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts.|
160| typedef struct [OH_Drawing_Canvas](#oh_drawing_canvas)  [OH_Drawing_Canvas](#oh_drawing_canvas) | Defines a struct for a rectangular canvas, on which various shapes, images, and texts can be drawn by using the brush and pen.|
161| typedef struct [OH_Drawing_Pen](#oh_drawing_pen)  [OH_Drawing_Pen](#oh_drawing_pen) | Defines a struct for a pen, which is used to describe the style and color to outline a shape.|
162| typedef struct [OH_Drawing_Region](#oh_drawing_region)  [OH_Drawing_Region](#oh_drawing_region) | Defines a struct for a region, which represents a closed area on the canvas for more accurate graphic control.|
163| typedef struct [OH_Drawing_Brush](#oh_drawing_brush)  [OH_Drawing_Brush](#oh_drawing_brush) | Defines a struct for a brush, which is used to describe the style and color to fill in a shape.|
164| typedef struct [OH_Drawing_Path](#oh_drawing_path)  [OH_Drawing_Path](#oh_drawing_path) | Defines a struct for a path, which is used to customize various shapes.|
165| typedef struct [OH_Drawing_PixelMap](#oh_drawing_pixelmap)  [OH_Drawing_PixelMap](#oh_drawing_pixelmap) | Defines a struct for a pixel map, which is used to wrap the real pixel map supported by the image framework.|
166| typedef struct [OH_Drawing_Bitmap](#oh_drawing_bitmap)  [OH_Drawing_Bitmap](#oh_drawing_bitmap) | Defines a struct for a bitmap, which is a memory area that contains the pixel data of a shape.|
167| typedef struct [OH_Drawing_Point](#oh_drawing_point)  [OH_Drawing_Point](#oh_drawing_point) | Defines a struct for a coordinate point.|
168| typedef struct [OH_Drawing_ColorSpace](#oh_drawing_colorspace)  [OH_Drawing_ColorSpace](#oh_drawing_colorspace) | Defines a struct for a color space, which is used to describe the color information.|
169| typedef struct [OH_Drawing_Point2D](_o_h___drawing___point2_d.md)  [OH_Drawing_Point2D](#oh_drawing_point2d) | Defines a struct for a two-dimensional coordinate point.|
170| typedef [OH_Drawing_Point2D](_o_h___drawing___point2_d.md)  [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) | Defines a struct for the radii of a rounded corner. The radii consist of the radius in the x-axis direction and that in the y-axis direction.|
171| typedef struct [OH_Drawing_Point3D](_o_h___drawing___point3_d.md)  [OH_Drawing_Point3D](#oh_drawing_point3d) | Defines a struct for a three-dimensional coordinate point.|
172| typedef struct [OH_Drawing_PathEffect](#oh_drawing_patheffect)  [OH_Drawing_PathEffect](#oh_drawing_patheffect) | Defines a struct for a path effect that affects the stroke.|
173| typedef struct [OH_Drawing_Rect](#oh_drawing_rect)  [OH_Drawing_Rect](#oh_drawing_rect) | Defines a struct for a rectangle.|
174| typedef struct [OH_Drawing_RoundRect](#oh_drawing_roundrect)  [OH_Drawing_RoundRect](#oh_drawing_roundrect) | Defines a struct for a rounded rectangle.|
175| typedef struct [OH_Drawing_Matrix](#oh_drawing_matrix)  [OH_Drawing_Matrix](#oh_drawing_matrix) | Defines a struct for a matrix, which is used to describe coordinate transformation.|
176| typedef struct [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect)  [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) | Defines a struct for a shader effect, which is used to describe the source color of the drawn content.|
177| typedef struct [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer)  [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) | Defines a struct for a shadow, which is used to describe the shadow layer of the drawn content.|
178| typedef struct [OH_Drawing_Filter](#oh_drawing_filter)  [OH_Drawing_Filter](#oh_drawing_filter) | Defines a struct for a filter, which consists of a color filter and mask filter.|
179| typedef struct [OH_Drawing_MaskFilter](#oh_drawing_maskfilter)  [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) | Defines a struct for a mask filter.|
180| typedef struct [OH_Drawing_ColorFilter](#oh_drawing_colorfilter)  [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) | Defines a struct for a color filter, which is used to convert a color into a new one.|
181| typedef struct [OH_Drawing_Font](#oh_drawing_font)  [OH_Drawing_Font](#oh_drawing_font) | Defines a struct for a font.|
182| typedef struct [OH_Drawing_MemoryStream](#oh_drawing_memorystream)  [OH_Drawing_MemoryStream](#oh_drawing_memorystream) | Defines a struct for a memory stream.|
183| typedef struct [OH_Drawing_Typeface](#oh_drawing_typeface)  [OH_Drawing_Typeface](#oh_drawing_typeface) | Defines a struct for a typeface.|
184| typedef struct [OH_Drawing_TextBlob](#oh_drawing_textblob)  [OH_Drawing_TextBlob](#oh_drawing_textblob) | Defines a struct for a text blob, an immutable container that holds multiple texts. Each text blob consists of glyphs and position.|
185| typedef struct [OH_Drawing_Image](#oh_drawing_image)  [OH_Drawing_Image](#oh_drawing_image) | Defines a struct for an image that describes a two-dimensional pixel array.|
186| typedef struct [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions)  [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) | Defines a struct for sampling options, which describe the sampling methods for images and bitmaps.|
187| typedef struct [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder)  [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) | Defines a struct for a text blob builder, which is used to build a text blob.|
188| typedef struct [OH_Drawing_GpuContext](#oh_drawing_gpucontext)  [OH_Drawing_GpuContext](#oh_drawing_gpucontext) | Defines a struct for the GPU context, which is used to describe the GPU backend context.|
189| typedef struct [OH_Drawing_Surface](#oh_drawing_surface)  [OH_Drawing_Surface](#oh_drawing_surface) | Defines a struct for a surface, which is used to manage the content drawn on the canvas.|
190| typedef enum [OH_Drawing_ColorFormat](#oh_drawing_colorformat)  [OH_Drawing_ColorFormat](#oh_drawing_colorformat) | Defines an enum for the storage formats of bitmap pixels.|
191| typedef enum [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat)  [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) | Defines an enum for the alpha formats of bitmap pixels.|
192| typedef enum [OH_Drawing_BlendMode](#oh_drawing_blendmode)  [OH_Drawing_BlendMode](#oh_drawing_blendmode) | Defines an enum for the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule).|
193| typedef struct [OH_Drawing_Image_Info](_o_h___drawing___image___info.md)  [OH_Drawing_Image_Info](#oh_drawing_image_info) | Defines a struct for the image information.|
194| typedef struct [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md)  [OH_Drawing_RectStyle_Info](#oh_drawing_rectstyle_info) | Defines a struct for the style of a rectangle.|
195| typedef enum [OH_Drawing_TextEncoding](#oh_drawing_textencoding)  [OH_Drawing_TextEncoding](#oh_drawing_textencoding) | Defines an enum for the text encoding types.|
196| typedef struct [OH_Drawing_FontMgr](#oh_drawing_fontmgr)  [OH_Drawing_FontMgr](#oh_drawing_fontmgr) | Defines a struct for the font manager, which is used for font management.|
197| typedef struct [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset)  [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) | Defines a struct for a font style set, which is used for font style family matching.|
198| typedef enum [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) | Defines an enum for the shadow flags.|
199
200### Enums
201
202| Name| Description|
203| -------- | -------- |
204| [OH_Drawing_PathDashStyle](#oh_drawing_pathdashstyle-1) { DRAWING_PATH_DASH_STYLE_TRANSLATE, DRAWING_PATH_DASH_STYLE_ROTATE, DRAWING_PATH_DASH_STYLE_MORPH } | Enumerates the drawing styles for path effects. |
205| [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype-1) { ALL = 1 << 0, GENERIC = 1 << 1, STYLISH = 1 << 2, INSTALLED = 1 << 3, CUSTOMIZED = 1 << 4 } | Enumerates the system font types.|
206| [OH_Drawing_ErrorCode](#oh_drawing_errorcode-1) { OH_DRAWING_SUCCESS = 0, OH_DRAWING_ERROR_NO_PERMISSION = 201, OH_DRAWING_ERROR_INVALID_PARAMETER = 401, OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE = 26200001,OH_DRAWING_ERROR_ALLOCATION_FAILED = 26200002 } | Enumerates the error codes that may be generated by the module.|
207| [OH_Drawing_PathOpMode](#oh_drawing_pathopmode-1) {<br>PATH_OP_MODE_DIFFERENCE, PATH_OP_MODE_INTERSECT, PATH_OP_MODE_UNION, PATH_OP_MODE_XOR,<br>PATH_OP_MODE_REVERSE_DIFFERENCE<br>} | Enumerates the operation modes available for a path.|
208| [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags-1) { GET_POSITION_MATRIX, GET_TANGENT_MATRIX, GET_POSITION_AND_TANGENT_MATRIX } | Enumerates the types of matrix information obtained during path measurement.|
209| [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode-1) {<br>REGION_OP_MODE_DIFFERENCE, REGION_OP_MODE_INTERSECT, REGION_OP_MODE_UNION, REGION_OP_MODE_XOR,<br>REGION_OP_MODE_REVERSE_DIFFERENCE, REGION_OP_MODE_REPLACE<br>} | Enumerates the operation modes available for a region.|
210| [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint-1) { STRICT_SRC_RECT_CONSTRAINT, FAST_SRC_RECT_CONSTRAINT } | Enumerates the constraint types of the source rectangle.|
211| [OH_Drawing_PointMode](#oh_drawing_pointmode-1) { POINT_MODE_POINTS, POINT_MODE_LINES, POINT_MODE_POLYGON } | Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.|
212| [OH_Drawing_VertexMode](#oh_drawing_vertexmode-1) { VERTEX_MODE_TRIANGLES, VERTEX_MODE_TRIANGLESSTRIP, VERTEX_MODE_TRIANGLEFAN } | Enumerates the modes of interpreting the geometry of a given vertex.|
213| [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop-1) { DIFFERENCE, INTERSECT } | Enumerates the canvas clipping modes.|
214| [OH_Drawing_FontEdging](#oh_drawing_fontedging-1) { FONT_EDGING_ALIAS, FONT_EDGING_ANTI_ALIAS, FONT_EDGING_SUBPIXEL_ANTI_ALIAS } | Enumerates the font edging types.|
215| [OH_Drawing_FontHinting](#oh_drawing_fonthinting-1) { FONT_HINTING_NONE, FONT_HINTING_SLIGHT, FONT_HINTING_NORMAL, FONT_HINTING_FULL } | Enumerates the font hinting types.|
216| [OH_Drawing_BlurType](#oh_drawing_blurtype-1) { NORMAL, SOLID, OUTER, INNER } | Enumerates the blur types.|
217| [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit-1) { SCALE_TO_FIT_FILL, SCALE_TO_FIT_START, SCALE_TO_FIT_CENTER, SCALE_TO_FIT_END } | Enumerates the matrix scaling modes.|
218| [OH_Drawing_PathDirection](#oh_drawing_pathdirection-1) { PATH_DIRECTION_CW, PATH_DIRECTION_CCW } | Enumerates the directions of a closed contour.|
219| [OH_Drawing_PathFillType](#oh_drawing_pathfilltype-1) { PATH_FILL_TYPE_WINDING, PATH_FILL_TYPE_EVEN_ODD, PATH_FILL_TYPE_INVERSE_WINDING, PATH_FILL_TYPE_INVERSE_EVEN_ODD } | Enumerates the fill types of a path.|
220| [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode-1) { PATH_ADD_MODE_APPEND, PATH_ADD_MODE_EXTEND } | Enumerates the path adding modes.|
221| [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle-1) { LINE_FLAT_CAP, LINE_SQUARE_CAP, LINE_ROUND_CAP } | Enumerates the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.|
222| [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle-1) { LINE_MITER_JOIN, LINE_ROUND_JOIN, LINE_BEVEL_JOIN } | Enumerates the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.|
223| [OH_Drawing_CornerPos](#oh_drawing_cornerpos-1) { CORNER_POS_TOP_LEFT, CORNER_POS_TOP_RIGHT, CORNER_POS_BOTTOM_RIGHT, CORNER_POS_BOTTOM_LEFT } | Enumerates the corner positions of a rounded rectangle.|
224| [OH_Drawing_FilterMode](#oh_drawing_filtermode-1) { FILTER_MODE_NEAREST, FILTER_MODE_LINEAR } | Enumerates the filter modes.|
225| [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode-1) { MIPMAP_MODE_NONE, MIPMAP_MODE_NEAREST, MIPMAP_MODE_LINEAR } | Enumerates the mipmap modes.|
226| [OH_Drawing_TileMode](#oh_drawing_tilemode-1) { CLAMP, REPEAT, MIRROR, DECAL } | Enumerates the tile modes of the shader effect.|
227| [OH_Drawing_TextDirection](#oh_drawing_textdirection) { TEXT_DIRECTION_RTL, TEXT_DIRECTION_LTR } | Enumerates the text directions.|
228| [OH_Drawing_TextAlign](#oh_drawing_textalign) {<br>TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_JUSTIFY,<br>TEXT_ALIGN_START, TEXT_ALIGN_END<br>} | Enumerates the text alignment modes.|
229| [OH_Drawing_FontWeight](#oh_drawing_fontweight) {<br>FONT_WEIGHT_100, FONT_WEIGHT_200, FONT_WEIGHT_300, FONT_WEIGHT_400,<br>FONT_WEIGHT_500, FONT_WEIGHT_600, FONT_WEIGHT_700, FONT_WEIGHT_800,<br>FONT_WEIGHT_900<br>} | Enumerates the font weights.|
230| [OH_Drawing_TextBaseline](#oh_drawing_textbaseline) { TEXT_BASELINE_ALPHABETIC, TEXT_BASELINE_IDEOGRAPHIC } | Enumerates the text baselines.|
231| [OH_Drawing_TextDecoration](#oh_drawing_textdecoration) { TEXT_DECORATION_NONE = 0x0, TEXT_DECORATION_UNDERLINE = 0x1, TEXT_DECORATION_OVERLINE = 0x2, TEXT_DECORATION_LINE_THROUGH = 0x4 } | Enumerates the text decorations.|
232| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) { FONT_STYLE_NORMAL, FONT_STYLE_ITALIC, FONT_STYLE_OBLIQUE } | Enumerates the font styles.|
233| [OH_Drawing_PlaceholderVerticalAlignment](#oh_drawing_placeholderverticalalignment-1) {<br>ALIGNMENT_OFFSET_AT_BASELINE, ALIGNMENT_ABOVE_BASELINE, ALIGNMENT_BELOW_BASELINE, ALIGNMENT_TOP_OF_ROW_BOX,<br>ALIGNMENT_BOTTOM_OF_ROW_BOX, ALIGNMENT_CENTER_OF_ROW_BOX<br>} | Enumerates the vertical alignment modes of placeholders.|
234| [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle-1) {<br>TEXT_DECORATION_STYLE_SOLID, TEXT_DECORATION_STYLE_DOUBLE, TEXT_DECORATION_STYLE_DOTTED, TEXT_DECORATION_STYLE_DASHED,<br>TEXT_DECORATION_STYLE_WAVY<br>} | Enumerates the text decoration styles.|
235| [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal-1) { ELLIPSIS_MODAL_HEAD = 0, ELLIPSIS_MODAL_MIDDLE = 1, ELLIPSIS_MODAL_TAIL = 2 } | Enumerates the ellipsis styles.|
236| [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy-1) { BREAK_STRATEGY_GREEDY = 0, BREAK_STRATEGY_HIGH_QUALITY = 1, BREAK_STRATEGY_BALANCED = 2 } | Enumerates the text break strategies.|
237| [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype-1) { WORD_BREAK_TYPE_NORMAL = 0, WORD_BREAK_TYPE_BREAK_ALL = 1, WORD_BREAK_TYPE_BREAK_WORD = 2, WORD_BREAK_TYPE_BREAK_HYPHEN = 3 } | Enumerates the word break types.|
238| [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle-1) {<br>RECT_HEIGHT_STYLE_TIGHT, RECT_HEIGHT_STYLE_MAX, RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE, RECT_HEIGHT_STYLE_INCLUDELINESPACETOP,<br>RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM, RECT_HEIGHT_STYLE_STRUCT<br>} | Enumerates the rectangle height styles.|
239| [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle-1) { RECT_WIDTH_STYLE_TIGHT, RECT_WIDTH_STYLE_MAX } | Enumerates the rectangle width styles.|
240| [OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode) {<br>SUCCESS_FONT_CONFIG_INFO = 0, ERROR_FONT_CONFIG_INFO_UNKNOWN = 1, ERROR_FONT_CONFIG_INFO_PARSE_FILE = 2, ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY = 3,<br>ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA = 4<br>} | Enumerates the error codes that may be used during the obtaining of system font configurations.|
241| [OH_Drawing_FontWidth](#oh_drawing_fontwidth) {<br>ULTRA_CONDENSED_WIDTH = 1, EXTRA_CONDENSED_WIDTH = 2, CONDENSED_WIDTH = 3, SEMI_CONDENSED_WIDTH = 4,<br>NORMAL_WIDTH = 5, SEMI_EXPANDED_WIDTH = 6, EXPANDED_WIDTH = 7, EXTRA_EXPANDED_WIDTH = 8,<br>ULTRA_EXPANDED_WIDTH = 9<br>} | Enumerates the font widths.|
242| [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) { TEXT_HEIGHT_ALL = 0x0, TEXT_HEIGHT_DISABLE_FIRST_ASCENT = 0x1, TEXT_HEIGHT_DISABLE_LAST_ASCENT = 0x2, TEXT_HEIGHT_DISABLE_ALL = 0x1 \| 0x2 } | Enumerates the text height modifier patterns.|
243| [OH_Drawing_TextStyleType](#oh_drawing_textstyletype) {<br>TEXT_STYLE_NONE, TEXT_STYLE_ALL_ATTRIBUTES, TEXT_STYLE_FONT, TEXT_STYLE_FOREGROUND,<br>TEXT_STYLE_BACKGROUND, TEXT_STYLE_SHADOW, TEXT_STYLE_DECORATIONS, TEXT_STYLE_LETTER_SPACING,<br>TEXT_STYLE_WORD_SPACING<br>} | Enumerates the text style types.|
244| [OH_Drawing_ColorFormat](#oh_drawing_colorformat-1) {<br>COLOR_FORMAT_UNKNOWN, COLOR_FORMAT_ALPHA_8, COLOR_FORMAT_RGB_565, COLOR_FORMAT_ARGB_4444,<br>COLOR_FORMAT_RGBA_8888, COLOR_FORMAT_BGRA_8888<br>} | Enumerates the storage formats of bitmap pixels.|
245| [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat-1) { ALPHA_FORMAT_UNKNOWN, ALPHA_FORMAT_OPAQUE, ALPHA_FORMAT_PREMUL, ALPHA_FORMAT_UNPREMUL } | Enumerates the alpha formats of bitmap pixels.|
246| [OH_Drawing_BlendMode](#oh_drawing_blendmode-1) {<br>BLEND_MODE_CLEAR, BLEND_MODE_SRC, BLEND_MODE_DST, BLEND_MODE_SRC_OVER,<br>BLEND_MODE_DST_OVER, BLEND_MODE_SRC_IN, BLEND_MODE_DST_IN, BLEND_MODE_SRC_OUT,<br>BLEND_MODE_DST_OUT, BLEND_MODE_SRC_ATOP, BLEND_MODE_DST_ATOP, BLEND_MODE_XOR,<br>BLEND_MODE_PLUS, BLEND_MODE_MODULATE, BLEND_MODE_SCREEN, BLEND_MODE_OVERLAY,<br>BLEND_MODE_DARKEN, BLEND_MODE_LIGHTEN, BLEND_MODE_COLOR_DODGE, BLEND_MODE_COLOR_BURN,<br>BLEND_MODE_HARD_LIGHT, BLEND_MODE_SOFT_LIGHT, BLEND_MODE_DIFFERENCE, BLEND_MODE_EXCLUSION,<br>BLEND_MODE_MULTIPLY, BLEND_MODE_HUE, BLEND_MODE_SATURATION, BLEND_MODE_COLOR,<br>BLEND_MODE_LUMINOSITY<br>} | Enumerates the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule).|
247| [OH_Drawing_TextEncoding](#oh_drawing_textencoding-1) { TEXT_ENCODING_UTF8, TEXT_ENCODING_UTF16, TEXT_ENCODING_UTF32, TEXT_ENCODING_GLYPH_ID } | Enumerates the text encoding types.|
248| [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags-1) { SHADOW_FLAGS_NONE, SHADOW_FLAGS_TRANSPARENT_OCCLUDER, SHADOW_FLAGS_GEOMETRIC_ONLY, SHADOW_FLAGS_ALL } | Enumerates the shadow flags.|
249
250### Functions
251
252| Name| Description|
253| -------- | -------- |
254| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PathGetSegment](#oh_drawing_pathgetsegment) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed, float start, float stop, bool startWithMoveTo, [OH_Drawing_Path](#oh_drawing_path) \*dst, bool \*result) | Extracts a segment of a path and appends it to a destination path. |
255| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateSumPathEffect](#oh_drawing_createsumpatheffect) ([OH_Drawing_PathEffect](#oh_drawing_patheffect) \*firstPathEffect, [OH_Drawing_PathEffect](#oh_drawing_patheffect) \*secondPathEffect) | Creates an overlay path effect based on two distinct path effects that take effect separately. |
256| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreatePathDashEffect](#oh_drawing_createpathdasheffect) (const [OH_Drawing_Path](#oh_drawing_path) \*path, float advance, float phase, [OH_Drawing_PathDashStyle](#oh_drawing_pathdashstyle) type) | Creates a dashed path effect. |
257| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateDiscretePathEffect](#oh_drawing_creatediscretepatheffect) (float segLength, float deviation) | Creates a path effect that segments the path and scatters the segments in an irregular pattern along the path. |
258| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateCornerPathEffect](#oh_drawing_createcornerpatheffect) (float radius) | Creates a path effect that transforms the sharp angle between line segments into a rounded corner with the specified radius. |
259| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateComposePathEffect](#oh_drawing_createcomposepatheffect) ([OH_Drawing_PathEffect](#oh_drawing_patheffect) \*outer, [OH_Drawing_PathEffect](#oh_drawing_patheffect) \*inner) | Creates a path effect by sequentially applying the inner effect and then the outer effect. |
260| [OH_Drawing_GpuContext](#oh_drawing_gpucontext) \* [OH_Drawing_GpuContextCreate](#oh_drawing_gpucontextcreate) (void) | Creates an **OH_Drawing_GpuContext** object, for which the backend type depends on the device. |
261| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawArcWithCenter](#oh_drawing_canvasdrawarcwithcenter) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Rect](#oh_drawing_rect) \*rect, float startAngle, float sweepAngle, bool useCenter) | Draws an arc. It enables you to define the starting angle, sweep angle, and whether the arc's endpoints should connect to its center. |
262| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawNestedRoundRect](#oh_drawing_canvasdrawnestedroundrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*outer, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*inner) | Draws two nested rounded rectangles. The outer rectangle boundary must contain the inner rectangle boundary. Otherwise, there is no drawing effect.|
263| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasQuickRejectPath](#oh_drawing_canvasquickrejectpath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Path](#oh_drawing_path) \*path, bool \*quickReject) | Checks whether the path is not intersecting with the canvas area. The canvas area includes its boundaries. |
264| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasQuickRejectRect](#oh_drawing_canvasquickrejectrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Rect](#oh_drawing_rect) \*rect, bool \*quickReject) | Checks whether the rectangle is not intersecting with the canvas area. The canvas area includes its boundaries. |
265| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawPixelMapNine](#oh_drawing_canvasdrawpixelmapnine) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \*pixelMap, const [OH_Drawing_Rect](#oh_drawing_rect) \*center, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, [OH_Drawing_FilterMode](#oh_drawing_filtermode) mode) | Splits a PixelMap into nine sections using two horizontal and two vertical lines: four edge sections, four corner sections, and a central section. If the four corner sections are smaller than the target rectangle, they will be drawn in the target rectangle without scaling. Otherwise, they will be scaled to fit the target rectangle. Any remaining space will be filled by stretching or compressing the other five sections to cover the entire target rectangle. |
266| [OH_Drawing_Surface](#oh_drawing_surface) \* [OH_Drawing_SurfaceCreateOnScreen](#oh_drawing_surfacecreateonscreen) ([OH_Drawing_GpuContext](#oh_drawing_gpucontext) \*gpuContext, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) imageInfo, void \*window) | Creates an **OH_Drawing_Surface** object bound to the window using the GPU context to manage the content drawn on the canvas. |
267| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_SurfaceFlush](#oh_drawing_surfaceflush) ([OH_Drawing_Surface](#oh_drawing_surface) \*surface) | Pushes the drawing content from an **OH_Drawing_Surface** object to the GPU for rendering. |
268| void [OH_Drawing_ErrorCodeReset](#oh_drawing_errorcodereset) (void) | Resets the error code of this module to **OH_DRAWING_SUCCESS**.<br>When a function that does not return an error code fails, the error code obtained through [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget) is reset to the corresponding error number. However, it is not reset to **OH_DRAWING_SUCCESS** for a successful operation.<br>By calling this function, you can manually reset the error code to **OH_DRAWING_SUCCESS**, avoiding interference between different functions and simplifying the debugging process.|
269| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontSetThemeFontFollowed](#oh_drawing_fontsetthemefontfollowed) ([OH_Drawing_Font](#oh_drawing_font) \*font, bool followed) | Sets whether to follow the theme font. When **followed** is set to **true**, the theme font is used if it is enabled by the system and no typeface is set.|
270| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontIsThemeFontFollowed](#oh_drawing_fontisthemefontfollowed) (const [OH_Drawing_Font](#oh_drawing_font) \*font, bool \*followed) | Checks whether the font follows the theme font. By default, the theme font is not followed.|
271| OH_Drawing_FontCollection \* [OH_Drawing_GetFontCollectionGlobalInstance](#oh_drawing_getfontcollectionglobalinstance) (void) | Obtains the global **OH_Drawing_FontCollection** object, which can be used to sense the theme font information. Do not release the object. |
272| [OH_Drawing_Bitmap](#oh_drawing_bitmap) \* [OH_Drawing_BitmapCreate](#oh_drawing_bitmapcreate) (void) | Creates an **OH_Drawing_Bitmap** object.|
273| void [OH_Drawing_BitmapDestroy](#oh_drawing_bitmapdestroy) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Destroys an **OH_Drawing_Bitmap** object and reclaims the memory occupied by the object.|
274| [OH_Drawing_Bitmap](#oh_drawing_bitmap) \* [OH_Drawing_BitmapCreateFromPixels](#oh_drawing_bitmapcreatefrompixels) ([OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*, void \*pixels, uint32_t rowBytes) | Creates an **OH_Drawing_Bitmap** object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for.|
275| void [OH_Drawing_BitmapBuild](#oh_drawing_bitmapbuild) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const uint32_t width, const uint32_t height, const [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) \*) | Initializes the width and height of a bitmap and sets the pixel format for the bitmap.|
276| uint32_t [OH_Drawing_BitmapGetWidth](#oh_drawing_bitmapgetwidth) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the width of a bitmap.|
277| uint32_t [OH_Drawing_BitmapGetHeight](#oh_drawing_bitmapgetheight) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the height of a bitmap.|
278| [OH_Drawing_ColorFormat](#oh_drawing_colorformat) [OH_Drawing_BitmapGetColorFormat](#oh_drawing_bitmapgetcolorformat) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the pixel format of a bitmap.|
279| [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat) [OH_Drawing_BitmapGetAlphaFormat](#oh_drawing_bitmapgetalphaformat) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the alpha component of a bitmap.|
280| void \* [OH_Drawing_BitmapGetPixels](#oh_drawing_bitmapgetpixels) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.|
281| void [OH_Drawing_BitmapGetImageInfo](#oh_drawing_bitmapgetimageinfo) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*) | Obtains the image information of a bitmap.|
282| bool [OH_Drawing_BitmapReadPixels](#oh_drawing_bitmapreadpixels) ([OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*dstInfo, void \*dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY) | Reads pixels of a rectangle in a bitmap to the specified buffer.|
283| [OH_Drawing_Brush](#oh_drawing_brush) \* [OH_Drawing_BrushCreate](#oh_drawing_brushcreate) (void) | Creates an **OH_Drawing_Brush** object.|
284| [OH_Drawing_Brush](#oh_drawing_brush) \* [OH_Drawing_BrushCopy](#oh_drawing_brushcopy) ([OH_Drawing_Brush](#oh_drawing_brush) \*brush) | Copies an existing [OH_Drawing_Brush](#oh_drawing_brush) object to create a new one.|
285| void [OH_Drawing_BrushDestroy](#oh_drawing_brushdestroy) ([OH_Drawing_Brush](#oh_drawing_brush) \*) | Destroys an **OH_Drawing_Brush** object and reclaims the memory occupied by the object.|
286| bool [OH_Drawing_BrushIsAntiAlias](#oh_drawing_brushisantialias) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.|
287| void [OH_Drawing_BrushSetAntiAlias](#oh_drawing_brushsetantialias) ([OH_Drawing_Brush](#oh_drawing_brush) \*, bool) | Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.|
288| uint32_t [OH_Drawing_BrushGetColor](#oh_drawing_brushgetcolor) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the color of a brush. The color is used by the brush to fill in a shape.|
289| void [OH_Drawing_BrushSetColor](#oh_drawing_brushsetcolor) ([OH_Drawing_Brush](#oh_drawing_brush) \*, uint32_t color) | Sets the color for a brush. The color is used by the brush to fill in a shape.|
290| uint8_t [OH_Drawing_BrushGetAlpha](#oh_drawing_brushgetalpha) (const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape.|
291| void [OH_Drawing_BrushSetAlpha](#oh_drawing_brushsetalpha) ([OH_Drawing_Brush](#oh_drawing_brush) \*, uint8_t alpha) | Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape.|
292| void [OH_Drawing_BrushSetShaderEffect](#oh_drawing_brushsetshadereffect) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Sets the shader effect for a brush.|
293| void [OH_Drawing_BrushSetShadowLayer](#oh_drawing_brushsetshadowlayer) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn.|
294| void [OH_Drawing_BrushSetFilter](#oh_drawing_brushsetfilter) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Sets a filter for a brush. The filter is a container that holds a mask filter and color filter.|
295| void [OH_Drawing_BrushGetFilter](#oh_drawing_brushgetfilter) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Obtains the filter of a brush. The filter is a container that holds a mask filter and color filter.|
296| void [OH_Drawing_BrushSetBlendMode](#oh_drawing_brushsetblendmode) ([OH_Drawing_Brush](#oh_drawing_brush) \*, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Sets a blender for a brush. The blender implements the specified blend mode.|
297| void [OH_Drawing_BrushReset](#oh_drawing_brushreset) ([OH_Drawing_Brush](#oh_drawing_brush) \*) | Resets a brush to the initial state. All configured attributes are cleared.|
298| [OH_Drawing_Canvas](#oh_drawing_canvas) \* [OH_Drawing_CanvasCreate](#oh_drawing_canvascreate) (void) | Creates an **OH_Drawing_Canvas** object.|
299| void [OH_Drawing_CanvasDestroy](#oh_drawing_canvasdestroy) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object.|
300| void [OH_Drawing_CanvasBind](#oh_drawing_canvasbind) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is called CPU rendering.)|
301| void [OH_Drawing_CanvasAttachPen](#oh_drawing_canvasattachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If the pen effect changes after this function is called, you must call the function again to use the new effect in the subsequent drawing.|
302| void [OH_Drawing_CanvasDetachPen](#oh_drawing_canvasdetachpen) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline a shape.|
303| void [OH_Drawing_CanvasAttachBrush](#oh_drawing_canvasattachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape. If the brush effect changes after this function is called, you must call the function again to use the new effect in the subsequent drawing.|
304| void [OH_Drawing_CanvasDetachBrush](#oh_drawing_canvasdetachbrush) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a shape.|
305| void [OH_Drawing_CanvasSave](#oh_drawing_canvassave) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Saves the current canvas status (canvas matrix) to the top of the stack. This function must be used in pair with [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore).|
306| void [OH_Drawing_CanvasSaveLayer](#oh_drawing_canvassavelayer) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore), the changes made to the matrix and clipping region are discarded, and the bitmap is drawn.|
307| void [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Restores the canvas status (canvas matrix) saved on the top of the stack.|
308| uint32_t [OH_Drawing_CanvasGetSaveCount](#oh_drawing_canvasgetsavecount) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the number of canvas statuses (canvas matrices) saved in the stack.|
309| void [OH_Drawing_CanvasRestoreToCount](#oh_drawing_canvasrestoretocount) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, uint32_t saveCount) | Restores to a given number of canvas statuses (canvas matrices).|
310| void [OH_Drawing_CanvasDrawLine](#oh_drawing_canvasdrawline) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float x1, float y1, float x2, float y2) | Draws a line segment.|
311| void [OH_Drawing_CanvasDrawPath](#oh_drawing_canvasdrawpath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Path](#oh_drawing_path) \*) | Draws a path.|
312| void [OH_Drawing_CanvasDrawPixelMapRect](#oh_drawing_canvasdrawpixelmaprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws a portion of a pixel map onto a specified area of the canvas.|
313| void [OH_Drawing_CanvasDrawBackground](#oh_drawing_canvasdrawbackground) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Brush](#oh_drawing_brush) \*) | Draws a background filled with a brush.|
314| void [OH_Drawing_CanvasDrawRegion](#oh_drawing_canvasdrawregion) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Region](#oh_drawing_region) \*) | Draws a region.|
315| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawPoint](#oh_drawing_canvasdrawpoint) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*point) | Draws a point.|
316| void [OH_Drawing_CanvasDrawPoints](#oh_drawing_canvasdrawpoints) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_PointMode](#oh_drawing_pointmode) mode, uint32_t count, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*) | Draws multiple points. You can draw a single point, a line segment, or an open polygon.|
317| void [OH_Drawing_CanvasDrawBitmap](#oh_drawing_canvasdrawbitmap) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, float left, float top) | Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, includes single points called pixels (image elements).|
318| void [OH_Drawing_CanvasDrawBitmapRect](#oh_drawing_canvasdrawbitmaprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws a portion of a bitmap onto a specified area of the canvas.|
319| void [OH_Drawing_CanvasSetMatrix](#oh_drawing_canvassetmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Sets the matrix status for a canvas.|
320| void [OH_Drawing_CanvasResetMatrix](#oh_drawing_canvasresetmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Resets the matrix of a canvas to an identity matrix.|
321| void [OH_Drawing_CanvasDrawImageRectWithSrc](#oh_drawing_canvasdrawimagerectwithsrc) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Image](#oh_drawing_image) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*, [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint)) | Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is scaled and translated to the destination rectangle.|
322| void [OH_Drawing_CanvasDrawImageRect](#oh_drawing_canvasdrawimagerect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*dst, [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Draws an image onto a specified area of the canvas.|
323| void [OH_Drawing_CanvasDrawVertices](#oh_drawing_canvasdrawvertices) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_VertexMode](#oh_drawing_vertexmode) vertexMmode, int32_t vertexCount, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*positions, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*texs, const uint32_t \*colors, int32_t indexCount, const uint16_t \*indices, [OH_Drawing_BlendMode](#oh_drawing_blendmode) mode) | Draws a triangular grid described by a vertex array.|
324| bool [OH_Drawing_CanvasReadPixels](#oh_drawing_canvasreadpixels) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*, void \*dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY) | Copies pixel data from a canvas to a specified address. This function cannot be used for recorded canvases.|
325| bool [OH_Drawing_CanvasReadPixelsToBitmap](#oh_drawing_canvasreadpixelstobitmap) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*, int32_t srcX, int32_t srcY) | Copies pixel data from a canvas to an image. This function cannot be used for recorded canvases.|
326| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasIsClipEmpty](#oh_drawing_canvasisclipempty) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, bool \*isClipEmpty) | Checks whether the region that can be drawn is empty after cropping.|
327| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasGetImageInfo](#oh_drawing_canvasgetimageinfo) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*imageInfo) | Obtains the image information of a canvas.|
328| void [OH_Drawing_CanvasDrawRect](#oh_drawing_canvasdrawrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Draws a rectangle.|
329| void [OH_Drawing_CanvasDrawCircle](#oh_drawing_canvasdrawcircle) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Point](#oh_drawing_point) \*, float radius) | Draws a circle.|
330| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawColor](#oh_drawing_canvasdrawcolor) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, uint32_t color, [OH_Drawing_BlendMode](#oh_drawing_blendmode) blendMode) | Fills the entire canvas with the specified color and blend mode.|
331| void [OH_Drawing_CanvasDrawOval](#oh_drawing_canvasdrawoval) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Draws an oval.|
332| void [OH_Drawing_CanvasDrawArc](#oh_drawing_canvasdrawarc) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, float startAngle, float sweepAngle) | Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn.|
333| void [OH_Drawing_CanvasDrawRoundRect](#oh_drawing_canvasdrawroundrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*) | Draws a rounded rectangle.|
334| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawSingleCharacter](#oh_drawing_canvasdrawsinglecharacter) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const char \*str, const [OH_Drawing_Font](#oh_drawing_font) \*font, float x, float y) | Draws a single character. If the typeface of the current font does not support the character to draw, the system typeface is used to draw the character.|
335| void [OH_Drawing_CanvasDrawTextBlob](#oh_drawing_canvasdrawtextblob) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_TextBlob](#oh_drawing_textblob) \*, float x, float y) | Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, that character will not be drawn.|
336| uint32_t [OH_Drawing_ColorSetArgb](#oh_drawing_colorsetargb) (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue) | Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color.|
337| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateBlendMode](#oh_drawing_colorfiltercreateblendmode) (uint32_t color, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Creates an **OH_Drawing_ColorFilter** object with a given blend mode.|
338| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateCompose](#oh_drawing_colorfiltercreatecompose) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter1, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter2) | Creates an **OH_Drawing_ColorFilter** object by combining another two color filters.|
339| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateMatrix](#oh_drawing_colorfiltercreatematrix) (const float matrix[20]) | Creates an **OH_Drawing_ColorFilter** object with a given 5x4 color matrix.|
340| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateLinearToSrgbGamma](#oh_drawing_colorfiltercreatelineartosrgbgamma) (void) | Creates an **OH_Drawing_ColorFilter** object that applies the sRGB gamma curve to the RGB channels.|
341| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateSrgbGammaToLinear](#oh_drawing_colorfiltercreatesrgbgammatolinear) (void) | Creates an **OH_Drawing_ColorFilter** object that applies the RGB channels to the sRGB gamma curve.|
342| [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \* [OH_Drawing_ColorFilterCreateLuma](#oh_drawing_colorfiltercreateluma) (void) | Creates an **OH_Drawing_ColorFilter** object that multiplies the passed-in luma into the alpha channel and sets the RGB channels to zero.|
343| void [OH_Drawing_ColorFilterDestroy](#oh_drawing_colorfilterdestroy) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Destroys an **OH_Drawing_ColorFilter** object and reclaims the memory occupied by the object.|
344| [OH_Drawing_ColorSpace](#oh_drawing_colorspace) \* [OH_Drawing_ColorSpaceCreateSrgb](#oh_drawing_colorspacecreatesrgb) (void) | Creates an sRGB color space.|
345| [OH_Drawing_ColorSpace](#oh_drawing_colorspace) \* [OH_Drawing_ColorSpaceCreateSrgbLinear](#oh_drawing_colorspacecreatesrgblinear) (void) | Creates an sRGB linear (Gamma 1.0) color space.|
346| void [OH_Drawing_ColorSpaceDestroy](#oh_drawing_colorspacedestroy) ([OH_Drawing_ColorSpace](#oh_drawing_colorspace) \*) | Destroys an **OH_Drawing_ColorSpace** object and reclaims the memory occupied by the object.|
347| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget) () | Obtains the error code of the module.|
348| [OH_Drawing_Filter](#oh_drawing_filter) \* [OH_Drawing_FilterCreate](#oh_drawing_filtercreate) (void) | Creates an **OH_Drawing_Filter** object.|
349| void [OH_Drawing_FilterSetImageFilter](#oh_drawing_filtersetimagefilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*) | Sets an **OH_Drawing_ImageFilter** object for an **OH_Drawing_Filter** object.|
350| void [OH_Drawing_FilterSetMaskFilter](#oh_drawing_filtersetmaskfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \*) | Sets an **OH_Drawing_MaskFilter** object for an **OH_Drawing_Filter** object.|
351| void [OH_Drawing_FilterSetColorFilter](#oh_drawing_filtersetcolorfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Sets an **OH_Drawing_ColorFilter** object for an **OH_Drawing_Filter** object.|
352| void [OH_Drawing_FilterGetColorFilter](#oh_drawing_filtergetcolorfilter) ([OH_Drawing_Filter](#oh_drawing_filter) \*, [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*) | Obtains an **OH_Drawing_ColorFilter** object from an **OH_Drawing_Filter** object.|
353| void [OH_Drawing_FilterDestroy](#oh_drawing_filterdestroy) ([OH_Drawing_Filter](#oh_drawing_filter) \*) | Destroys an **OH_Drawing_Filter** object and reclaims the memory occupied by the object.|
354| void [OH_Drawing_FontSetBaselineSnap](#oh_drawing_fontsetbaselinesnap) ([OH_Drawing_Font](#oh_drawing_font) \*, bool baselineSnap) | Sets whether to request that baselines be snapped to pixels when the current canvas matrix is axis aligned.|
355| bool [OH_Drawing_FontIsBaselineSnap](#oh_drawing_fontisbaselinesnap) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether baselines are requested to be snapped to pixels when the current canvas matrix is axis aligned.|
356| void [OH_Drawing_FontSetEdging](#oh_drawing_fontsetedging) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_FontEdging](#oh_drawing_fontedging)) | Sets a font edging effect.|
357| [OH_Drawing_FontEdging](#oh_drawing_fontedging) [OH_Drawing_FontGetEdging](#oh_drawing_fontgetedging) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the font edging effect.|
358| void [OH_Drawing_FontSetForceAutoHinting](#oh_drawing_fontsetforceautohinting) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isForceAutoHinting) | Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs.|
359| bool [OH_Drawing_FontIsForceAutoHinting](#oh_drawing_fontisforceautohinting) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether auto hinting is forcibly used.|
360| void [OH_Drawing_FontSetSubpixel](#oh_drawing_fontsetsubpixel) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isSubpixel) | Sets whether to use sub-pixel rendering for a font.|
361| bool [OH_Drawing_FontIsSubpixel](#oh_drawing_fontissubpixel) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether sub-pixel rendering is used for a font.|
362| [OH_Drawing_Font](#oh_drawing_font) \* [OH_Drawing_FontCreate](#oh_drawing_fontcreate) (void) | Creates an **OH_Drawing_Font** object.|
363| void [OH_Drawing_FontSetTypeface](#oh_drawing_fontsettypeface) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_Typeface](#oh_drawing_typeface) \*) | Sets a typeface for a font.|
364| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontGetTypeface](#oh_drawing_fontgettypeface) ([OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the typeface of a font.|
365| void [OH_Drawing_FontSetTextSize](#oh_drawing_fontsettextsize) ([OH_Drawing_Font](#oh_drawing_font) \*, float textSize) | Sets the text size for a font.|
366| float [OH_Drawing_FontGetTextSize](#oh_drawing_fontgettextsize) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the text size.|
367| int [OH_Drawing_FontCountText](#oh_drawing_fontcounttext) ([OH_Drawing_Font](#oh_drawing_font) \*, const void \*text, size_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding) | Obtains the number of glyphs represented by text.|
368| uint32_t [OH_Drawing_FontTextToGlyphs](#oh_drawing_fonttexttoglyphs) (const [OH_Drawing_Font](#oh_drawing_font) \*, const void \*text, uint32_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding, uint16_t \*glyphs, int maxGlyphCount) | Converts text into glyph indices.|
369| void [OH_Drawing_FontGetWidths](#oh_drawing_fontgetwidths) (const [OH_Drawing_Font](#oh_drawing_font) \*, const uint16_t \*glyphs, int count, float \*widths) | Obtains the width of each glyph in a string of text.|
370| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontMeasureSingleCharacter](#oh_drawing_fontmeasuresinglecharacter) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const char \*str, float \*textWidth) | Measures the width of a single character. If the typeface of the current font does not support the character to measure, the system typeface is used to measure the character width.|
371| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontMeasureText](#oh_drawing_fontmeasuretext) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const void \*text, size_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding, [OH_Drawing_Rect](#oh_drawing_rect) \*bounds, float \*textWidth) | Obtains the text width and bounding box.|
372| void [OH_Drawing_FontSetLinearText](#oh_drawing_fontsetlineartext) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isLinearText) | Sets linear scaling for a font.|
373| bool [OH_Drawing_FontIsLinearText](#oh_drawing_fontislineartext) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether linear scaling is used for a font.|
374| void [OH_Drawing_FontSetTextSkewX](#oh_drawing_fontsettextskewx) ([OH_Drawing_Font](#oh_drawing_font) \*, float skewX) | Sets a horizontal skew factor for a font.|
375| float [OH_Drawing_FontGetTextSkewX](#oh_drawing_fontgettextskewx) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the horizontal skew factor of a font.|
376| void [OH_Drawing_FontSetFakeBoldText](#oh_drawing_fontsetfakeboldtext) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isFakeBoldText) | Sets fake bold for a font by increasing the stroke width.|
377| bool [OH_Drawing_FontIsFakeBoldText](#oh_drawing_fontisfakeboldtext) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether fake bold is used for a font.|
378| void [OH_Drawing_FontSetScaleX](#oh_drawing_fontsetscalex) ([OH_Drawing_Font](#oh_drawing_font) \*, float scaleX) | Sets a horizontal scale factor for a font.|
379| float [OH_Drawing_FontGetScaleX](#oh_drawing_fontgetscalex) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the horizontal scale factor of a font.|
380| void [OH_Drawing_FontSetHinting](#oh_drawing_fontsethinting) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_FontHinting](#oh_drawing_fonthinting)) | Sets a font hinting effect.|
381| [OH_Drawing_FontHinting](#oh_drawing_fonthinting) [OH_Drawing_FontGetHinting](#oh_drawing_fontgethinting) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Obtains the font hinting effect.|
382| void [OH_Drawing_FontSetEmbeddedBitmaps](#oh_drawing_fontsetembeddedbitmaps) ([OH_Drawing_Font](#oh_drawing_font) \*, bool isEmbeddedBitmaps) | Sets whether to use bitmaps in a font.|
383| bool [OH_Drawing_FontIsEmbeddedBitmaps](#oh_drawing_fontisembeddedbitmaps) (const [OH_Drawing_Font](#oh_drawing_font) \*) | Checks whether bitmaps are used in a font.|
384| void [OH_Drawing_FontDestroy](#oh_drawing_fontdestroy) ([OH_Drawing_Font](#oh_drawing_font) \*) | Destroys an **OH_Drawing_Font** object and reclaims the memory occupied by the object.|
385| float [OH_Drawing_FontGetMetrics](#oh_drawing_fontgetmetrics) ([OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Obtains the measurement information about a font.|
386| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontGetBounds](#oh_drawing_fontgetbounds) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const uint16_t \*glyphs, uint32_t count, [OH_Drawing_Array](#oh_drawing_array) \*bounds) | Obtains the rectangular bounding box for each glyph in the glyph array.|
387| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontGetPathForGlyph](#oh_drawing_fontgetpathforglyph) (const [OH_Drawing_Font](#oh_drawing_font) \*font, uint16_t glyph, [OH_Drawing_Path](#oh_drawing_path) \*path) | Obtains the path of a glyph.|
388| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontGetTextPath](#oh_drawing_fontgettextpath) (const [OH_Drawing_Font](#oh_drawing_font) \*font, const void \*text, size_t byteLength, [OH_Drawing_TextEncoding](#oh_drawing_textencoding) encoding, float x, float y, [OH_Drawing_Path](#oh_drawing_path) \*path) | Obtains the text outline path.|
389| [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \* [OH_Drawing_CreateFontCollection](#oh_drawing_createfontcollection) (void) | Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object.|
390| void [OH_Drawing_DestroyFontCollection](#oh_drawing_destroyfontcollection) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Destroys an **OH_Drawing_FontCollection** object and reclaims the memory occupied by the object.|
391| void [OH_Drawing_DisableFontCollectionFallback](#oh_drawing_disablefontcollectionfallback) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*fontCollection) | Disables the system fonts.|
392| void [OH_Drawing_DisableFontCollectionSystemFont](#oh_drawing_disablefontcollectionsystemfont) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*fontCollection) | Disables the system fonts.|
393| [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \* [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) (void) | Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object that is shareable.|
394| void [OH_Drawing_ClearFontCaches](#oh_drawing_clearfontcaches) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Clears the font cache. (The font cache has a memory limit and a clearing mechanism. It occupies limited memory. You are not advised to clear it unless otherwise required.)|
395| [OH_Drawing_FontMgr](#oh_drawing_fontmgr) \* [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate) (void) | Creates an **OH_Drawing_FontMgr** object, which can be used only to manage system fonts.|
396| void [OH_Drawing_FontMgrDestroy](#oh_drawing_fontmgrdestroy) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*) | Destroys an **OH_Drawing_FontMgr** object and reclaims the memory occupied by the object.|
397| int [OH_Drawing_FontMgrGetFamilyCount](#oh_drawing_fontmgrgetfamilycount) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*) | Obtains the number of font families.|
398| char \* [OH_Drawing_FontMgrGetFamilyName](#oh_drawing_fontmgrgetfamilyname) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, int index) | Obtains the font family name based on an index.|
399| void [OH_Drawing_FontMgrDestroyFamilyName](#oh_drawing_fontmgrdestroyfamilyname) (char \*familyName) | Reclaims the memory occupied by a font family name.|
400| [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \* [OH_Drawing_FontMgrCreateFontStyleSet](#oh_drawing_fontmgrcreatefontstyleset) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, int index) | Creates a font style set from an **OH_Drawing_FontMgr** object.|
401| void [OH_Drawing_FontMgrDestroyFontStyleSet](#oh_drawing_fontmgrdestroyfontstyleset) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*) | Reclaims the memory occupied by a font style set.|
402| [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \* [OH_Drawing_FontMgrMatchFamily](#oh_drawing_fontmgrmatchfamily) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName) | Obtains a font style set based on a font family name.|
403| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontMgrMatchFamilyStyle](#oh_drawing_fontmgrmatchfamilystyle) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md)) | Obtains a typeface based on the font style information and font family name.|
404| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontMgrMatchFamilyStyleCharacter](#oh_drawing_fontmgrmatchfamilystylecharacter) ([OH_Drawing_FontMgr](#oh_drawing_fontmgr) \*, const char \*familyName, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md), const char \*bcp47[], int bcp47Count, int32_t character) | Obtains a typeface for the specified character. A null pointer is returned only when no typeface corresponding to the input UTF-8 character is found in the **OH_Drawing_FontMgr** object.|
405| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontStyleSetCreateTypeface](#oh_drawing_fontstylesetcreatetypeface) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, int index) | Creates a typeface for the specified index.|
406| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_FontStyleSetGetStyle](#oh_drawing_fontstylesetgetstyle) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, int32_t index, char \*\*styleName) | Obtains the font style.|
407| void [OH_Drawing_FontStyleSetFreeStyleName](#oh_drawing_fontstylesetfreestylename) (char \*\*styleName) | Reclaims the memory occupied by a font style.|
408| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_FontStyleSetMatchStyle](#oh_drawing_fontstylesetmatchstyle) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyleStruct) | Obtains the typeface closest to the font style.|
409| int [OH_Drawing_FontStyleSetCount](#oh_drawing_fontstylesetcount) ([OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) \*) | Obtains the number of fonts in the font style set.|
410| [OH_Drawing_GpuContext](#oh_drawing_gpucontext) \* [OH_Drawing_GpuContextCreateFromGL](#oh_drawing_gpucontextcreatefromgl) ([OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md)) | Creates an **OH_Drawing_GpuContext** object that uses OpenGL as the backend interface.|
411| void [OH_Drawing_GpuContextDestroy](#oh_drawing_gpucontextdestroy) ([OH_Drawing_GpuContext](#oh_drawing_gpucontext) \*) | Destroys an **OH_Drawing_GpuContext** object and reclaims the memory occupied by the object.|
412| [OH_Drawing_Image](#oh_drawing_image) \* [OH_Drawing_ImageCreate](#oh_drawing_imagecreate) (void) | Creates an **OH_Drawing_Image** object that describes an array of two-dimensional pixels to draw.|
413| void [OH_Drawing_ImageDestroy](#oh_drawing_imagedestroy) ([OH_Drawing_Image](#oh_drawing_image) \*) | Destroys an **OH_Drawing_Image** object and reclaims the memory occupied by the object.|
414| bool [OH_Drawing_ImageBuildFromBitmap](#oh_drawing_imagebuildfrombitmap) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Bitmap](#oh_drawing_bitmap) \*) | Builds an image from a bitmap by sharing or copying bitmap pixels. If the bitmap is marked as immutable, the pixel memory is shared, not copied.|
415| int32_t [OH_Drawing_ImageGetWidth](#oh_drawing_imagegetwidth) ([OH_Drawing_Image](#oh_drawing_image) \*) | Obtains the image width, that is, the number of pixels in each line.|
416| int32_t [OH_Drawing_ImageGetHeight](#oh_drawing_imagegetheight) ([OH_Drawing_Image](#oh_drawing_image) \*) | Obtains the image height, that is, the number of pixel lines.|
417| void [OH_Drawing_ImageGetImageInfo](#oh_drawing_imagegetimageinfo) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) \*) | Obtains the image information. After this function is called, the passed-in image information object is filled.|
418| [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \* [OH_Drawing_ImageFilterCreateBlur](#oh_drawing_imagefiltercreateblur) (float sigmaX, float sigmaY, [OH_Drawing_TileMode](#oh_drawing_tilemode), [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*input) | Creates an **OH_Drawing_ImageFilter** object with a given blur type.|
419| [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \* [OH_Drawing_ImageFilterCreateFromColorFilter](#oh_drawing_imagefiltercreatefromcolorfilter) ([OH_Drawing_ColorFilter](#oh_drawing_colorfilter) \*colorFilter, [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*input) | Creates an **OH_Drawing_ImageFilter** object with a color filter effect.|
420| void [OH_Drawing_ImageFilterDestroy](#oh_drawing_imagefilterdestroy) ([OH_Drawing_ImageFilter](#oh_drawing_imagefilter) \*) | Destroys an **OH_Drawing_ImageFilter** object and reclaims the memory occupied by the object.|
421| [OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \* [OH_Drawing_MaskFilterCreateBlur](#oh_drawing_maskfiltercreateblur) ([OH_Drawing_BlurType](#oh_drawing_blurtype) blurType, float sigma, bool respectCTM) | Creates an **OH_Drawing_MaskFilter** object with a blur type.|
422| void [OH_Drawing_MaskFilterDestroy](#oh_drawing_maskfilterdestroy) ([OH_Drawing_MaskFilter](#oh_drawing_maskfilter) \*) | Destroys an **OH_Drawing_MaskFilter** object and reclaims the memory occupied by the object.|
423| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate) (void) | Creates an **OH_Drawing_Matrix** object.|
424| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateRotation](#oh_drawing_matrixcreaterotation) (float deg, float x, float y) | Creates an **OH_Drawing_Matrix** with the rotation attribute. The matrix is obtained by rotating an identity matrix by a given degree around the rotation point (x, y).|
425| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateScale](#oh_drawing_matrixcreatescale) (float sx, float sy, float px, float py) | Creates an **OH_Drawing_Matrix** with the scale attribute. The matrix is obtained by scaling an identity matrix with the factor (sx, sy) at the rotation point (px, py).|
426| [OH_Drawing_Matrix](#oh_drawing_matrix) \* [OH_Drawing_MatrixCreateTranslation](#oh_drawing_matrixcreatetranslation) (float dx, float dy) | Creates an **OH_Drawing_Matrix** with the translation attribute. The matrix is obtained by translating the identity matrix by the distance (dx, dy).|
427| void [OH_Drawing_MatrixSetMatrix](#oh_drawing_matrixsetmatrix) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2) | Sets matrix parameters for an **OH_Drawing_Matrix** object.|
428| bool [OH_Drawing_MatrixSetRectToRect](#oh_drawing_matrixsetrecttorect) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, const [OH_Drawing_Rect](#oh_drawing_rect) \*dst, [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit) stf) | Scales a matrix to map a source rectangle to a destination rectangle.|
429| void [OH_Drawing_MatrixPreRotate](#oh_drawing_matrixprerotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Premultiplies a matrix by an identity matrix that rotates by a given degree around the rotation point (px, py).|
430| void [OH_Drawing_MatrixPreScale](#oh_drawing_matrixprescale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Premultiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py).|
431| void [OH_Drawing_MatrixPreTranslate](#oh_drawing_matrixpretranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Premultiplies a matrix by an identity matrix that translates by a given distance (dx, dy).|
432| void [OH_Drawing_MatrixPostRotate](#oh_drawing_matrixpostrotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Post multiplies a matrix by an identity matrix that rotates a given degree around the rotation point (px, py).|
433| void [OH_Drawing_MatrixPostScale](#oh_drawing_matrixpostscale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py).|
434| void [OH_Drawing_MatrixPostTranslate](#oh_drawing_matrixposttranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Post multiplies a matrix by an identity matrix that translates by a given distance (dx, dy).|
435| void [OH_Drawing_MatrixReset](#oh_drawing_matrixreset) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Resets a matrix to an identity matrix.|
436| void [OH_Drawing_MatrixConcat](#oh_drawing_matrixconcat) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*total, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*a, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*b) | Multiplies two matrices to produce a new matrix. For example, if a given matrix a and a given matrix b are shown as follows:\| A B C \| \| J K L \| a = \| D E F \|, b = \| M N O \| \| G H I \| \| P Q R \| then the final matrix total is as follows:\| A B C \| \| J K L \| \| AJ+BM+CP AK+BN+CQ AL+BO+CR \| total = a \* b = \| D E F \| \* \| M N O \| = \| DJ+EM+FP DK+EN+FQ DL+EO+FR \| \| G H I \| \| P Q R \| \| GJ+HM+IP GK+HN+IQ GL+HO+IR \| |
437| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_MatrixGetAll](#oh_drawing_matrixgetall) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*matrix, float value[9]) | Obtains all element values of a matrix.|
438| float [OH_Drawing_MatrixGetValue](#oh_drawing_matrixgetvalue) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, int index) | Obtains a matrix value of a given index, which ranges from 0 to 8.|
439| void [OH_Drawing_MatrixRotate](#oh_drawing_matrixrotate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float degree, float px, float py) | Sets a matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py).|
440| void [OH_Drawing_MatrixTranslate](#oh_drawing_matrixtranslate) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float dx, float dy) | Sets a matrix as an identity matrix and translates it by a given distance (dx, dy).|
441| void [OH_Drawing_MatrixScale](#oh_drawing_matrixscale) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, float sx, float sy, float px, float py) | Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py).|
442| bool [OH_Drawing_MatrixInvert](#oh_drawing_matrixinvert) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*inverse) | Inverts a matrix and returns the result.|
443| bool [OH_Drawing_MatrixSetPolyToPoly](#oh_drawing_matrixsetpolytopoly) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*src, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*dst, uint32_t count) | Generates a transformation matrix by setting source points and destination points. Both the number of source points and that of destination points must be in the range [0, 4].|
444| void [OH_Drawing_MatrixMapPoints](#oh_drawing_matrixmappoints) (const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*src, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*dst, int count) | Maps a source point array to a destination point array by means of matrix transformation.|
445| bool [OH_Drawing_MatrixMapRect](#oh_drawing_matrixmaprect) (const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*src, [OH_Drawing_Rect](#oh_drawing_rect) \*dst) | Maps a rectangle to the smallest rectangle that can enclose the vertices to which the four source vertices are mapped by means of matrix transformation.|
446| bool [OH_Drawing_MatrixIsEqual](#oh_drawing_matrixisequal) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*other) | Checks whether two **OH_Drawing_Matrix** objects are equal.|
447| bool [OH_Drawing_MatrixIsIdentity](#oh_drawing_matrixisidentity) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Checks whether an **OH_Drawing_Matrix** object is an identity matrix.|
448| void [OH_Drawing_MatrixDestroy](#oh_drawing_matrixdestroy) ([OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Destroys an **OH_Drawing_Matrix** object and reclaims the memory occupied by the object.|
449| [OH_Drawing_MemoryStream](#oh_drawing_memorystream) \* [OH_Drawing_MemoryStreamCreate](#oh_drawing_memorystreamcreate) (const void \*data, size_t length, bool copyData) | Creates an **OH_Drawing_MemoryStream** object.|
450| void [OH_Drawing_MemoryStreamDestroy](#oh_drawing_memorystreamdestroy) ([OH_Drawing_MemoryStream](#oh_drawing_memorystream) \*) | Destroys an **OH_Drawing_MemoryStream** object and reclaims the memory occupied by the object.|
451| [OH_Drawing_Path](#oh_drawing_path) \* [OH_Drawing_PathCreate](#oh_drawing_pathcreate) (void) | Creates an **OH_Drawing_Path** object.|
452| [OH_Drawing_Path](#oh_drawing_path) \* [OH_Drawing_PathCopy](#oh_drawing_pathcopy) ([OH_Drawing_Path](#oh_drawing_path) \*) | Copies an existing [OH_Drawing_Path](#oh_drawing_path) object to create a new one.|
453| void [OH_Drawing_PathDestroy](#oh_drawing_pathdestroy) ([OH_Drawing_Path](#oh_drawing_path) \*) | Destroys an **OH_Drawing_Path** object and reclaims the memory occupied by the object.|
454| void [OH_Drawing_PathMoveTo](#oh_drawing_pathmoveto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Sets the start point of a path.|
455| void [OH_Drawing_PathLineTo](#oh_drawing_pathlineto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Draws a line segment from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.|
456| void [OH_Drawing_PathArcTo](#oh_drawing_patharcto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x1, float y1, float x2, float y2, float startDeg, float sweepDeg) | Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle is specified first, and then a start angle and a sweep angle are specified. The inscribed ellipse of the rectangle will be used to intercept the arc. The arc is a portion of the ellipse defined by the start angle and the sweep angle. If the path is empty, a line segment from the last point of the path to the start point of the arc is also added.|
457| void [OH_Drawing_PathQuadTo](#oh_drawing_pathquadto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.|
458| void [OH_Drawing_PathConicTo](#oh_drawing_pathconicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.|
459| void [OH_Drawing_PathCubicTo](#oh_drawing_pathcubicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.|
460| void [OH_Drawing_PathRMoveTo](#oh_drawing_pathrmoveto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is used.|
461| void [OH_Drawing_PathRLineTo](#oh_drawing_pathrlineto) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Draws a line segment from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.|
462| void [OH_Drawing_PathRQuadTo](#oh_drawing_pathrquadto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY) | Draws a quadratic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.|
463| void [OH_Drawing_PathRConicTo](#oh_drawing_pathrconicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX, float ctrlY, float endX, float endY, float weight) | Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.|
464| void [OH_Drawing_PathRCubicTo](#oh_drawing_pathrcubicto) ([OH_Drawing_Path](#oh_drawing_path) \*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY) | Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.|
465| void [OH_Drawing_PathAddRect](#oh_drawing_pathaddrect) ([OH_Drawing_Path](#oh_drawing_path) \*, float left, float top, float right, float bottom, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a rectangle to a path in the specified direction. The start point is the upper left corner of the rectangle.|
466| void [OH_Drawing_PathAddRectWithInitialCorner](#oh_drawing_pathaddrectwithinitialcorner) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_PathDirection](#oh_drawing_pathdirection), uint32_t start) | Adds a rectangle contour to a path in the specified direction.|
467| void [OH_Drawing_PathAddRoundRect](#oh_drawing_pathaddroundrect) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*roundRect, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a rounded rectangle to a path in the specified direction. When the path direction is clockwise, the start point is at the intersection of the rounded rectangle's left boundary and its lower left corner. When the path direction is counterclockwise, the start point is at the intersection point between the left boundary and the upper left corner.|
468| void [OH_Drawing_PathAddOvalWithInitialPoint](#oh_drawing_pathaddovalwithinitialpoint) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, uint32_t start, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds an oval to a path. **OH_Drawing_Rect** specifies the outer tangent rectangle of the oval, and **OH_Drawing_PathDirection** specifies whether the drawing is clockwise or anticlockwise.|
469| void [OH_Drawing_PathAddArc](#oh_drawing_pathaddarc) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, float startAngle, float sweepAngle) | Adds an arc to a path as the start of a new contour. The arc added is part of the inscribed ellipse of the rectangle, from the start angle through the sweep angle. If the sweep angle is less than or equal to -360°, or if the sweep angle is greater than or equal to 360°, and start angle modulo 90 is nearly zero, an oval instead of an ellipse is added.|
470| void [OH_Drawing_PathAddPath](#oh_drawing_pathaddpath) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Transforms the points in a **src** path by a matrix and adds the new one to the current path.|
471| void [OH_Drawing_PathAddPathWithMatrixAndMode](#oh_drawing_pathaddpathwithmatrixandmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Transforms the points in a **src** path by a matrix and adds the new one to the current path with the specified adding mode.|
472| void [OH_Drawing_PathAddPathWithMode](#oh_drawing_pathaddpathwithmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Adds a **src** path to the current path with the specified adding mode.|
473| void [OH_Drawing_PathAddPathWithOffsetAndMode](#oh_drawing_pathaddpathwithoffsetandmode) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*src, float dx, float dy, [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode)) | Translates a **src** path by an offset and adds the new one to the current path with the specified adding mode.|
474| void [OH_Drawing_PathAddPolygon](#oh_drawing_pathaddpolygon) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*points, uint32_t count, bool isClosed) | Adds a polygon to a path.|
475| void [OH_Drawing_PathAddCircle](#oh_drawing_pathaddcircle) ([OH_Drawing_Path](#oh_drawing_path) \*path, float x, float y, float radius, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds a circle to a path in the specified direction.|
476| void [OH_Drawing_PathAddOval](#oh_drawing_pathaddoval) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_PathDirection](#oh_drawing_pathdirection)) | Adds an oval to a path in the specified direction.|
477| bool [OH_Drawing_PathBuildFromSvgString](#oh_drawing_pathbuildfromsvgstring) ([OH_Drawing_Path](#oh_drawing_path) \*path, const char \*str) | Parses the path represented by an SVG string.|
478| bool [OH_Drawing_PathContains](#oh_drawing_pathcontains) ([OH_Drawing_Path](#oh_drawing_path) \*, float x, float y) | Checks whether a coordinate point is included in this path. For details, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype).|
479| void [OH_Drawing_PathTransform](#oh_drawing_pathtransform) ([OH_Drawing_Path](#oh_drawing_path) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Transforms the points in a path by a matrix.|
480| void [OH_Drawing_PathTransformWithPerspectiveClip](#oh_drawing_pathtransformwithperspectiveclip) ([OH_Drawing_Path](#oh_drawing_path) \*src, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*, [OH_Drawing_Path](#oh_drawing_path) \*dst, bool applyPerspectiveClip) | Transforms the points in a **src** path by a matrix and uses the new one to replace the **dst** path. If **dst** is NULL, the **src** path is replaced.|
481| void [OH_Drawing_PathSetFillType](#oh_drawing_pathsetfilltype) ([OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_PathFillType](#oh_drawing_pathfilltype)) | Sets the fill type for a path. The fill type determines how "inside" of the path is drawn.|
482| float [OH_Drawing_PathGetLength](#oh_drawing_pathgetlength) ([OH_Drawing_Path](#oh_drawing_path) \*, bool forceClosed) | Obtains the length of a path.|
483| void [OH_Drawing_PathGetBounds](#oh_drawing_pathgetbounds) ([OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the minimum bounds that enclose a path.|
484| void [OH_Drawing_PathClose](#oh_drawing_pathclose) ([OH_Drawing_Path](#oh_drawing_path) \*) | Closes a path by drawing a line segment from the current point to the start point of the path.|
485| bool [OH_Drawing_PathIsClosed](#oh_drawing_pathisclosed) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed) | Checks whether a path is closed.|
486| bool [OH_Drawing_PathGetPositionTangent](#oh_drawing_pathgetpositiontangent) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed, float distance, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*position, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*tangent) | Obtains the coordinates and tangent at a distance from the start point of a path.|
487| bool [OH_Drawing_PathOp](#oh_drawing_pathop) ([OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Path](#oh_drawing_path) \*other, [OH_Drawing_PathOpMode](#oh_drawing_pathopmode) op) | Combines two paths based on the specified operation mode.|
488| bool [OH_Drawing_PathGetMatrix](#oh_drawing_pathgetmatrix) ([OH_Drawing_Path](#oh_drawing_path) \*path, bool forceClosed, float distance, [OH_Drawing_Matrix](#oh_drawing_matrix) \*matrix, [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags) flag) | Obtains a transformation matrix at a distance from the start point of a path.|
489| void [OH_Drawing_PathOffset](#oh_drawing_pathoffset) ([OH_Drawing_Path](#oh_drawing_path) \*path, [OH_Drawing_Path](#oh_drawing_path) \*dst, float dx, float dy) | Translates a path by an offset along the X axis and Y axis and adds the new one to the **dst** path.|
490| void [OH_Drawing_PathReset](#oh_drawing_pathreset) ([OH_Drawing_Path](#oh_drawing_path) \*) | Resets path data.|
491| [OH_Drawing_PathEffect](#oh_drawing_patheffect) \* [OH_Drawing_CreateDashPathEffect](#oh_drawing_createdashpatheffect) (float \*intervals, int count, float phase) | Creates an **OH_Drawing_PathEffect** object with a dashed line effect. The dashed line effect is determined by a group of "on" and "off" intervals.|
492| void [OH_Drawing_PathEffectDestroy](#oh_drawing_patheffectdestroy) ([OH_Drawing_PathEffect](#oh_drawing_patheffect) \*) | Destroys an **OH_Drawing_PathEffect** object and reclaims the memory occupied by the object.|
493| [OH_Drawing_Pen](#oh_drawing_pen) \* [OH_Drawing_PenCreate](#oh_drawing_pencreate) (void) | Creates an **OH_Drawing_Pen** object.|
494| [OH_Drawing_Pen](#oh_drawing_pen) \* [OH_Drawing_PenCopy](#oh_drawing_pencopy) ([OH_Drawing_Pen](#oh_drawing_pen) \*pen) | Copies an existing [OH_Drawing_Pen](#oh_drawing_pen) object to create a new one.|
495| void [OH_Drawing_PenDestroy](#oh_drawing_pendestroy) ([OH_Drawing_Pen](#oh_drawing_pen) \*) | Destroys an **OH_Drawing_Pen** object and reclaims the memory occupied by the object.|
496| bool [OH_Drawing_PenIsAntiAlias](#oh_drawing_penisantialias) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.|
497| void [OH_Drawing_PenSetAntiAlias](#oh_drawing_pensetantialias) ([OH_Drawing_Pen](#oh_drawing_pen) \*, bool) | Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.|
498| uint32_t [OH_Drawing_PenGetColor](#oh_drawing_pengetcolor) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the color of a pen. The color is used by the pen to outline a shape.|
499| void [OH_Drawing_PenSetColor](#oh_drawing_pensetcolor) ([OH_Drawing_Pen](#oh_drawing_pen) \*, uint32_t color) | Sets the color for a pen. The color is used by the pen to outline a shape.|
500| uint8_t [OH_Drawing_PenGetAlpha](#oh_drawing_pengetalpha) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape.|
501| void [OH_Drawing_PenSetAlpha](#oh_drawing_pensetalpha) ([OH_Drawing_Pen](#oh_drawing_pen) \*, uint8_t alpha) | Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape.|
502| float [OH_Drawing_PenGetWidth](#oh_drawing_pengetwidth) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.|
503| void [OH_Drawing_PenSetWidth](#oh_drawing_pensetwidth) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float width) | Sets the thickness for a pen. This thickness determines the width of the outline of a shape.|
504| float [OH_Drawing_PenGetMiterLimit](#oh_drawing_pengetmiterlimit) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the stroke miter limit of a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.|
505| void [OH_Drawing_PenSetMiterLimit](#oh_drawing_pensetmiterlimit) ([OH_Drawing_Pen](#oh_drawing_pen) \*, float miter) | Sets the stroke miter limit for a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.|
506| [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle) [OH_Drawing_PenGetCap](#oh_drawing_pengetcap) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the line cap style of a pen.|
507| void [OH_Drawing_PenSetCap](#oh_drawing_pensetcap) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineCapStyle](#oh_drawing_penlinecapstyle)) | Sets the line cap style for a pen.|
508| [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle) [OH_Drawing_PenGetJoin](#oh_drawing_pengetjoin) (const [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the line join style of a pen.|
509| void [OH_Drawing_PenSetJoin](#oh_drawing_pensetjoin) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PenLineJoinStyle](#oh_drawing_penlinejoinstyle)) | Sets the line join style for a pen.|
510| void [OH_Drawing_PenSetShaderEffect](#oh_drawing_pensetshadereffect) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Sets the shader effect for a pen.|
511| void [OH_Drawing_PenSetShadowLayer](#oh_drawing_pensetshadowlayer) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn.|
512| void [OH_Drawing_PenSetPathEffect](#oh_drawing_pensetpatheffect) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_PathEffect](#oh_drawing_patheffect) \*) | Sets the path effect for a pen.|
513| void [OH_Drawing_PenSetFilter](#oh_drawing_pensetfilter) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Sets a filter for a pen.|
514| void [OH_Drawing_PenGetFilter](#oh_drawing_pengetfilter) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_Filter](#oh_drawing_filter) \*) | Obtains the filter of a pen. The filter is a container that holds a mask filter and color filter.|
515| void [OH_Drawing_PenSetBlendMode](#oh_drawing_pensetblendmode) ([OH_Drawing_Pen](#oh_drawing_pen) \*, [OH_Drawing_BlendMode](#oh_drawing_blendmode)) | Sets a blender for a pen. The blender implements the specified blend mode.|
516| bool [OH_Drawing_PenGetFillPath](#oh_drawing_pengetfillpath) ([OH_Drawing_Pen](#oh_drawing_pen) \*, const [OH_Drawing_Path](#oh_drawing_path) \*src, [OH_Drawing_Path](#oh_drawing_path) \*dst, const [OH_Drawing_Rect](#oh_drawing_rect) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Obtains the source path outline drawn using a pen and represents it using a destination path.|
517| void [OH_Drawing_PenReset](#oh_drawing_penreset) ([OH_Drawing_Pen](#oh_drawing_pen) \*) | Resets a pen to the initial state.|
518| [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \* [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) (NativePixelMap_ \*) | Obtains the pixel map defined by this module from a pixel map defined by the image framework.|
519| [OH_Drawing_PixelMap](#oh_drawing_pixelmap) \* [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative) (OH_PixelmapNative \*) | Obtains the pixel map defined by this module from a pixel map defined by the image framework.|
520| void [OH_Drawing_PixelMapDissolve](#oh_drawing_pixelmapdissolve) ([OH_Drawing_PixelMap](#oh_drawing_pixelmap) \*) | Removes the relationship between a pixel map defined by this module and a pixel map defined by the image framework. The relationship is established by calling [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) or [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative).|
521| [OH_Drawing_Point](#oh_drawing_point) \* [OH_Drawing_PointCreate](#oh_drawing_pointcreate) (float x, float y) | Creates an **OH_Drawing_Point** object.|
522| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointGetX](#oh_drawing_pointgetx) (const [OH_Drawing_Point](#oh_drawing_point) \*point, float \*x) | Obtains the X coordinate of a point.|
523| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointGetY](#oh_drawing_pointgety) (const [OH_Drawing_Point](#oh_drawing_point) \*point, float \*y) | Obtains the Y coordinate of a point.|
524| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_PointSet](#oh_drawing_pointset) ([OH_Drawing_Point](#oh_drawing_point) \*point, float x, float y) | Sets the X and Y coordinates of a point.|
525| void [OH_Drawing_PointDestroy](#oh_drawing_pointdestroy) ([OH_Drawing_Point](#oh_drawing_point) \*) | Destroys an **OH_Drawing_Point** object and reclaims the memory occupied by the object.|
526| [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \* [OH_Drawing_RecordCmdUtilsCreate](#oh_drawing_recordcmdutilscreate) (void) | Creates an **OH_Drawing_RecordCmdUtils** object.|
527| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsDestroy](#oh_drawing_recordcmdutilsdestroy) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils) | Destroys an **OH_Drawing_RecordCmdUtils** object and reclaims the memory occupied by the object.|
528| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils, int32_t width, int32_t height, [OH_Drawing_Canvas](#oh_drawing_canvas) \*\*canvas) | Starts recording. This function must be used in pair with [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording).<br>The **OH_Drawing_RecordCmdUtils** object generates a canvas object of the recording type and calls the interface of the drawing object to record all drawing commands.|
529| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording) ([OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) \*recordCmdUtils, [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*\*recordCmd) | Ends recording. This function must be called after [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording).<br>The **OH_Drawing_RecordCmdUtils** object ends recording and stores the drawing commands recorded by the canvas object of the recording type into the generated [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) object.|
530| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RecordCmdDestroy](#oh_drawing_recordcmddestroy) ([OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*recordCmd) | Destroys an **OH_Drawing_RecordCmd** object and reclaims the memory occupied by the object.|
531| [OH_Drawing_Rect](#oh_drawing_rect) \* [OH_Drawing_RectCreate](#oh_drawing_rectcreate) (float left, float top, float right, float bottom) | Creates an **OH_Drawing_Rect** object, without sorting the coordinates passed in. This means that the coordinates of the upper left corner of the rectangle can be greater than those of the lower right corner.|
532| float [OH_Drawing_RectGetHeight](#oh_drawing_rectgetheight) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the height of a rectangle. The height is calculated by using the Y coordinate of the lower right corner of the rectangle minus the Y coordinate of the upper left corner.|
533| float [OH_Drawing_RectGetWidth](#oh_drawing_rectgetwidth) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the width of a rectangle. The width is calculated by using the X coordinate of the lower right corner of the rectangle minus the X coordinate of the upper left corner.|
534| float [OH_Drawing_RectGetLeft](#oh_drawing_rectgetleft) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the X coordinate of the upper left corner of a rectangle.|
535| float [OH_Drawing_RectGetTop](#oh_drawing_rectgettop) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the Y coordinate of the upper left corner of a rectangle.|
536| float [OH_Drawing_RectGetRight](#oh_drawing_rectgetright) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the X coordinate of the lower right corner of a rectangle.|
537| float [OH_Drawing_RectGetBottom](#oh_drawing_rectgetbottom) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the Y coordinate of the lower right corner of a rectangle.|
538| bool [OH_Drawing_RectIntersect](#oh_drawing_rectintersect) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, const [OH_Drawing_Rect](#oh_drawing_rect) \*other) | Checks whether two rectangles intersect and if yes, sets **rect** to the area of intersection.|
539| bool [OH_Drawing_RectJoin](#oh_drawing_rectjoin) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, const [OH_Drawing_Rect](#oh_drawing_rect) \*other) | Obtains the union of two rectangles.|
540| void [OH_Drawing_RectSetLeft](#oh_drawing_rectsetleft) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float left) | Sets the horizontal coordinate of the upper left corner of a rectangle.|
541| void [OH_Drawing_RectSetTop](#oh_drawing_rectsettop) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float top) | Sets the vertical coordinate of the upper left corner of a rectangle.|
542| void [OH_Drawing_RectSetRight](#oh_drawing_rectsetright) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float right) | Sets the horizontal coordinate of the lower right corner of a rectangle.|
543| void [OH_Drawing_RectSetBottom](#oh_drawing_rectsetbottom) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect, float bottom) | Sets the vertical coordinate of the lower right corner of a rectangle.|
544| void [OH_Drawing_RectCopy](#oh_drawing_rectcopy) ([OH_Drawing_Rect](#oh_drawing_rect) \*sRect, [OH_Drawing_Rect](#oh_drawing_rect) \*dRect) | Copies a source rectangle to create a new one.|
545| void [OH_Drawing_RectDestroy](#oh_drawing_rectdestroy) ([OH_Drawing_Rect](#oh_drawing_rect) \*) | Destroys an **OH_Drawing_Rect** object and reclaims the memory occupied by the object.|
546| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_RectCreateArray](#oh_drawing_rectcreatearray) (size_t size) | Creates a rectangle array object to store multiple rectangle objects. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_RectDestroyArray](#oh_drawing_rectdestroyarray) to release the pointer to the object.|
547| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RectGetArraySize](#oh_drawing_rectgetarraysize) ([OH_Drawing_Array](#oh_drawing_array) \*rectArray, size_t \*pSize) | Obtains the size of a rectangle array, which is an [OH_Drawing_Array](#oh_drawing_array) object.|
548| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RectGetArrayElement](#oh_drawing_rectgetarrayelement) ([OH_Drawing_Array](#oh_drawing_array) \*rectArray, size_t index, [OH_Drawing_Rect](#oh_drawing_rect) \*\*rect) | Obtains the rectangle with the specified index in a rectangle array.|
549| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RectDestroyArray](#oh_drawing_rectdestroyarray) ([OH_Drawing_Array](#oh_drawing_array) \*rectArray) | Destroys an **OH_Drawing_Array** object and reclaims the memory occupied by the object.|
550| [OH_Drawing_Region](#oh_drawing_region) \* [OH_Drawing_RegionCreate](#oh_drawing_regioncreate) (void) | Creates an **OH_Drawing_Region** object for more accurate graphical control.|
551| bool [OH_Drawing_RegionContains](#oh_drawing_regioncontains) ([OH_Drawing_Region](#oh_drawing_region) \*region, int32_t x, int32_t y) | Checks whether a region contains the specified point.|
552| bool [OH_Drawing_RegionOp](#oh_drawing_regionop) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Region](#oh_drawing_region) \*other, [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode) op) | Combines two regions based on the specified operation mode.|
553| bool [OH_Drawing_RegionSetRect](#oh_drawing_regionsetrect) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Rect](#oh_drawing_rect) \*rect) | Sets the boundary for an **OH_Drawing_Region** object.|
554| bool [OH_Drawing_RegionSetPath](#oh_drawing_regionsetpath) ([OH_Drawing_Region](#oh_drawing_region) \*region, const [OH_Drawing_Path](#oh_drawing_path) \*path, const [OH_Drawing_Region](#oh_drawing_region) \*clip) | Sets a region to the area described by the path.|
555| void [OH_Drawing_RegionDestroy](#oh_drawing_regiondestroy) ([OH_Drawing_Region](#oh_drawing_region) \*) | Destroys an **OH_Drawing_Region** object and reclaims the memory occupied by the object.|
556| uint32_t [OH_Drawing_RegisterFont](#oh_drawing_registerfont) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*, const char \*fontFamily, const char \*familySrc) | Registers a custom font with the font manager. The supported font file formats are .ttf and .otf.|
557| uint32_t [OH_Drawing_RegisterFontBuffer](#oh_drawing_registerfontbuffer) ([OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*, const char \*fontFamily, uint8_t \*fontBuffer, size_t length) | Registers a font buffer with the font manager.|
558| [OH_Drawing_RoundRect](#oh_drawing_roundrect) \* [OH_Drawing_RoundRectCreate](#oh_drawing_roundrectcreate) (const [OH_Drawing_Rect](#oh_drawing_rect) \*, float xRad, float yRad) | Creates an **OH_Drawing_RoundRect** object.|
559| void [OH_Drawing_RoundRectSetCorner](#oh_drawing_roundrectsetcorner) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CornerPos](#oh_drawing_cornerpos) pos, [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii)) | Sets the radii of the specified rounded corner in a rounded rectangle.|
560| [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) [OH_Drawing_RoundRectGetCorner](#oh_drawing_roundrectgetcorner) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CornerPos](#oh_drawing_cornerpos) pos) | Obtains the radii of the specified rounded corner in a rounded rectangle.|
561| void [OH_Drawing_RoundRectDestroy](#oh_drawing_roundrectdestroy) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*) | Destroys an **OH_Drawing_RoundRect** object and reclaims the memory occupied by the object.|
562| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_RoundRectOffset](#oh_drawing_roundrectoffset) ([OH_Drawing_RoundRect](#oh_drawing_roundrect) \*roundRect, float dx, float dy) | Translates a rounded rectangle by an offset along the X axis and Y axis.|
563| [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \* [OH_Drawing_SamplingOptionsCreate](#oh_drawing_samplingoptionscreate) ([OH_Drawing_FilterMode](#oh_drawing_filtermode), [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode)) | Creates an **OH_Drawing_SamplingOptions** object.|
564| void [OH_Drawing_SamplingOptionsDestroy](#oh_drawing_samplingoptionsdestroy) ([OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*) | Destroys an **OH_Drawing_SamplingOptions** object and reclaims the memory occupied by the object.|
565| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateColorShader](#oh_drawing_shadereffectcreatecolorshader) (const uint32_t color) | Creates an **OH_Drawing_ShaderEffect** object with a single color.|
566| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateLinearGradient](#oh_drawing_shadereffectcreatelineargradient) (const [OH_Drawing_Point](#oh_drawing_point) \*startPt, const [OH_Drawing_Point](#oh_drawing_point) \*endPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.|
567| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix](#oh_drawing_shadereffectcreatelineargradientwithlocalmatrix) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*startPt, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*endPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.|
568| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateRadialGradient](#oh_drawing_shadereffectcreateradialgradient) (const [OH_Drawing_Point](#oh_drawing_point) \*centerPt, float radius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.|
569| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix](#oh_drawing_shadereffectcreateradialgradientwithlocalmatrix) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*centerPt, float radius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.|
570| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateSweepGradient](#oh_drawing_shadereffectcreatesweepgradient) (const [OH_Drawing_Point](#oh_drawing_point) \*centerPt, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode)) | Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the center. A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°.|
571| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateImageShader](#oh_drawing_shadereffectcreateimageshader) ([OH_Drawing_Image](#oh_drawing_image) \*, [OH_Drawing_TileMode](#oh_drawing_tilemode) tileX, [OH_Drawing_TileMode](#oh_drawing_tilemode) tileY, const [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) \*, const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object for an image shader. You are advised not to use the API for the canvas of the capture type because it affects the performance.|
572| [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \* [OH_Drawing_ShaderEffectCreateTwoPointConicalGradient](#oh_drawing_shadereffectcreatetwopointconicalgradient) (const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*startPt, float startRadius, const [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*endPt, float endRadius, const uint32_t \*colors, const float \*pos, uint32_t size, [OH_Drawing_TileMode](#oh_drawing_tilemode), const [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Creates an **OH_Drawing_ShaderEffect** object that generates a gradient between two given circles.|
573| void [OH_Drawing_ShaderEffectDestroy](#oh_drawing_shadereffectdestroy) ([OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) \*) | Destroys an **OH_Drawing_ShaderEffect** object and reclaims the memory occupied by the object.|
574| [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \* [OH_Drawing_ShadowLayerCreate](#oh_drawing_shadowlayercreate) (float blurRadius, float x, float y, uint32_t color) | Creates an **OH_Drawing_ShadowLayer** object.|
575| void [OH_Drawing_ShadowLayerDestroy](#oh_drawing_shadowlayerdestroy) ([OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) \*) | Destroys an **OH_Drawing_ShadowLayer** object and reclaims the memory occupied by the object.|
576| [OH_Drawing_Surface](#oh_drawing_surface) \* [OH_Drawing_SurfaceCreateFromGpuContext](#oh_drawing_surfacecreatefromgpucontext) ([OH_Drawing_GpuContext](#oh_drawing_gpucontext) \*, bool budgeted, [OH_Drawing_Image_Info](_o_h___drawing___image___info.md)) | Creates an **OH_Drawing_Surface** object using the GPU context to manage the content drawn on the canvas.|
577| [OH_Drawing_Canvas](#oh_drawing_canvas) \* [OH_Drawing_SurfaceGetCanvas](#oh_drawing_surfacegetcanvas) ([OH_Drawing_Surface](#oh_drawing_surface) \*) | Obtains a canvas from an **OH_Drawing_Surface** object.|
578| void [OH_Drawing_SurfaceDestroy](#oh_drawing_surfacedestroy) ([OH_Drawing_Surface](#oh_drawing_surface) \*) | Destroys an **OH_Drawing_Surface** object and reclaims the memory occupied.|
579| [OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \* [OH_Drawing_TextBlobBuilderCreate](#oh_drawing_textblobbuildercreate) (void) | Creates an **OH_Drawing_TextBlobBuilder** object.|
580| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromText](#oh_drawing_textblobcreatefromtext) (const void \*text, size_t byteLength, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from the text.|
581| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromPosText](#oh_drawing_textblobcreatefrompostext) (const void \*text, size_t byteLength, [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) \*, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from the text. The coordinates of each character in the **OH_Drawing_TextBlob** object are determined by the coordinate information in the **OH_Drawing_Point2D** array.|
582| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobCreateFromString](#oh_drawing_textblobcreatefromstring) (const char \*str, const [OH_Drawing_Font](#oh_drawing_font) \*, [OH_Drawing_TextEncoding](#oh_drawing_textencoding)) | Creates an **OH_Drawing_TextBlob** object from a string.|
583| void [OH_Drawing_TextBlobGetBounds](#oh_drawing_textblobgetbounds) ([OH_Drawing_TextBlob](#oh_drawing_textblob) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the bounds of an **OH_Drawing_TextBlob** object.|
584| uint32_t [OH_Drawing_TextBlobUniqueID](#oh_drawing_textblobuniqueid) (const [OH_Drawing_TextBlob](#oh_drawing_textblob) \*) | Obtains the unique identifier of a text blob. The identifier is a non-zero value.|
585| const [OH_Drawing_RunBuffer](_o_h___drawing___run_buffer.md) \* [OH_Drawing_TextBlobBuilderAllocRunPos](#oh_drawing_textblobbuilderallocrunpos) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*, const [OH_Drawing_Font](#oh_drawing_font) \*, int32_t count, const [OH_Drawing_Rect](#oh_drawing_rect) \*) | Allocates a run to store glyphs and positions. The pointer returned does not need to be managed by the caller. It can no longer be used after [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) is called.|
586| [OH_Drawing_TextBlob](#oh_drawing_textblob) \* [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*) | Makes an **OH_Drawing_TextBlob** object from an **OH_Drawing_TextBlobBuilder**.|
587| void [OH_Drawing_TextBlobDestroy](#oh_drawing_textblobdestroy) ([OH_Drawing_TextBlob](#oh_drawing_textblob) \*) | Destroys an **OH_Drawing_TextBlob** object and reclaims the memory occupied by the object.|
588| void [OH_Drawing_TextBlobBuilderDestroy](#oh_drawing_textblobbuilderdestroy) ([OH_Drawing_TextBlobBuilder](#oh_drawing_textblobbuilder) \*) | Destroys an **OH_Drawing_TextBlobBuilder** object and reclaims the memory occupied by the object.|
589| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_MatchFontDescriptors](#oh_drawing_matchfontdescriptors) ([OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \*, size_t \*) | Obtains all system font descriptors that match a font descriptor. In the [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) struct, the **path** field is not used for matching, and other fields are valid only when they are not set to their default values. If all fields in [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) are set to their default values, all system font descriptors are returned. If no matching is found, NULL is returned. When [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) is no longer required, call [OH_Drawing_DestroyFontDescriptors](_drawing.md#oh_drawing_destroyfontdescriptors) to release the pointer to the object.|
590| void [OH_Drawing_DestroyFontDescriptors](#oh_drawing_destroyfontdescriptors) ([OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \*, size_t) | Releases an array of [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) objects.|
591| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_GetFontDescriptorByFullName](#oh_drawing_getfontdescriptorbyfullname) (const [OH_Drawing_String](_o_h___drawing___string.md) \*, [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype)) | Obtains a font descriptor based on the font name and type. System fonts, style fonts, and user-installed fonts are supported. A font descriptor is a data structure that describes font features. It contains details of the font appearance and properties.|
592| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_GetSystemFontFullNamesByType](#oh_drawing_getsystemfontfullnamesbytype) ([OH_Drawing_SystemFontType](#oh_drawing_systemfonttype)) | Obtains an array of font names by font type.|
593| const [OH_Drawing_String](_o_h___drawing___string.md) \* [OH_Drawing_GetSystemFontFullNameByIndex](#oh_drawing_getsystemfontfullnamebyindex) ([OH_Drawing_Array](#oh_drawing_array) \*, size_t) | Obtains the font name with the specified index in the font name array.|
594| void [OH_Drawing_DestroySystemFontFullNames](#oh_drawing_destroysystemfontfullnames) ([OH_Drawing_Array](#oh_drawing_array) \*) | Releases the memory occupied by the font name array obtained by font type.|
595| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_TypographyGetTextLines](#oh_drawing_typographygettextlines) ([OH_Drawing_Typography](#oh_drawing_typography) \*typography) | Obtains the array of text lines in a typography object. This array contains one or more text line objects. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyTextLines](#oh_drawing_destroytextlines) to release the pointer to the object.|
596| void [OH_Drawing_DestroyTextLines](#oh_drawing_destroytextlines) ([OH_Drawing_Array](#oh_drawing_array) \*lines) | Releases the memory occupied by a text line array.|
597| void [OH_Drawing_DestroyTextLine](#oh_drawing_destroytextline) (OH_Drawing_TextLine \*line) | Releases the memory occupied by a text line object. This is applicable only to text line objects that have requested memory on their own and not to a particular text line object within a text line array.|
598| OH_Drawing_TextLine \* [OH_Drawing_GetTextLineByIndex](#oh_drawing_gettextlinebyindex) ([OH_Drawing_Array](#oh_drawing_array) \*lines, size_t index) | Obtains the text line object with the specified index in a text line array.|
599| double [OH_Drawing_TextLineGetGlyphCount](#oh_drawing_textlinegetglyphcount) (OH_Drawing_TextLine \*line) | Obtains the number of glyphs in a text line object.|
600| void [OH_Drawing_TextLineGetTextRange](#oh_drawing_textlinegettextrange) (OH_Drawing_TextLine \*line, size_t \*start, size_t \*end) | Obtains the range of the text in a text line object in the entire paragraph.|
601| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_TextLineGetGlyphRuns](#oh_drawing_textlinegetglyphruns) (OH_Drawing_TextLine \*line) | Obtains the array of glyph runs in a text line object.|
602| void [OH_Drawing_DestroyRuns](#oh_drawing_destroyruns) ([OH_Drawing_Array](#oh_drawing_array) \*runs) | Releases the memory occupied by a glyph run array.|
603| OH_Drawing_Run \* [OH_Drawing_GetRunByIndex](#oh_drawing_getrunbyindex) ([OH_Drawing_Array](#oh_drawing_array) \*runs, size_t index) | Obtains the glyph run object with the specified index in a glyph run array.|
604| void [OH_Drawing_TextLinePaint](#oh_drawing_textlinepaint) (OH_Drawing_TextLine \*line, [OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, double x, double y) | Paints a text line on the canvas with the coordinate point (x, y) as the upper left corner.|
605| OH_Drawing_TextLine \* [OH_Drawing_TextLineCreateTruncatedLine](#oh_drawing_textlinecreatetruncatedline) (OH_Drawing_TextLine \*line, double width, int mode, const char \*ellipsis) | Creates a truncated text line object.|
606| double [OH_Drawing_TextLineGetTypographicBounds](#oh_drawing_textlinegettypographicbounds) (OH_Drawing_TextLine \*line, double \*ascent, double \*descent, double \*leading) | Obtains the typographic boundary of a text line object. The typographic boundary is related to the font and font size used for typography, but not the characters within the text. For example, for the string " a b " (which has a space before "a" and a space after "b"), the typographic boundary encompasses the spaces at the beginning and end. For the strings "j" and "E", the typographic boundaries are the same, indicating that they are irrelevant to specific characters.|
607| [OH_Drawing_Rect](#oh_drawing_rect) \* [OH_Drawing_TextLineGetImageBounds](#oh_drawing_textlinegetimagebounds) (OH_Drawing_TextLine \*line) | Obtains the image boundary of a text line object. The image boundary, equivalent to a visual boundary, is related to the font, font size, and characters. For example, for the string " a b " (which has a space before "a" and a space after "b"), only "a b" are visible to users, and therefore the image boundary does not include these spaces at the beginning and end. For the strings "j" and "E", their image boundaries are different. Specifically, the width of the boundary for "j" is narrower than that for "E", and the height of the boundary for "j" is taller than that for "E".|
608| double [OH_Drawing_TextLineGetTrailingSpaceWidth](#oh_drawing_textlinegettrailingspacewidth) (OH_Drawing_TextLine \*line) | Obtains the width of the spaces at the end of a text line object.|
609| int32_t [OH_Drawing_TextLineGetStringIndexForPosition](#oh_drawing_textlinegetstringindexforposition) (OH_Drawing_TextLine \*line, [OH_Drawing_Point](#oh_drawing_point) \*point) | Obtains the index of a string at a specified position in a text line object.|
610| double [OH_Drawing_TextLineGetOffsetForStringIndex](#oh_drawing_textlinegetoffsetforstringindex) (OH_Drawing_TextLine \*line, int32_t index) | Obtains the offset of a string with the specified index in a text line object.|
611| void [OH_Drawing_TextLineEnumerateCaretOffsets](#oh_drawing_textlineenumeratecaretoffsets) (OH_Drawing_TextLine \*line, [Drawing_CaretOffsetsCallback](#drawing_caretoffsetscallback) callback) | Enumerates the offset and index of each character in a text line object and passes them to a custom callback function. You can use the offset and index array for other operations.|
612| double [OH_Drawing_TextLineGetAlignmentOffset](#oh_drawing_textlinegetalignmentoffset) (OH_Drawing_TextLine \*line, double alignmentFactor, double alignmentWidth) | Obtains the offset of a text line object after alignment based on the alignment factor and alignment width.|
613| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_GetRunStringIndices](#oh_drawing_getrunstringindices) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains an array of character indices of glyphs within a specified range of a run, where the indices are offsets relative to the entire paragraph.|
614| uint64_t [OH_Drawing_GetRunStringIndicesByIndex](#oh_drawing_getrunstringindicesbyindex) ([OH_Drawing_Array](#oh_drawing_array) \*stringIndices, size_t index) | Obtains character indices of glyphs in a run by index.|
615| void [OH_Drawing_DestroyRunStringIndices](#oh_drawing_destroyrunstringindices) ([OH_Drawing_Array](#oh_drawing_array) \*stringIndices) | Releases the pointer to a character index array.|
616| void [OH_Drawing_GetRunStringRange](#oh_drawing_getrunstringrange) (OH_Drawing_Run \*run, uint64_t \*location, uint64_t \*length) | Obtains the range of glyphs generated by a run.|
617| float [OH_Drawing_GetRunTypographicBounds](#oh_drawing_getruntypographicbounds) (OH_Drawing_Run \*run, float \*ascent, float \*descent, float \*leading) | Obtains the typographic boundary of a run. The typographic boundary is related to the font and font size used for typography, but not the characters within the text.|
618| void [OH_Drawing_RunPaint](#oh_drawing_runpaint) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, OH_Drawing_Run \*run, double x, double y) | Paints the text contained in a run on the canvas.|
619| [OH_Drawing_Rect](#oh_drawing_rect) \* [OH_Drawing_GetRunImageBounds](#oh_drawing_getrunimagebounds) (OH_Drawing_Run \*run) | Obtains the image boundary of a run. The image boundary is related to characters and is equivalent to the visual boundary.|
620| void [OH_Drawing_DestroyRunImageBounds](#oh_drawing_destroyrunimagebounds) ([OH_Drawing_Rect](#oh_drawing_rect) \*rect) | Releases the pointer to an image boundary object of a run.|
621| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_GetRunGlyphs](#oh_drawing_getrunglyphs) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains an array of glyphs within the specified range of a run.|
622| uint16_t [OH_Drawing_GetRunGlyphsByIndex](#oh_drawing_getrunglyphsbyindex) ([OH_Drawing_Array](#oh_drawing_array) \*glyphs, size_t index) | Obtains individual glyphs in a run by index.|
623| void [OH_Drawing_DestroyRunGlyphs](#oh_drawing_destroyrunglyphs) ([OH_Drawing_Array](#oh_drawing_array) \*glyphs) | Releases the pointer to a glyph array in a run.|
624| [OH_Drawing_Array](#oh_drawing_array) \* [OH_Drawing_GetRunPositions](#oh_drawing_getrunpositions) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains the positions of glyphs within the specified range of a run.|
625| [OH_Drawing_Point](#oh_drawing_point) \* [OH_Drawing_GetRunPositionsByIndex](#oh_drawing_getrunpositionsbyindex) ([OH_Drawing_Array](#oh_drawing_array) \*positions, size_t index) | Obtains the positions of individual glyphs in a run by index.|
626| void [OH_Drawing_DestroyRunPositions](#oh_drawing_destroyrunpositions) ([OH_Drawing_Array](#oh_drawing_array) \*positions) | Releases the pointer to a glyph position array in a run.|
627| uint32_t [OH_Drawing_GetRunGlyphCount](#oh_drawing_getrunglyphcount) (OH_Drawing_Run \*run) | Obtains the number of glyphs in a run.|
628| [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \* [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle) (void) | Creates an **OH_Drawing_TypographyStyle** object. When [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) is no longer required, call [OH_Drawing_DestroyTypographyStyle](#oh_drawing_destroytypographystyle) to release the pointer to the object.|
629| void [OH_Drawing_DestroyTypographyStyle](#oh_drawing_destroytypographystyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Destroys an **OH_Drawing_TypographyStyle** object and reclaims the memory occupied by the object.|
630| void [OH_Drawing_SetTypographyTextDirection](#oh_drawing_settypographytextdirection) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text direction in a typography style.|
631| void [OH_Drawing_SetTypographyTextAlign](#oh_drawing_settypographytextalign) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text alignment mode.|
632| int [OH_Drawing_TypographyGetEffectiveAlignment](#oh_drawing_typographygeteffectivealignment) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the text alignment mode.|
633| void [OH_Drawing_SetTypographyTextMaxLines](#oh_drawing_settypographytextmaxlines) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the maximum number of lines in the text.|
634| [OH_Drawing_TextStyle](#oh_drawing_textstyle) \* [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle) (void) | Creates an **OH_Drawing_TextStyle** object.|
635| [OH_Drawing_TextStyle](#oh_drawing_textstyle) \* [OH_Drawing_TypographyGetTextStyle](#oh_drawing_typographygettextstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the default text style of a typography style.|
636| void [OH_Drawing_DestroyTextStyle](#oh_drawing_destroytextstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Destroys an **OH_Drawing_TextStyle** object and reclaims the memory occupied by the object.|
637| void [OH_Drawing_SetTextStyleColor](#oh_drawing_settextstylecolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | Sets the color for a text style.|
638| void [OH_Drawing_SetTextStyleFontSize](#oh_drawing_settextstylefontsize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the font size for a text style.|
639| void [OH_Drawing_SetTextStyleFontWeight](#oh_drawing_settextstylefontweight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the font weight for a text style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.|
640| void [OH_Drawing_SetTextStyleBaseLine](#oh_drawing_settextstylebaseline) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the baseline for a text style.|
641| void [OH_Drawing_SetTextStyleDecoration](#oh_drawing_settextstyledecoration) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the decoration for a text style. Only one decoration can be set. To add multiple decorations, use [OH_Drawing_AddTextStyleDecoration](#oh_drawing_addtextstyledecoration).|
642| void [OH_Drawing_AddTextStyleDecoration](#oh_drawing_addtextstyledecoration) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Adds the decoration for a text style. Multiple decoration lines can be displayed.|
643| void [OH_Drawing_RemoveTextStyleDecoration](#oh_drawing_removetextstyledecoration) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Removes the decoration for a text style.|
644| void [OH_Drawing_SetTextStyleDecorationColor](#oh_drawing_settextstyledecorationcolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, uint32_t) | Sets the decoration color for a text style.|
645| void [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the line height based on the multiple of the font size.|
646| void [OH_Drawing_SetTextStyleFontFamilies](#oh_drawing_settextstylefontfamilies) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int, const char \*fontFamilies[]) | Sets the font families for a text style.|
647| void [OH_Drawing_SetTextStyleFontStyle](#oh_drawing_settextstylefontstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the font style for a text style.|
648| void [OH_Drawing_SetTextStyleLocale](#oh_drawing_settextstylelocale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*) | Sets the locale for a text style.|
649| void [OH_Drawing_SetTextStyleForegroundBrush](#oh_drawing_settextstyleforegroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Sets the foreground brush for a text style.|
650| void [OH_Drawing_TextStyleGetForegroundBrush](#oh_drawing_textstylegetforegroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the foreground brush of a text style.|
651| void [OH_Drawing_SetTextStyleForegroundPen](#oh_drawing_settextstyleforegroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Sets the foreground pen for a text style.|
652| void [OH_Drawing_TextStyleGetForegroundPen](#oh_drawing_textstylegetforegroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the foreground pen of a text style.|
653| void [OH_Drawing_SetTextStyleBackgroundBrush](#oh_drawing_settextstylebackgroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Sets the background brush for a text style.|
654| void [OH_Drawing_TextStyleGetBackgroundBrush](#oh_drawing_textstylegetbackgroundbrush) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Brush](#oh_drawing_brush) \*) | Obtains the background brush of a text style.|
655| void [OH_Drawing_SetTextStyleBackgroundPen](#oh_drawing_settextstylebackgroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Sets the background pen for a text style.|
656| void [OH_Drawing_TextStyleGetBackgroundPen](#oh_drawing_textstylegetbackgroundpen) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Pen](#oh_drawing_pen) \*) | Obtains the background pen of a text style.|
657| [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \* [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_FontCollection](#oh_drawing_fontcollection) \*) | Creates an **OH_Drawing_TypographyCreate** object. When [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) is no longer required, call [OH_Drawing_DestroyTypographyHandler](#oh_drawing_destroytypographyhandler) to release the pointer to the object.|
658| void [OH_Drawing_DestroyTypographyHandler](#oh_drawing_destroytypographyhandler) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Destroys an **OH_Drawing_TypographyCreate** object and reclaims the memory occupied by the object.|
659| void [OH_Drawing_TypographyHandlerPushTextStyle](#oh_drawing_typographyhandlerpushtextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Pushes a text style into the text style stack. Any text added afterward will use the style currently on top of the stack.|
660| void [OH_Drawing_TypographyHandlerAddText](#oh_drawing_typographyhandleraddtext) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, const char \*) | Adds text.|
661| void [OH_Drawing_TypographyHandlerPopTextStyle](#oh_drawing_typographyhandlerpoptextstyle) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Pops the top text style out of the text style stack.|
662| [OH_Drawing_Typography](#oh_drawing_typography) \* [OH_Drawing_CreateTypography](#oh_drawing_createtypography) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*) | Creates an **OH_Drawing_Typography** object. When [OH_Drawing_Typography](#oh_drawing_typography) is no longer required, call [OH_Drawing_DestroyTypography](#oh_drawing_destroytypography) to release the pointer to the object.|
663| void [OH_Drawing_DestroyTypography](#oh_drawing_destroytypography) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Destroys an **OH_Drawing_Typography** object and reclaims the memory occupied by the object.|
664| void [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double) | Lays out the typography.|
665| void [OH_Drawing_TypographyPaint](#oh_drawing_typographypaint) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_Canvas](#oh_drawing_canvas) \*, double, double) | Draws text from the upper left corner at a specified position. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called and applied.|
666| void [OH_Drawing_TypographyPaintOnPath](#oh_drawing_typographypaintonpath) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Path](#oh_drawing_path) \*, double, double) | Draws text along a path.|
667| double [OH_Drawing_TypographyGetMaxWidth](#oh_drawing_typographygetmaxwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the typography width set by the user. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
668| double [OH_Drawing_TypographyGetHeight](#oh_drawing_typographygetheight) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the overall height of a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
669| double [OH_Drawing_TypographyGetLongestLine](#oh_drawing_typographygetlongestline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the width of the longest line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. You are advised to round up the return value. If the text content is empty, **0.0** is returned.|
670| double [OH_Drawing_TypographyGetLongestLineWithIndent](#oh_drawing_typographygetlongestlinewithindent) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the width of the longest line of a typography object, including its indentation. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. You are advised to round up the return value. If the text content is empty, **0.0** is returned.|
671| double [OH_Drawing_TypographyGetMinIntrinsicWidth](#oh_drawing_typographygetminintrinsicwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the minimum intrinsic width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
672| double [OH_Drawing_TypographyGetMaxIntrinsicWidth](#oh_drawing_typographygetmaxintrinsicwidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the maximum intrinsic width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
673| double [OH_Drawing_TypographyGetAlphabeticBaseline](#oh_drawing_typographygetalphabeticbaseline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the alphabetic baseline in a typography object.|
674| double [OH_Drawing_TypographyGetIdeographicBaseline](#oh_drawing_typographygetideographicbaseline) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the ideographic baseline in a typography object.|
675| void [OH_Drawing_TypographyHandlerAddPlaceholder](#oh_drawing_typographyhandleraddplaceholder) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) \*) | Adds a placeholder.|
676| bool [OH_Drawing_TypographyDidExceedMaxLines](#oh_drawing_typographydidexceedmaxlines) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Checks whether the maximum number of lines of a typography object is exceeded. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. If the maximum number of lines is not set by calling [OH_Drawing_SetTypographyTextMaxLines](#oh_drawing_settypographytextmaxlines), **false** is returned.|
677| [OH_Drawing_TextBox](#oh_drawing_textbox) \* [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t, size_t, [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle), [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle)) | Obtains text boxes in a given range of a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_TextBox](#oh_drawing_textbox) is no longer required, call [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) to release the pointer to the object.|
678| [OH_Drawing_TextBox](#oh_drawing_textbox) \* [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains text boxes for placeholders in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_TextBox](#oh_drawing_textbox) is no longer required, call [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) to release the pointer to the object.|
679| float [OH_Drawing_GetLeftFromTextBox](#oh_drawing_getleftfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the left position of a text box.|
680| float [OH_Drawing_GetRightFromTextBox](#oh_drawing_getrightfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the right position of a text box.|
681| float [OH_Drawing_GetTopFromTextBox](#oh_drawing_gettopfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the top position of a text box.|
682| float [OH_Drawing_GetBottomFromTextBox](#oh_drawing_getbottomfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the bottom position of a text box.|
683| int [OH_Drawing_GetTextDirectionFromTextBox](#oh_drawing_gettextdirectionfromtextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*, int) | Obtains the text direction of a text box.|
684| size_t [OH_Drawing_GetSizeOfTextBox](#oh_drawing_getsizeoftextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*) | Obtains the number of text boxes.|
685| [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \* [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double, double) | Obtains the position and affinity of the glyph at the given coordinates.|
686| [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \* [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster) ([OH_Drawing_Typography](#oh_drawing_typography) \*, double, double) | Obtains the position and affinity of the glyph cluster to which the glyph at the given coordinates belongs. The glyph cluster is a container that holds one or more glyphs.|
687| size_t [OH_Drawing_GetPositionFromPositionAndAffinity](#oh_drawing_getpositionfrompositionandaffinity) ([OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \*) | Obtains the position attribute of an **OH_Drawing_PositionAndAffinity** object.|
688| int [OH_Drawing_GetAffinityFromPositionAndAffinity](#oh_drawing_getaffinityfrompositionandaffinity) ([OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) \*) | Obtains the affinity attribute of an **OH_Drawing_PositionAndAffinity** object. The affinity determines whether the font is close to the front text or rear text.|
689| [OH_Drawing_Range](#oh_drawing_range) \* [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t) | Obtains the word boundary in a typography object.|
690| size_t [OH_Drawing_GetStartFromRange](#oh_drawing_getstartfromrange) ([OH_Drawing_Range](#oh_drawing_range) \*) | Obtains the start position of an **OH_Drawing_Range** object.|
691| size_t [OH_Drawing_GetEndFromRange](#oh_drawing_getendfromrange) ([OH_Drawing_Range](#oh_drawing_range) \*) | Obtains the end position of an **OH_Drawing_Range** object.|
692| size_t [OH_Drawing_TypographyGetLineCount](#oh_drawing_typographygetlinecount) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the number of lines in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
693| void [OH_Drawing_SetTextStyleDecorationStyle](#oh_drawing_settextstyledecorationstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the decoration style for a text style.|
694| void [OH_Drawing_SetTextStyleDecorationThicknessScale](#oh_drawing_settextstyledecorationthicknessscale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the thickness scale factor for the decoration style of a text style.|
695| void [OH_Drawing_SetTextStyleLetterSpacing](#oh_drawing_settextstyleletterspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the letter spacing for a text style.|
696| void [OH_Drawing_SetTextStyleWordSpacing](#oh_drawing_settextstylewordspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double) | Sets the word spacing for a text style.|
697| void [OH_Drawing_SetTextStyleHalfLeading](#oh_drawing_settextstylehalfleading) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, bool) | Sets whether to enable half leading for a text style.|
698| void [OH_Drawing_SetTextStyleEllipsis](#oh_drawing_settextstyleellipsis) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*) | Sets the ellipsis content for a text style.|
699| void [OH_Drawing_SetTextStyleEllipsisModal](#oh_drawing_settextstyleellipsismodal) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Sets the ellipsis style for a text style.|
700| void [OH_Drawing_SetTypographyTextBreakStrategy](#oh_drawing_settypographytextbreakstrategy) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text break strategy.|
701| void [OH_Drawing_SetTypographyTextWordBreakType](#oh_drawing_settypographytextwordbreaktype) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the word break type.|
702| void [OH_Drawing_SetTypographyTextEllipsisModal](#oh_drawing_settypographytextellipsismodal) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text ellipsis style for a typography style.|
703| void [OH_Drawing_SetTypographyTextEllipsis](#oh_drawing_settypographytextellipsis) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, const char \*ellipsis) | Sets the ellipsis text for a typography style.|
704| double [OH_Drawing_TypographyGetLineHeight](#oh_drawing_typographygetlineheight) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains the line height in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
705| double [OH_Drawing_TypographyGetLineWidth](#oh_drawing_typographygetlinewidth) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains the line width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
706| void [OH_Drawing_SetTypographyTextSplitRatio](#oh_drawing_settypographytextsplitratio) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, float textSplitRatio) | Sets the text split ratio.|
707| bool [OH_Drawing_TypographyIsLineUnlimited](#oh_drawing_typographyislineunlimited) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether the maximum number of lines is limited for text.|
708| bool [OH_Drawing_TypographyIsEllipsized](#oh_drawing_typographyisellipsized) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether an ellipsis is configured for a typography style.|
709| void [OH_Drawing_SetTypographyTextLocale](#oh_drawing_settypographytextlocale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, const char \*locale) | Sets the locale for a typography style.|
710| bool [OH_Drawing_TextStyleGetFontMetrics](#oh_drawing_textstylegetfontmetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Obtains the font metrics of a text style.|
711| void [OH_Drawing_SetTypographyTextStyle](#oh_drawing_settypographytextstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Sets a text style.|
712| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_CreateFontDescriptor](#oh_drawing_createfontdescriptor) (void) | Creates an **OH_Drawing_FontDescriptor** object to describe the detailed information about a system font.|
713| void [OH_Drawing_DestroyFontDescriptor](#oh_drawing_destroyfontdescriptor) ([OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \*) | Destroys an **OH_Drawing_FontDescriptor** object and reclaims the memory occupied by the object.|
714| [OH_Drawing_FontParser](#oh_drawing_fontparser) \* [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser) (void) | Creates an **OH_Drawing_FontParser** object to parse a system font.|
715| void [OH_Drawing_DestroyFontParser](#oh_drawing_destroyfontparser) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*) | Destroys an **OH_Drawing_FontParser** object and reclaims the memory occupied by the object.|
716| char \*\* [OH_Drawing_FontParserGetSystemFontList](#oh_drawing_fontparsergetsystemfontlist) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*, size_t \*) | Obtains the list of system fonts. This function can be used only on 2-in-1 devices and phones.|
717| void [OH_Drawing_DestroySystemFontList](#oh_drawing_destroysystemfontlist) (char \*\*, size_t) | Reclaims the memory occupied by the system font list.|
718| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) \* [OH_Drawing_FontParserGetFontByName](#oh_drawing_fontparsergetfontbyname) ([OH_Drawing_FontParser](#oh_drawing_fontparser) \*, const char \*) | Obtains the descriptor of a system font based on the font name.|
719| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \* [OH_Drawing_TypographyGetLineMetrics](#oh_drawing_typographygetlinemetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the line metrics in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) is no longer required, call [OH_Drawing_DestroyLineMetrics](#oh_drawing_destroylinemetrics) to release the pointer to the object.|
720| size_t [OH_Drawing_LineMetricsGetSize](#oh_drawing_linemetricsgetsize) ([OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the number of lines.|
721| void [OH_Drawing_DestroyLineMetrics](#oh_drawing_destroylinemetrics) ([OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Destroys an **OH_Drawing_LineMetrics** object and reclaims the memory occupied by the object.|
722| bool [OH_Drawing_TypographyGetLineMetricsAt](#oh_drawing_typographygetlinemetricsat) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the metrics of a given line in a typography object. For details, see [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
723| bool [OH_Drawing_TypographyGetLineInfo](#oh_drawing_typographygetlineinfo) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, bool, bool, [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) \*) | Obtains the metrics of a given line or the metrics of the first character in a given line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.|
724| void [OH_Drawing_SetTypographyTextFontWeight](#oh_drawing_settypographytextfontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the default font weight for a typography style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.|
725| void [OH_Drawing_SetTypographyTextFontStyle](#oh_drawing_settypographytextfontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the default font style for a typography style.|
726| void [OH_Drawing_SetTypographyTextFontFamily](#oh_drawing_settypographytextfontfamily) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, const char \*) | Sets the font family name for text.|
727| void [OH_Drawing_SetTypographyTextFontSize](#oh_drawing_settypographytextfontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font size for text.|
728| void [OH_Drawing_SetTypographyTextFontHeight](#oh_drawing_settypographytextfontheight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font height for text.|
729| void [OH_Drawing_SetTypographyTextHalfLeading](#oh_drawing_settypographytexthalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable half leading for text.|
730| void [OH_Drawing_SetTypographyTextUseLineStyle](#oh_drawing_settypographytextuselinestyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable the text line style.|
731| void [OH_Drawing_SetTypographyTextLineStyleFontWeight](#oh_drawing_settypographytextlinestylefontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the text font weight of the strut style in a typography style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.|
732| void [OH_Drawing_SetTypographyTextLineStyleFontStyle](#oh_drawing_settypographytextlinestylefontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int) | Sets the font style of the strut style in a typography style.|
733| void [OH_Drawing_SetTypographyTextLineStyleFontFamilies](#oh_drawing_settypographytextlinestylefontfamilies) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, int, const char \*fontFamilies[]) | Sets the font families for a text line style.|
734| void [OH_Drawing_SetTypographyTextLineStyleFontSize](#oh_drawing_settypographytextlinestylefontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font size for a text line style.|
735| void [OH_Drawing_SetTypographyTextLineStyleFontHeight](#oh_drawing_settypographytextlinestylefontheight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the font height for a text line style.|
736| void [OH_Drawing_SetTypographyTextLineStyleHalfLeading](#oh_drawing_settypographytextlinestylehalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable half leading for the strut style in a typography style.|
737| void [OH_Drawing_SetTypographyTextLineStyleSpacingScale](#oh_drawing_settypographytextlinestylespacingscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, double) | Sets the spacing scale factor for a text line style.|
738| void [OH_Drawing_SetTypographyTextLineStyleOnly](#oh_drawing_settypographytextlinestyleonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, bool) | Sets whether to enable the text line style only.|
739| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow) (void) | Creates an **OH_Drawing_TextShadow** object. When [OH_Drawing_TextShadow](#oh_drawing_textshadow) is no longer required, call [OH_Drawing_DestroyTextShadow](#oh_drawing_destroytextshadow) to release the pointer to the object.|
740| void [OH_Drawing_DestroyTextShadow](#oh_drawing_destroytextshadow) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Destroys an **OH_Drawing_TextShadow** object and reclaims the memory occupied by the object.|
741| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_TextStyleGetShadows](#oh_drawing_textstylegetshadows) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains a text shadow container. When [OH_Drawing_TextShadow](#oh_drawing_textshadow) is no longer required, call [OH_Drawing_DestroyTextShadows](#oh_drawing_destroytextshadows) to release the pointer to the object.|
742| int [OH_Drawing_TextStyleGetShadowCount](#oh_drawing_textstylegetshadowcount) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the size of a text shadow container.|
743| void [OH_Drawing_TextStyleAddShadow](#oh_drawing_textstyleaddshadow) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const [OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Adds a shadow to a text shadow container.|
744| void [OH_Drawing_TextStyleClearShadows](#oh_drawing_textstyleclearshadows) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Clears all shadows in a text shadow container.|
745| [OH_Drawing_TextShadow](#oh_drawing_textshadow) \* [OH_Drawing_TextStyleGetShadowWithIndex](#oh_drawing_textstylegetshadowwithindex) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, int) | Obtains a shadow with a given index in a text shadow container.|
746| void [OH_Drawing_TypographySetIndents](#oh_drawing_typographysetindents) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, const float indents[]) | Sets indents for typography. If this function is not called, texts will have no indentation applied.|
747| float [OH_Drawing_TypographyGetIndentsWithIndex](#oh_drawing_typographygetindentswithindex) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int) | Obtains indents with a given index in a typography object. The line index starts from 0.|
748| [OH_Drawing_Range](#oh_drawing_range) \* [OH_Drawing_TypographyGetLineTextRange](#oh_drawing_typographygetlinetextrange) ([OH_Drawing_Typography](#oh_drawing_typography) \*, int, bool) | Obtains the line bounds in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. This function can only be used to obtain the bounds of existing lines. That is, the line index must start from 0, and the maximum index is [OH_Drawing_TypographyGetLineCount](#oh_drawing_typographygetlinecount) - 1.|
749| void [OH_Drawing_DestroyTextShadows](#oh_drawing_destroytextshadows) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*) | Reclaims the memory occupied by the vector consisting of the **OH_Drawing_TextShadow** objects.|
750| [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) \* [OH_Drawing_GetSystemFontConfigInfo](#oh_drawing_getsystemfontconfiginfo) ([OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode) \*) | Obtains the system font configuration.|
751| void [OH_Drawing_DestroySystemFontConfigInfo](#oh_drawing_destroysystemfontconfiginfo) ([OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) \*) | Reclaims the memory occupied by the system font configuration.|
752| void [OH_Drawing_SetTextStyleFontStyleStruct](#oh_drawing_settextstylefontstylestruct) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*drawingTextStyle, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyle) | Sets the font style, including the font weight, width, and slant, for a text style.|
753| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_TextStyleGetFontStyleStruct](#oh_drawing_textstylegetfontstylestruct) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*drawingTextStyle) | Obtains the font style, including the font weight, width, and slant, of a text style.|
754| void [OH_Drawing_SetTypographyStyleFontStyleStruct](#oh_drawing_settypographystylefontstylestruct) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*drawingStyle, [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) fontStyle) | Sets the font style, including the font weight, width, and slant, for the default text style of a typography style.|
755| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) [OH_Drawing_TypographyStyleGetFontStyleStruct](#oh_drawing_typographystylegetfontstylestruct) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*drawingStyle) | Obtains the font style, including the font weight, width, and slant, of the default text style of a typography style.|
756| void [OH_Drawing_TextStyleSetBackgroundRect](#oh_drawing_textstylesetbackgroundrect) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) \*, int styleId) | Sets a background rectangle and style ID for a text style. The style ID is valid only when the background box is a rounded rectangle.|
757| void [OH_Drawing_TypographyHandlerAddSymbol](#oh_drawing_typographyhandleraddsymbol) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*, uint32_t symbol) | Adds the symbol to use in the typography creation process.|
758| void [OH_Drawing_TextStyleAddFontFeature](#oh_drawing_textstyleaddfontfeature) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*tag, int value) | Adds a font feature for a text style.|
759| void [OH_Drawing_TextStyleAddFontVariation](#oh_drawing_textstyleaddfontvariation) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, const char \*, const float) | Adds a font variation. This function takes effect only when the corresponding font file (.ttf file) supports variable adjustment. Otherwise, calling this function does not take effect.|
760| [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) \* [OH_Drawing_TextStyleGetFontFeatures](#oh_drawing_textstylegetfontfeatures) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains all the contents in a font feature map container of a text style.|
761| void [OH_Drawing_TextStyleDestroyFontFeatures](#oh_drawing_textstyledestroyfontfeatures) ([OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) \*, size_t fontFeatureSize) | Reclaims the memory occupied by the struct array that holds all the font features.|
762| size_t [OH_Drawing_TextStyleGetFontFeatureSize](#oh_drawing_textstylegetfontfeaturesize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the size of a font feature map container in a text style.|
763| void [OH_Drawing_TextStyleClearFontFeature](#oh_drawing_textstyleclearfontfeature) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Clears all the contents in a font feature map container of a text style.|
764| double [OH_Drawing_TextStyleGetBaselineShift](#oh_drawing_textstylegetbaselineshift) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the baseline drift of a text style.|
765| void [OH_Drawing_TextStyleSetBaselineShift](#oh_drawing_textstylesetbaselineshift) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, double lineShift) | Sets a baseline drift for a text style.|
766| void [OH_Drawing_TypographyTextSetHeightBehavior](#oh_drawing_typographytextsetheightbehavior) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) heightMode) | Sets a text height modifier pattern.|
767| [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) [OH_Drawing_TypographyTextGetHeightBehavior](#oh_drawing_typographytextgetheightbehavior) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text height modifier pattern.|
768| [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \* [OH_Drawing_TypographyGetLineFontMetrics](#oh_drawing_typographygetlinefontmetrics) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t lineNumber, size_t \*fontMetricsSize) | Obtains all font metrics from a given line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. Otherwise, a null pointer is returned. When [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) is no longer required, call [OH_Drawing_TypographyDestroyLineFontMetrics](#oh_drawing_typographydestroylinefontmetrics) to release the pointer to the object.|
769| void [OH_Drawing_TypographyDestroyLineFontMetrics](#oh_drawing_typographydestroylinefontmetrics) ([OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) \*) | Reclaims the memory occupied by the struct array that holds all the font metrics of a given line.|
770| bool [OH_Drawing_TextStyleIsEqual](#oh_drawing_textstyleisequal) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle) | Checks whether two text styles are equal. The word width property is not involved in the comparison.|
771| bool [OH_Drawing_TextStyleIsEqualByFont](#oh_drawing_textstyleisequalbyfont) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle) | Checks whether the font style properties of two text styles are equal.|
772| bool [OH_Drawing_TextStyleIsAttributeMatched](#oh_drawing_textstyleisattributematched) (const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style, const [OH_Drawing_TextStyle](#oh_drawing_textstyle) \*comparedStyle, [OH_Drawing_TextStyleType](#oh_drawing_textstyletype) textStyleType) | Checks whether two text styles have the same text style type.|
773| void [OH_Drawing_TextStyleSetPlaceholder](#oh_drawing_textstylesetplaceholder) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style) | Sets a placeholder for a text style.|
774| bool [OH_Drawing_TextStyleIsPlaceholder](#oh_drawing_textstyleisplaceholder) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*style) | Checks whether a placeholder is set for a text style.|
775| [OH_Drawing_TextAlign](#oh_drawing_textalign) [OH_Drawing_TypographyStyleGetEffectiveAlignment](#oh_drawing_typographystylegeteffectivealignment) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Obtains the text alignment mode.|
776| bool [OH_Drawing_TypographyStyleIsHintEnabled](#oh_drawing_typographystyleishintenabled) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style) | Checks whether font hinting is enabled for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.|
777| void [OH_Drawing_SetTypographyStyleTextStrutStyle](#oh_drawing_settypographystyletextstrutstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*) | Sets the strut style for a typography style.|
778| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \* [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the strut style of a typography style.|
779| void [OH_Drawing_TypographyStyleDestroyStrutStyle](#oh_drawing_typographystyledestroystrutstyle) ([OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*) | Reclaims the memory occupied by a strut style.|
780| bool [OH_Drawing_TypographyStyleStrutStyleEquals](#oh_drawing_typographystylestrutstyleequals) ([OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*from, [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) \*to) | Checks whether two strut styles are equal.|
781| void [OH_Drawing_TypographyStyleSetHintsEnabled](#oh_drawing_typographystylesethintsenabled) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*style, bool hintsEnabled) | Sets whether to enable font hinting for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.|
782| void [OH_Drawing_TypographyMarkDirty](#oh_drawing_typographymarkdirty) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Marks a typography object as dirty data. This function is used to initialize the typography state.|
783| int32_t [OH_Drawing_TypographyGetUnresolvedGlyphsCount](#oh_drawing_typographygetunresolvedglyphscount) ([OH_Drawing_Typography](#oh_drawing_typography) \*) | Obtains the number of unresolved glyphs in a typography object. This function can be called only after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called and applied.|
784| void [OH_Drawing_TypographyUpdateFontSize](#oh_drawing_typographyupdatefontsize) ([OH_Drawing_Typography](#oh_drawing_typography) \*, size_t from, size_t to, float fontSize) | Updates the font size in a typography object.|
785| bool [OH_Drawing_TypographyTextGetLineStyle](#oh_drawing_typographytextgetlinestyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether the text line style is enabled for a typography style.|
786| [OH_Drawing_FontWeight](#oh_drawing_fontweight) [OH_Drawing_TypographyTextlineStyleGetFontWeight](#oh_drawing_typographytextlinestylegetfontweight) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font weight of the strut style in a typography style.|
787| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) [OH_Drawing_TypographyTextlineStyleGetFontStyle](#oh_drawing_typographytextlinestylegetfontstyle) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font style of the strut style in a typography style.|
788| char \*\* [OH_Drawing_TypographyTextlineStyleGetFontFamilies](#oh_drawing_typographytextlinestylegetfontfamilies) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, size_t \*num) | Obtains the font families of the strut style in a typography style.|
789| void [OH_Drawing_TypographyTextlineStyleDestroyFontFamilies](#oh_drawing_typographytextlinestyledestroyfontfamilies) (char \*\*fontFamilies, size_t fontFamiliesNum) | Reclaims the memory occupied by the font families.|
790| double [OH_Drawing_TypographyTextlineStyleGetFontSize](#oh_drawing_typographytextlinestylegetfontsize) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the font size of a text line style.|
791| double [OH_Drawing_TypographyTextlineStyleGetHeightScale](#oh_drawing_typographytextlinestylegetheightscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the height scale factor of a text line style.|
792| bool [OH_Drawing_TypographyTextlineStyleGetHeightOnly](#oh_drawing_typographytextlinestylegetheightonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether only the font height is used for a text line style.|
793| bool [OH_Drawing_TypographyTextlineStyleGetHalfLeading](#oh_drawing_typographytextlinestylegethalfleading) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether half leading is enabled for a text line style.|
794| double [OH_Drawing_TypographyTextlineStyleGetSpacingScale](#oh_drawing_typographytextlinestylegetspacingscale) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the spacing scale factor of a text line style.|
795| bool [OH_Drawing_TypographyTextlineGetStyleOnly](#oh_drawing_typographytextlinegetstyleonly) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Checks whether only the text line style is enabled for a typography style.|
796| [OH_Drawing_TextAlign](#oh_drawing_textalign) [OH_Drawing_TypographyGetTextAlign](#oh_drawing_typographygettextalign) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text alignment mode.|
797| [OH_Drawing_TextDirection](#oh_drawing_textdirection) [OH_Drawing_TypographyGetTextDirection](#oh_drawing_typographygettextdirection) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text direction of a typography style.|
798| size_t [OH_Drawing_TypographyGetTextMaxLines](#oh_drawing_typographygettextmaxlines) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the maximum number of lines.|
799| char \* [OH_Drawing_TypographyGetTextEllipsis](#oh_drawing_typographygettextellipsis) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*) | Obtains the text ellipsis content of a typography style.|
800| void [OH_Drawing_TypographyDestroyEllipsis](#oh_drawing_typographydestroyellipsis) (char \*ellipsis) | Reclaims the memory occupied by the text ellipsis names.|
801| bool [OH_Drawing_TypographyStyleEquals](#oh_drawing_typographystyleequals) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*from, [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*to) | Checks whether two typography styles are the same. The text height modifier mode [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) is not involved in the comparison.|
802| uint32_t [OH_Drawing_TextStyleGetColor](#oh_drawing_textstylegetcolor) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the color of a text style.|
803| [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle) [OH_Drawing_TextStyleGetDecorationStyle](#oh_drawing_textstylegetdecorationstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the decoration style of a text style.|
804| [OH_Drawing_FontWeight](#oh_drawing_fontweight) [OH_Drawing_TextStyleGetFontWeight](#oh_drawing_textstylegetfontweight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font weight of a text style.|
805| [OH_Drawing_FontStyle](#oh_drawing_fontstyle) [OH_Drawing_TextStyleGetFontStyle](#oh_drawing_textstylegetfontstyle) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font style of a text style.|
806| [OH_Drawing_TextBaseline](#oh_drawing_textbaseline) [OH_Drawing_TextStyleGetBaseline](#oh_drawing_textstylegetbaseline) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the baseline of a text style.|
807| char \*\* [OH_Drawing_TextStyleGetFontFamilies](#oh_drawing_textstylegetfontfamilies) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*, size_t \*num) | Obtains the font families of a text style.|
808| void [OH_Drawing_TextStyleDestroyFontFamilies](#oh_drawing_textstyledestroyfontfamilies) (char \*\*fontFamilies, size_t num) | Reclaims the memory occupied by the font families, where **num** specifies the number of font families.|
809| double [OH_Drawing_TextStyleGetFontSize](#oh_drawing_textstylegetfontsize) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font size of a text style.|
810| double [OH_Drawing_TextStyleGetLetterSpacing](#oh_drawing_textstylegetletterspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the letter spacing of a text style.|
811| double [OH_Drawing_TextStyleGetWordSpacing](#oh_drawing_textstylegetwordspacing) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the word spacing of a text style.|
812| double [OH_Drawing_TextStyleGetFontHeight](#oh_drawing_textstylegetfontheight) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the font height of a text style.|
813| bool [OH_Drawing_TextStyleGetHalfLeading](#oh_drawing_textstylegethalfleading) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Checks whether half leading is enabled for a text style.|
814| const char \* [OH_Drawing_TextStyleGetLocale](#oh_drawing_textstylegetlocale) ([OH_Drawing_TextStyle](#oh_drawing_textstyle) \*) | Obtains the locale of a text style.|
815| void [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) ([OH_Drawing_TextBox](#oh_drawing_textbox) \*) | Releases the memory occupied by a text box.|
816| void [OH_Drawing_SetTextShadow](#oh_drawing_settextshadow) ([OH_Drawing_TextShadow](#oh_drawing_textshadow) \*shadow, uint32_t color, [OH_Drawing_Point](#oh_drawing_point) \*offset, double blurRadius) | Sets a text shadow.|
817| [OH_Drawing_LineTypography](#oh_drawing_linetypography) \* [OH_Drawing_CreateLineTypography](#oh_drawing_createlinetypography) ([OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) \*handler) | Creates a pointer to an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object, which stores the text content and style and can be used to compute typography details for individual lines of text.|
818| void [OH_Drawing_DestroyLineTypography](#oh_drawing_destroylinetypography) ([OH_Drawing_LineTypography](#oh_drawing_linetypography) \*lineTypography) | Releases the memory occupied by an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object.|
819| size_t [OH_Drawing_LineTypographyGetLineBreak](#oh_drawing_linetypographygetlinebreak) ([OH_Drawing_LineTypography](#oh_drawing_linetypography) \*lineTypography, size_t startIndex, double width) | Obtains the number of characters that can fit in the layout from the specified position within a limited layout width.|
820| OH_Drawing_TextLine \* [OH_Drawing_LineTypographyCreateLine](#oh_drawing_linetypographycreateline) ([OH_Drawing_LineTypography](#oh_drawing_linetypography) \*lineTypography, size_t startIndex, size_t count) | Creates a pointer to an **OH_Drawing_TextLine** object based on the text content in a specified range.|
821| [OH_Drawing_TextTab](#oh_drawing_texttab) \* [OH_Drawing_CreateTextTab](#oh_drawing_createtexttab) ([OH_Drawing_TextAlign](#oh_drawing_textalign) alignment, float location) | Creates a text tab object.|
822| void [OH_Drawing_DestroyTextTab](#oh_drawing_destroytexttab) ([OH_Drawing_TextTab](#oh_drawing_texttab) \*) | Releases the memory occupied by a text tab object.|
823| [OH_Drawing_TextAlign](#oh_drawing_textalign) [OH_Drawing_GetTextTabAlignment](#oh_drawing_gettexttabalignment) ([OH_Drawing_TextTab](#oh_drawing_texttab) \*) | Obtains the alignment mode of a text tab.|
824| float [OH_Drawing_GetTextTabLocation](#oh_drawing_gettexttablocation) ([OH_Drawing_TextTab](#oh_drawing_texttab) \*) | Obtains the location of a text tab.|
825| void [OH_Drawing_SetTypographyTextTab](#oh_drawing_settypographytexttab) ([OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) \*, [OH_Drawing_TextTab](#oh_drawing_texttab) \*TextTab) | Sets the alignment mode and location of a text tab. When the text alignment mode or ellipsis style is set, the tab does not take effect. When the tab location is less than 1.0, the tab is replaced with a space.|
826| size_t [OH_Drawing_GetDrawingArraySize](#oh_drawing_getdrawingarraysize) ([OH_Drawing_Array](#oh_drawing_array) \*drawingArray) | Obtains the number of objects in an [OH_Drawing_Array](#oh_drawing_array).|
827| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateDefault](#oh_drawing_typefacecreatedefault) (void) | Creates a default **OH_Drawing_Typeface** object.|
828| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile) (const char \*path, int index) | Creates an **OH_Drawing_Typeface** object through a file.|
829| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromFileWithArguments](#oh_drawing_typefacecreatefromfilewitharguments) (const char \*path, const [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Creates an **OH_Drawing_Typeface** object with font arguments through a file. If the **OH_Drawing_Typeface** object does not support the variation described in the font arguments, this function creates an **OH_Drawing_Typeface** object with the default font arguments. In this case, this function provides the same capability as [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile).|
830| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromCurrent](#oh_drawing_typefacecreatefromcurrent) (const [OH_Drawing_Typeface](#oh_drawing_typeface) \*current, const [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Creates an **OH_Drawing_Typeface** object with font arguments based on an existing **OH_Drawing_Typeface** object.|
831| [OH_Drawing_Typeface](#oh_drawing_typeface) \* [OH_Drawing_TypefaceCreateFromStream](#oh_drawing_typefacecreatefromstream) ([OH_Drawing_MemoryStream](#oh_drawing_memorystream) \*, int32_t index) | Creates an **OH_Drawing_Typeface** object through a memory stream. If the memory stream is an invalid font file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot release it.|
832| void [OH_Drawing_TypefaceDestroy](#oh_drawing_typefacedestroy) ([OH_Drawing_Typeface](#oh_drawing_typeface) \*) | Destroys an **OH_Drawing_Typeface** object and reclaims the memory occupied by the object.|
833| [OH_Drawing_FontArguments](#oh_drawing_fontarguments) \* [OH_Drawing_FontArgumentsCreate](#oh_drawing_fontargumentscreate) (void) | Creates an **OH_Drawing_FontArguments** object. The font arguments are used to create an **OH_Drawing_Typeface** object with custom attributes.|
834| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontArgumentsAddVariation](#oh_drawing_fontargumentsaddvariation) ([OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments, const char \*axis, float value) | Adds a variation to an **OH_Drawing_FontArguments** object.|
835| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_FontArgumentsDestroy](#oh_drawing_fontargumentsdestroy) ([OH_Drawing_FontArguments](#oh_drawing_fontarguments) \*fontArguments) | Destroys an **OH_Drawing_FontArguments** object.|
836| enum&nbsp;&nbsp;[OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) { SHADOW_FLAGS_NONE, SHADOW_FLAGS_TRANSPARENT_OCCLUDER, SHADOW_FLAGS_GEOMETRIC_ONLY, SHADOW_FLAGS_ALL } | Defines an enum for the shadow flags.|
837| typedef enum [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) | Defines an enum for the shadow flags.|
838| void [OH_Drawing_CanvasClipRect](#oh_drawing_canvascliprect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Rect](#oh_drawing_rect) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a rectangle.|
839| void [OH_Drawing_CanvasClipRoundRect](#oh_drawing_canvascliproundrect) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_RoundRect](#oh_drawing_roundrect) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a rounded rectangle.|
840| void [OH_Drawing_CanvasClipPath](#oh_drawing_canvasclippath) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, const [OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp, bool doAntiAlias) | Clips a path.|
841| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasClipRegion](#oh_drawing_canvasclipregion) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, const [OH_Drawing_Region](#oh_drawing_region) \*region, [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop) clipOp) | Clips a rectangle.|
842| void [OH_Drawing_CanvasRotate](#oh_drawing_canvasrotate) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float degrees, float px, float py) | Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value indicates a counterclockwise rotation.|
843| void [OH_Drawing_CanvasTranslate](#oh_drawing_canvastranslate) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float dx, float dy) | Translates a canvas by a given distance.|
844| void [OH_Drawing_CanvasScale](#oh_drawing_canvasscale) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float sx, float sy) | Scales a canvas.|
845| void [OH_Drawing_CanvasSkew](#oh_drawing_canvasskew) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, float sx, float sy) | Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and applies the resulting matrix to the canvas. The skew transformation matrix is as follows: \|1 sx 0\| \|sy 1 0\| \|0 0 1\| |
846| void [OH_Drawing_CanvasClear](#oh_drawing_canvasclear) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, uint32_t color) | Clears a canvas by using a given color.|
847| int32_t [OH_Drawing_CanvasGetWidth](#oh_drawing_canvasgetwidth) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the canvas width.|
848| int32_t [OH_Drawing_CanvasGetHeight](#oh_drawing_canvasgetheight) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*) | Obtains the canvas height.|
849| void [OH_Drawing_CanvasGetLocalClipBounds](#oh_drawing_canvasgetlocalclipbounds) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Rect](#oh_drawing_rect) \*) | Obtains the bounds of the cropping region of a canvas. This function cannot be used for recorded canvases.|
850| void [OH_Drawing_CanvasGetTotalMatrix](#oh_drawing_canvasgettotalmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Obtains the 3x3 matrix of a canvas.|
851| void [OH_Drawing_CanvasConcatMatrix](#oh_drawing_canvasconcatmatrix) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Matrix](#oh_drawing_matrix) \*) | Preconcats the existing matrix with the passed-in matrix. The drawing operation triggered before this function is called is not affected.|
852| void [OH_Drawing_CanvasDrawShadow](#oh_drawing_canvasdrawshadow) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*, [OH_Drawing_Path](#oh_drawing_path) \*, [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) planeParams, [OH_Drawing_Point3D](_o_h___drawing___point3_d.md) devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags) flag) | Draws a spot shadow and uses a given path to outline the ambient shadow.|
853| [OH_Drawing_ErrorCode](#oh_drawing_errorcode) [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd) ([OH_Drawing_Canvas](#oh_drawing_canvas) \*canvas, [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) \*recordCmd) | Draws a recording command object.|
854
855## Type Description
856
857### OH_Drawing_PathDashStyle
858
859```
860typedef enum OH_Drawing_PathDashStyle OH_Drawing_PathDashStyle
861```
862
863**Description**
864
865Defines an enum for the drawing styles for path effects.
866
867**Since**: 18
868
869### OH_Drawing_Array
870
871```
872typedef struct OH_Drawing_Array OH_Drawing_Array
873```
874
875**Description**
876
877Defines a struct for an array object, which is used to store multiple objects of the same type.
878
879**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
880
881**Since**: 14
882
883### OH_Drawing_LineTypography
884
885```
886typedef struct OH_Drawing_LineTypography OH_Drawing_LineTypography
887```
888
889**Description**
890
891Defines a struct used to extract a single line of data from a piece of text for typography.
892
893**Since**: 18
894
895### OH_Drawing_TextTab
896
897```
898typedef struct OH_Drawing_TextTab OH_Drawing_TextTab
899```
900
901**Description**
902
903Defines a struct used to manage text tabs.
904
905**Since**: 18
906
907### OH_Drawing_TextLine
908
909```
910typedef struct OH_Drawing_TextLine OH_Drawing_TextLine
911```
912
913**Description**
914
915Defines a struct used to manage text lines.
916
917**Since**: 18
918
919### OH_Drawing_Run
920
921```
922typedef struct OH_Drawing_RunOH_Drawing_Run
923```
924
925**Description**
926
927Defines a struct used to manage runs.
928
929**Since**: 18
930
931### Drawing_CaretOffsetsCallback
932
933```
934typedef bool(* Drawing_CaretOffsetsCallback) (double offset, int32_t index, bool leadingEdge)
935```
936
937**Description**
938
939Defines a custom callback used to receive the offset and index of each character in a text line object as its parameters.
940
941**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
942
943**Since**: 18
944
945**Parameters**
946
947| Name| Description|
948| -------- | -------- |
949| offset | Offset of each character in the text line object.|
950| index | Index of each character in the text line object.|
951| leadingEdge | Whether the cursor is located at the front of the character. The value **true** means that the cursor is located at the front of the character, that is, the offset does not contain the character width. The value **false** means that the cursor is located at the rear of the character, that is, the offset contains the character width.|
952
953**Returns**
954
955Returns the result indicating whether to stop calling the callback. The value **true** means to stop calling the callback, and **false** means to continue calling the callback.
956
957### OH_Drawing_String
958
959```
960typedef struct OH_Drawing_String OH_Drawing_String
961```
962
963**Description**
964
965Defines a struct for a string of characters encoded in UTF-16.
966
967**Since**: 14
968
969
970### OH_Drawing_SystemFontType
971
972```
973typedef enum OH_Drawing_SystemFontType OH_Drawing_SystemFontType
974```
975
976**Description**
977
978Defines an enum for the system font types.
979
980**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
981
982**Since**: 14
983
984
985### OH_Drawing_FontArguments
986
987```
988typedef struct OH_Drawing_FontArguments OH_Drawing_FontArguments
989```
990
991**Description**
992
993Defines a struct for font arguments.
994
995**Since**: 13
996
997### OH_Drawing_RecordCmd
998
999```
1000typedef struct OH_Drawing_RecordCmd OH_Drawing_RecordCmd
1001```
1002
1003**Description**
1004
1005Defines the recording command class, which is used to store the set of recording commands.
1006
1007**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
1008
1009**Since**: 13
1010
1011
1012### OH_Drawing_RecordCmdUtils
1013
1014```
1015typedef struct OH_Drawing_RecordCmdUtils OH_Drawing_RecordCmdUtils
1016```
1017
1018**Description**
1019
1020Defines the recording command tool, which is used to generate recording commands.
1021
1022**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
1023
1024**Since**: 13
1025
1026
1027### OH_Drawing_ErrorCode
1028
1029```
1030typedef enum OH_Drawing_ErrorCode OH_Drawing_ErrorCode
1031```
1032
1033
1034**Description**
1035
1036Defines an enum for the error codes that may be generated by the module.
1037
1038**Since**: 12
1039
1040
1041### OH_Drawing_PathOpMode
1042
1043```
1044typedef enum OH_Drawing_PathOpMode OH_Drawing_PathOpMode
1045```
1046
1047**Description**
1048
1049Defines an enum for the operation modes available for a path.
1050
1051**Since**: 12
1052
1053
1054### OH_Drawing_PathMeasureMatrixFlags
1055
1056```
1057typedef enum OH_Drawing_PathMeasureMatrixFlags OH_Drawing_PathMeasureMatrixFlags
1058```
1059
1060**Description**
1061
1062Defines an enum for the types of matrix information obtained during path measurement.
1063
1064**Since**: 12
1065
1066
1067### OH_Drawing_RegionOpMode
1068
1069```
1070typedef enum OH_Drawing_RegionOpMode OH_Drawing_RegionOpMode
1071```
1072
1073**Description**
1074
1075Defines an enum for the operation modes available for a region.
1076
1077**Since**: 12
1078
1079
1080### OH_Drawing_ImageFilter
1081
1082```
1083typedef struct OH_Drawing_ImageFilter OH_Drawing_ImageFilter
1084```
1085
1086**Description**
1087
1088Defines a struct for an image filter, which is used to operate all color bits that make up image pixels.
1089
1090**Since**: 12
1091
1092
1093### OH_Drawing_Filter
1094
1095```
1096typedef struct OH_Drawing_Filter OH_Drawing_Filter
1097```
1098
1099**Description**
1100
1101Defines a struct for a filter, which consists of a color filter, mask filter, and image filter.
1102
1103**Since**: 11
1104
1105### OH_Drawing_AlphaFormat
1106
1107```
1108typedef enum OH_Drawing_AlphaFormat OH_Drawing_AlphaFormat
1109```
1110
1111**Description**
1112
1113Defines an enum for the alpha formats of bitmap pixels.
1114
1115**Since**: 8
1116
1117
1118### OH_Drawing_Bitmap
1119
1120```
1121typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap
1122```
1123
1124**Description**
1125
1126Defines a struct for a bitmap, which is a memory area that contains the pixel data of a shape.
1127
1128**Since**: 8
1129
1130
1131### OH_Drawing_BitmapFormat
1132
1133```
1134typedef struct OH_Drawing_BitmapFormat OH_Drawing_BitmapFormat
1135```
1136
1137**Description**
1138
1139Defines a struct for the pixel format of a bitmap, including the color type and alpha type.
1140
1141**Since**: 8
1142
1143
1144### OH_Drawing_BlendMode
1145
1146```
1147typedef enum OH_Drawing_BlendMode OH_Drawing_BlendMode
1148```
1149
1150**Description**
1151
1152Defines an enum for the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule). The operations for the alpha channel are used as examples.
1153
1154For brevity, the following abbreviations are used:
1155
1156**s**: source.
1157
1158**d**: destination.
1159
1160**sa**: source alpha.
1161
1162**da**: destination alpha.
1163
1164The following abbreviations are used in the calculation result:
1165
1166**r**: The calculation methods of the four channels are the same.
1167
1168**ra**: Only the alpha channel is manipulated.
1169
1170**rc**: The other three color channels are manipulated.
1171
1172**Since**: 11
1173
1174
1175### OH_Drawing_BlurType
1176
1177```
1178typedef enum OH_Drawing_BlurType OH_Drawing_BlurType
1179```
1180
1181**Description**
1182
1183Defines an enum for the blur types.
1184
1185**Since**: 11
1186
1187
1188### OH_Drawing_BreakStrategy
1189
1190```
1191typedef enum OH_Drawing_BreakStrategy OH_Drawing_BreakStrategy
1192```
1193
1194**Description**
1195
1196Defines an enum for the text break strategies.
1197
1198**Since**: 11
1199
1200
1201### OH_Drawing_Brush
1202
1203```
1204typedef struct OH_Drawing_Brush OH_Drawing_Brush
1205```
1206
1207**Description**
1208
1209Defines a struct for a brush, which is used to describe the style and color to fill in a shape.
1210
1211**Since**: 8
1212
1213
1214### OH_Drawing_Canvas
1215
1216```
1217typedef struct OH_Drawing_Canvas OH_Drawing_Canvas
1218```
1219
1220**Description**
1221
1222Defines a struct for a rectangular canvas, on which various shapes, images, and texts can be drawn by using the brush and pen.
1223
1224**Since**: 8
1225
1226
1227### OH_Drawing_CanvasClipOp
1228
1229```
1230typedef enum OH_Drawing_CanvasClipOp OH_Drawing_CanvasClipOp
1231```
1232
1233**Description**
1234
1235Defines an enum for the canvas clipping modes.
1236
1237**Since**: 11
1238
1239
1240### OH_Drawing_CanvasShadowFlags
1241
1242```
1243typedef enum OH_Drawing_CanvasShadowFlags OH_Drawing_CanvasShadowFlags
1244```
1245
1246**Description**
1247
1248Defines an enum for the shadow flags.
1249
1250**Since**: 12
1251
1252
1253### OH_Drawing_ColorFilter
1254
1255```
1256typedef struct OH_Drawing_ColorFilter OH_Drawing_ColorFilter
1257```
1258
1259**Description**
1260
1261Defines a struct for a color filter, which is used to convert a color into a new one.
1262
1263**Since**: 11
1264
1265
1266### OH_Drawing_ColorFormat
1267
1268```
1269typedef enum OH_Drawing_ColorFormat OH_Drawing_ColorFormat
1270```
1271
1272**Description**
1273
1274Defines an enum for the storage formats of bitmap pixels.
1275
1276**Since**: 8
1277
1278
1279### OH_Drawing_ColorSpace
1280
1281```
1282typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace
1283```
1284
1285**Description**
1286
1287Defines a struct for a color space, which is used to describe the color information.
1288
1289**Since**: 12
1290
1291
1292### OH_Drawing_Corner_Radii
1293
1294```
1295typedef OH_Drawing_Point2D OH_Drawing_Corner_Radii
1296```
1297
1298**Description**
1299
1300Defines a struct for the radii of a rounded corner. The radii consist of the radius in the x-axis direction and that in the y-axis direction.
1301
1302**Since**: 12
1303
1304
1305### OH_Drawing_CornerPos
1306
1307```
1308typedef enum OH_Drawing_CornerPos OH_Drawing_CornerPos
1309```
1310
1311**Description**
1312
1313Defines an enum for the corner positions of a rounded rectangle.
1314
1315**Since**: 12
1316
1317
1318### OH_Drawing_EllipsisModal
1319
1320```
1321typedef enum OH_Drawing_EllipsisModal OH_Drawing_EllipsisModal
1322```
1323
1324**Description**
1325
1326Defines an enum for the ellipsis styles.
1327
1328**Since**: 11
1329
1330
1331### OH_Drawing_FilterMode
1332
1333```
1334typedef enum OH_Drawing_FilterMode OH_Drawing_FilterMode
1335```
1336
1337**Description**
1338
1339Defines an enum for the filter modes.
1340
1341**Since**: 12
1342
1343
1344### OH_Drawing_Font
1345
1346```
1347typedef struct OH_Drawing_Font OH_Drawing_Font
1348```
1349
1350**Description**
1351
1352Defines a struct for a font.
1353
1354**Since**: 11
1355
1356
1357### OH_Drawing_Font_Metrics
1358
1359```
1360typedef struct OH_Drawing_Font_Metrics OH_Drawing_Font_Metrics
1361```
1362
1363**Description**
1364
1365Defines a struct for the measurement information about a font.
1366
1367**Since**: 12
1368
1369
1370### OH_Drawing_FontAdjustInfo
1371
1372```
1373typedef struct OH_Drawing_FontAdjustInfo OH_Drawing_FontAdjustInfo
1374```
1375
1376**Description**
1377
1378Defines a struct for the information about a font weight mapping.
1379
1380**Since**: 12
1381
1382
1383### OH_Drawing_FontAliasInfo
1384
1385```
1386typedef struct OH_Drawing_FontAliasInfo OH_Drawing_FontAliasInfo
1387```
1388
1389**Description**
1390
1391Defines a struct for the information about a font alias.
1392
1393**Since**: 12
1394
1395
1396### OH_Drawing_FontCollection
1397
1398```
1399typedef struct OH_Drawing_FontCollection OH_Drawing_FontCollection
1400```
1401
1402**Description**
1403
1404Defines a struct used to load fonts.
1405
1406**Since**: 8
1407
1408
1409### OH_Drawing_FontConfigInfo
1410
1411```
1412typedef struct OH_Drawing_FontConfigInfo OH_Drawing_FontConfigInfo
1413```
1414
1415**Description**
1416
1417Defines a struct for the information about a system font configuration.
1418
1419**Since**: 12
1420
1421
1422### OH_Drawing_FontDescriptor
1423
1424```
1425typedef struct OH_Drawing_FontDescriptor OH_Drawing_FontDescriptor
1426```
1427
1428**Description**
1429
1430Defines a struct for the detailed information about a system font.
1431
1432**Since**: 12
1433
1434
1435### OH_Drawing_FontEdging
1436
1437```
1438typedef enum OH_Drawing_FontEdging OH_Drawing_FontEdging
1439```
1440
1441**Description**
1442
1443Defines an enum for the font edging types.
1444
1445**Since**: 12
1446
1447
1448### OH_Drawing_FontFallbackGroup
1449
1450```
1451typedef struct OH_Drawing_FontFallbackGroup OH_Drawing_FontFallbackGroup
1452```
1453
1454**Description**
1455
1456Defines a struct for the information about a font fallback group.
1457
1458**Since**: 12
1459
1460
1461### OH_Drawing_FontFallbackInfo
1462
1463```
1464typedef struct OH_Drawing_FontFallbackInfo OH_Drawing_FontFallbackInfo
1465```
1466
1467**Description**
1468
1469Defines a struct for the information about a font fallback.
1470
1471**Since**: 12
1472
1473
1474### OH_Drawing_FontGenericInfo
1475
1476```
1477typedef struct OH_Drawing_FontGenericInfo OH_Drawing_FontGenericInfo
1478```
1479
1480**Description**
1481
1482Defines a struct for the information about generic fonts supported by the system.
1483
1484**Since**: 12
1485
1486
1487### OH_Drawing_FontHinting
1488
1489```
1490typedef enum OH_Drawing_FontHinting OH_Drawing_FontHinting
1491```
1492
1493**Description**
1494
1495Defines an enum for the font hinting types.
1496
1497**Since**: 12
1498
1499
1500### OH_Drawing_FontMgr
1501
1502```
1503typedef struct OH_Drawing_FontMgr OH_Drawing_FontMgr
1504```
1505
1506**Description**
1507
1508Defines a struct for the font manager, which is used for font management.
1509
1510**Since**: 12
1511
1512
1513### OH_Drawing_FontParser
1514
1515```
1516typedef struct OH_Drawing_FontParser OH_Drawing_FontParser
1517```
1518
1519**Description**
1520
1521Defines a struct used to parse system font files.
1522
1523**Since**: 12
1524
1525
1526### OH_Drawing_FontStyleSet
1527
1528```
1529typedef struct OH_Drawing_FontStyleSet OH_Drawing_FontStyleSet
1530```
1531
1532**Description**
1533
1534Defines a struct for a font style set, which is used for font style family matching.
1535
1536**Since**: 12
1537
1538
1539### OH_Drawing_FontStyleStruct
1540
1541```
1542typedef struct OH_Drawing_FontStyleStruct OH_Drawing_FontStyleStruct
1543```
1544
1545**Description**
1546
1547Defines a struct for a font style.
1548
1549**Since**: 12
1550
1551
1552### OH_Drawing_GpuContext
1553
1554```
1555typedef struct OH_Drawing_GpuContext OH_Drawing_GpuContext
1556```
1557
1558**Description**
1559
1560Defines a struct for the GPU context, which is used to describe the GPU backend context.
1561
1562**Since**: 12
1563
1564
1565### OH_Drawing_GpuContextOptions
1566
1567```
1568typedef struct OH_Drawing_GpuContextOptions OH_Drawing_GpuContextOptions
1569```
1570
1571**Description**
1572
1573Defines a struct for the options about the GPU context.
1574
1575**Since**: 12
1576
1577
1578### OH_Drawing_Image
1579
1580```
1581typedef struct OH_Drawing_Image OH_Drawing_Image
1582```
1583
1584**Description**
1585
1586Defines a struct for an image that describes a two-dimensional pixel array.
1587
1588**Since**: 12
1589
1590
1591### OH_Drawing_Image_Info
1592
1593```
1594typedef struct OH_Drawing_Image_Info OH_Drawing_Image_Info
1595```
1596
1597**Description**
1598
1599Defines a struct for the image information.
1600
1601**Since**: 12
1602
1603
1604### OH_Drawing_LineMetrics
1605
1606```
1607typedef struct OH_Drawing_LineMetrics OH_Drawing_LineMetrics
1608```
1609
1610**Description**
1611
1612Defines a struct for the measurement information about a line of text.
1613
1614**Since**: 12
1615
1616
1617### OH_Drawing_MaskFilter
1618
1619```
1620typedef struct OH_Drawing_MaskFilter OH_Drawing_MaskFilter
1621```
1622
1623**Description**
1624
1625Defines a struct for a mask filter.
1626
1627**Since**: 11
1628
1629
1630### OH_Drawing_Matrix
1631
1632```
1633typedef struct OH_Drawing_Matrix OH_Drawing_Matrix
1634```
1635
1636**Description**
1637
1638Defines a struct for a matrix, which is used to describe coordinate transformation.
1639
1640**Since**: 11
1641
1642
1643### OH_Drawing_MemoryStream
1644
1645```
1646typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream
1647```
1648
1649**Description**
1650
1651Defines a struct for a memory stream.
1652
1653**Since**: 12
1654
1655
1656### OH_Drawing_MipmapMode
1657
1658```
1659typedef enum OH_Drawing_MipmapMode OH_Drawing_MipmapMode
1660```
1661
1662**Description**
1663
1664Defines an enum for the mipmap modes.
1665
1666**Since**: 12
1667
1668
1669### OH_Drawing_Path
1670
1671```
1672typedef struct OH_Drawing_Path OH_Drawing_Path
1673```
1674
1675**Description**
1676
1677Defines a struct for a path, which is used to customize various shapes.
1678
1679**Since**: 8
1680
1681
1682### OH_Drawing_PathAddMode
1683
1684```
1685typedef enum OH_Drawing_PathAddMode OH_Drawing_PathAddMode
1686```
1687
1688**Description**
1689
1690Defines an enum for the path adding modes.
1691
1692**Since**: 12
1693
1694
1695### OH_Drawing_PathDirection
1696
1697```
1698typedef enum OH_Drawing_PathDirection OH_Drawing_PathDirection
1699```
1700
1701**Description**
1702
1703Defines an enum for the directions of a closed contour.
1704
1705**Since**: 12
1706
1707
1708### OH_Drawing_PathEffect
1709
1710```
1711typedef struct OH_Drawing_PathEffect OH_Drawing_PathEffect
1712```
1713
1714**Description**
1715
1716Defines a struct for a path effect that affects the stroke.
1717
1718**Since**: 12
1719
1720
1721### OH_Drawing_PathFillType
1722
1723```
1724typedef enum OH_Drawing_PathFillType OH_Drawing_PathFillType
1725```
1726
1727**Description**
1728
1729Defines an enum for the fill types of a path.
1730
1731**Since**: 12
1732
1733
1734### OH_Drawing_Pen
1735
1736```
1737typedef struct OH_Drawing_Pen OH_Drawing_Pen
1738```
1739
1740**Description**
1741
1742Defines a struct for a pen, which is used to describe the style and color to outline a shape.
1743
1744**Since**: 8
1745
1746
1747### OH_Drawing_PenLineCapStyle
1748
1749```
1750typedef enum OH_Drawing_PenLineCapStyle OH_Drawing_PenLineCapStyle
1751```
1752
1753**Description**
1754
1755Defines an enum for the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.
1756
1757**Since**: 8
1758
1759
1760### OH_Drawing_PenLineJoinStyle
1761
1762```
1763typedef enum OH_Drawing_PenLineJoinStyle OH_Drawing_PenLineJoinStyle
1764```
1765
1766**Description**
1767
1768Defines an enum for the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.
1769
1770**Since**: 8
1771
1772
1773### OH_Drawing_PixelMap
1774
1775```
1776typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap
1777```
1778
1779**Description**
1780
1781Defines a struct for a pixel map, which is used to wrap the real pixel map supported by the image framework.
1782
1783**Since**: 12
1784
1785
1786### OH_Drawing_PlaceholderSpan
1787
1788```
1789typedef struct OH_Drawing_PlaceholderSpan OH_Drawing_PlaceholderSpan
1790```
1791
1792**Description**
1793
1794Defines a struct for the placeholder that acts as a span.
1795
1796**Since**: 11
1797
1798
1799### OH_Drawing_PlaceholderVerticalAlignment
1800
1801```
1802typedef enum OH_Drawing_PlaceholderVerticalAlignment OH_Drawing_PlaceholderVerticalAlignment
1803```
1804
1805**Description**
1806
1807Defines an enum for the vertical alignment modes of placeholders.
1808
1809**Since**: 11
1810
1811
1812### OH_Drawing_Point
1813
1814```
1815typedef struct OH_Drawing_Point OH_Drawing_Point
1816```
1817
1818**Description**
1819
1820Defines a struct for a coordinate point.
1821
1822**Since**: 11
1823
1824
1825### OH_Drawing_Point2D
1826
1827```
1828typedef struct OH_Drawing_Point2D OH_Drawing_Point2D
1829```
1830
1831**Description**
1832
1833Defines a struct for a two-dimensional coordinate point.
1834
1835**Since**: 12
1836
1837
1838### OH_Drawing_Point3D
1839
1840```
1841typedef struct OH_Drawing_Point3D OH_Drawing_Point3D
1842```
1843
1844**Description**
1845
1846Defines a struct for a three-dimensional coordinate point.
1847
1848**Since**: 12
1849
1850
1851### OH_Drawing_PointMode
1852
1853```
1854typedef enum OH_Drawing_PointMode OH_Drawing_PointMode
1855```
1856
1857**Description**
1858
1859Defines an enum for the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.
1860
1861**Since**: 12
1862
1863
1864### OH_Drawing_PositionAndAffinity
1865
1866```
1867typedef struct OH_Drawing_PositionAndAffinity OH_Drawing_PositionAndAffinity
1868```
1869
1870**Description**
1871
1872Defines a struct used to receive the position and affinity of a glyph.
1873
1874**Since**: 11
1875
1876
1877### OH_Drawing_Range
1878
1879```
1880typedef struct OH_Drawing_Range OH_Drawing_Range
1881```
1882
1883**Description**
1884
1885Defines a struct used to receive the start position and end position of a glyph.
1886
1887**Since**: 11
1888
1889
1890### OH_Drawing_Rect
1891
1892```
1893typedef struct OH_Drawing_Rect OH_Drawing_Rect
1894```
1895
1896**Description**
1897
1898Defines a struct for a rectangle.
1899
1900**Since**: 11
1901
1902
1903### OH_Drawing_RectHeightStyle
1904
1905```
1906typedef enum OH_Drawing_RectHeightStyle OH_Drawing_RectHeightStyle
1907```
1908
1909**Description**
1910
1911Defines an enum for the rectangle height styles.
1912
1913**Since**: 11
1914
1915
1916### OH_Drawing_RectStyle_Info
1917
1918```
1919typedef struct OH_Drawing_RectStyle_Info OH_Drawing_RectStyle_Info
1920```
1921
1922**Description**
1923
1924Defines a struct for the style of a rectangle.
1925
1926**Since**: 12
1927
1928
1929### OH_Drawing_RectWidthStyle
1930
1931```
1932typedef enum OH_Drawing_RectWidthStyle OH_Drawing_RectWidthStyle
1933```
1934
1935**Description**
1936
1937Defines an enum for the rectangle width styles.
1938
1939**Since**: 11
1940
1941
1942### OH_Drawing_Region
1943
1944```
1945typedef struct OH_Drawing_Region OH_Drawing_Region
1946```
1947
1948**Description**
1949
1950Defines a struct for a region, which represents a closed area on the canvas for more accurate graphic control.
1951
1952**Since**: 12
1953
1954
1955### OH_Drawing_RoundRect
1956
1957```
1958typedef struct OH_Drawing_RoundRect OH_Drawing_RoundRect
1959```
1960
1961**Description**
1962
1963Defines a struct for a rounded rectangle.
1964
1965**Since**: 11
1966
1967
1968### OH_Drawing_RunBuffer
1969
1970```
1971typedef struct OH_Drawing_RunBuffer OH_Drawing_RunBuffer
1972```
1973
1974**Description**
1975
1976Defines a struct for a run, which provides storage for glyphs and positions.
1977
1978**Since**: 11
1979
1980
1981### OH_Drawing_SamplingOptions
1982
1983```
1984typedef struct OH_Drawing_SamplingOptions OH_Drawing_SamplingOptions
1985```
1986
1987**Description**
1988
1989Defines a struct for sampling options, which describe the sampling methods for images and bitmaps.
1990
1991**Since**: 12
1992
1993
1994### OH_Drawing_ScaleToFit
1995
1996```
1997typedef enum OH_Drawing_ScaleToFit OH_Drawing_ScaleToFit
1998```
1999
2000**Description**
2001
2002Defines an enum for the matrix scaling modes.
2003
2004**Since**: 12
2005
2006
2007### OH_Drawing_ShaderEffect
2008
2009```
2010typedef struct OH_Drawing_ShaderEffect OH_Drawing_ShaderEffect
2011```
2012
2013**Description**
2014
2015Defines a struct for a shader effect, which is used to describe the source color of the drawn content.
2016
2017**Since**: 11
2018
2019
2020### OH_Drawing_ShadowLayer
2021
2022```
2023typedef struct OH_Drawing_ShadowLayer OH_Drawing_ShadowLayer
2024```
2025
2026**Description**
2027
2028Defines a struct for a shadow, which is used to describe the shadow layer of the drawn content.
2029
2030**Since**: 12
2031
2032
2033### OH_Drawing_SrcRectConstraint
2034
2035```
2036typedef enum OH_Drawing_SrcRectConstraint OH_Drawing_SrcRectConstraint
2037```
2038
2039**Description**
2040
2041Defines an enum for the constraint types of the source rectangle.
2042
2043**Since**: 12
2044
2045
2046### OH_Drawing_StrutStyle
2047
2048```
2049typedef struct OH_Drawing_StrutStyle OH_Drawing_StrutStyle
2050```
2051
2052**Description**
2053
2054Defines a struct for a strut style. The strut style determines the line spacing, baseline alignment mode, and other properties related to the line height when drawing texts.
2055
2056**Since**: 12
2057
2058
2059### OH_Drawing_Surface
2060
2061```
2062typedef struct OH_Drawing_Surface OH_Drawing_Surface
2063```
2064
2065**Description**
2066
2067Defines a struct for a surface, which is used to manage the content drawn on the canvas.
2068
2069**Since**: 12
2070
2071
2072### OH_Drawing_TextBlob
2073
2074```
2075typedef struct OH_Drawing_TextBlob OH_Drawing_TextBlob
2076```
2077
2078**Description**
2079
2080Defines a struct for a text blob, an immutable container that holds multiple texts. Each text blob consists of glyphs and position.
2081
2082**Since**: 11
2083
2084
2085### OH_Drawing_TextBlobBuilder
2086
2087```
2088typedef struct OH_Drawing_TextBlobBuilder OH_Drawing_TextBlobBuilder
2089```
2090
2091**Description**
2092
2093Defines a struct for a text blob builder, which is used to build a text blob.
2094
2095**Since**: 11
2096
2097
2098### OH_Drawing_TextBox
2099
2100```
2101typedef struct OH_Drawing_TextBox OH_Drawing_TextBox
2102```
2103
2104**Description**
2105
2106Defines a struct for a text box, which is used to receive the rectangle size, direction, and quantity.
2107
2108**Since**: 11
2109
2110
2111### OH_Drawing_TextDecorationStyle
2112
2113```
2114typedef enum OH_Drawing_TextDecorationStyle OH_Drawing_TextDecorationStyle
2115```
2116
2117**Description**
2118
2119Defines an enum for the text decoration styles.
2120
2121**Since**: 11
2122
2123
2124### OH_Drawing_TextEncoding
2125
2126```
2127typedef enum OH_Drawing_TextEncoding OH_Drawing_TextEncoding
2128```
2129
2130**Description**
2131
2132Defines an enum for the text encoding types.
2133
2134**Since**: 12
2135
2136
2137### OH_Drawing_TextShadow
2138
2139```
2140typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow
2141```
2142
2143**Description**
2144
2145Defines a struct used to manage text shadows.
2146
2147**Since**: 12
2148
2149
2150### OH_Drawing_TextStyle
2151
2152```
2153typedef struct OH_Drawing_TextStyle OH_Drawing_TextStyle
2154```
2155
2156**Description**
2157
2158Defines a struct used to manage text colors and decorations.
2159
2160**Since**: 8
2161
2162
2163### OH_Drawing_TileMode
2164
2165```
2166typedef enum OH_Drawing_TileMode OH_Drawing_TileMode
2167```
2168
2169**Description**
2170
2171Defines an enum for the tile modes of the shader effect.
2172
2173**Since**: 11
2174
2175
2176### OH_Drawing_Typeface
2177
2178```
2179typedef struct OH_Drawing_Typeface OH_Drawing_Typeface
2180```
2181
2182**Description**
2183
2184Defines a struct for a typeface.
2185
2186**Since**: 11
2187
2188
2189### OH_Drawing_Typography
2190
2191```
2192typedef struct OH_Drawing_Typography OH_Drawing_Typography
2193```
2194
2195**Description**
2196
2197Defines a struct used to manage the typography layout and display.
2198
2199**Since**: 8
2200
2201
2202### OH_Drawing_TypographyCreate
2203
2204```
2205typedef struct OH_Drawing_TypographyCreate OH_Drawing_TypographyCreate
2206```
2207
2208**Description**
2209
2210Defines a struct used to create an [OH_Drawing_Typography](#oh_drawing_typography) object.
2211
2212**Since**: 8
2213
2214
2215### OH_Drawing_TypographyStyle
2216
2217```
2218typedef struct OH_Drawing_TypographyStyle OH_Drawing_TypographyStyle
2219```
2220
2221**Description**
2222
2223Defines a struct used to manage the typography style, such as the text direction.
2224
2225**Since**: 8
2226
2227
2228### OH_Drawing_VertexMode
2229
2230```
2231typedef enum OH_Drawing_VertexMode OH_Drawing_VertexMode
2232```
2233
2234**Description**
2235
2236Defines an enum for the modes of interpreting the geometry of a given vertex.
2237
2238**Since**: 12
2239
2240
2241### OH_Drawing_WordBreakType
2242
2243```
2244typedef enum OH_Drawing_WordBreakType OH_Drawing_WordBreakType
2245```
2246
2247**Description**
2248
2249Defines an enum for the word break types.
2250
2251**Since**: 11
2252
2253
2254## Enum Description
2255
2256### OH_Drawing_PathDashStyle
2257
2258```
2259enum OH_Drawing_PathDashStyle
2260```
2261
2262**Description**
2263
2264Enumerates the drawing styles for path effects.
2265
2266**Since**: 18
2267
2268| Value| Description|
2269| -------- | -------- |
2270| DRAWING_PATH_DASH_STYLE_TRANSLATE  | Translation effect.|
2271| DRAWING_PATH_DASH_STYLE_ROTATE  | Rotation effect.|
2272| DRAWING_PATH_DASH_STYLE_MORPH  | Morphing effect.|
2273
2274### OH_Drawing_SystemFontType
2275
2276```
2277enum OH_Drawing_SystemFontType
2278```
2279
2280**Description**
2281
2282Enumerates the system font types.
2283
2284**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
2285
2286**Since**: 14
2287
2288| Value| Description|
2289| -------- | -------- |
2290| ALL | All font types.|
2291| GENERIC | System font type.|
2292| STYLISH | Style font type.|
2293| INSTALLED | User-installed font type.|
2294| CUSTOMIZED<sup>18+</sup> | Custom font type.|
2295
2296### OH_Drawing_ErrorCode
2297
2298```
2299enum OH_Drawing_ErrorCode
2300```
2301
2302**Description**
2303
2304Enumerates the error codes that may be generated by the module.
2305
2306**Since**: 12
2307
2308| Value| Description|
2309| -------- | -------- |
2310| OH_DRAWING_SUCCESS | Operation successful.|
2311| OH_DRAWING_ERROR_NO_PERMISSION | Permission verification fails.|
2312| OH_DRAWING_ERROR_INVALID_PARAMETER | Invalid input parameter. For example, NULL is passed in.|
2313| OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE | The input parameter is not in the valid range.|
2314| OH_DRAWING_ERROR_ALLOCATION_FAILED<sup>13+</sup> | Failed to allocate memory.|
2315
2316### OH_Drawing_PathMeasureMatrixFlags
2317
2318```
2319enum OH_Drawing_PathMeasureMatrixFlags
2320```
2321
2322**Description**
2323
2324Enumerates the types of matrix information obtained during path measurement.
2325
2326**Since**: 12
2327
2328| Value| Description|
2329| -------- | -------- |
2330| GET_POSITION_MATRIX | Obtains the matrix corresponding to the location information.|
2331| GET_TANGENT_MATRIX | Obtains the matrix corresponding to the tangent information.|
2332| GET_POSITION_AND_TANGENT_MATRIX | Obtains the matrix corresponding to the location and tangent information.|
2333
2334
2335### OH_Drawing_PathOpMode
2336
2337```
2338enum OH_Drawing_PathOpMode
2339```
2340
2341**Description**
2342
2343Enumerates the operation modes available for a path.
2344
2345**Since**: 12
2346
2347| Value| Description|
2348| -------- | -------- |
2349| PATH_OP_MODE_DIFFERENCE | Difference operation.|
2350| PATH_OP_MODE_INTERSECT | Intersection operation.|
2351| PATH_OP_MODE_UNION | Union operation.|
2352| PATH_OP_MODE_XOR | XOR operation.|
2353| PATH_OP_MODE_REVERSE_DIFFERENCE | Reverse difference operation.|
2354
2355
2356### OH_Drawing_RegionOpMode
2357
2358```
2359enum OH_Drawing_RegionOpMode
2360```
2361
2362**Description**
2363
2364Enumerates the operation modes available for a region.
2365
2366**Since**: 12
2367
2368| Value| Description|
2369| -------- | -------- |
2370| REGION_OP_MODE_DIFFERENCE | Difference operation.|
2371| REGION_OP_MODE_INTERSECT | Intersection operation.|
2372| REGION_OP_MODE_UNION | Union operation.|
2373| REGION_OP_MODE_XOR | XOR operation.|
2374| REGION_OP_MODE_REVERSE_DIFFERENCE | Reverse difference operation.|
2375| REGION_OP_MODE_REPLACE | Replacement operation.|
2376
2377
2378### OH_Drawing_AlphaFormat
2379
2380```
2381enum OH_Drawing_AlphaFormat
2382```
2383
2384**Description**
2385
2386Enumerates the alpha formats of bitmap pixels.
2387
2388**Since**: 8
2389
2390| Value| Description|
2391| -------- | -------- |
2392| ALPHA_FORMAT_UNKNOWN | Unknown format.|
2393| ALPHA_FORMAT_OPAQUE | The bitmap does not have the alpha component.|
2394| ALPHA_FORMAT_PREMUL | The color component of each pixel is premultiplied by the alpha component.|
2395| ALPHA_FORMAT_UNPREMUL | The color component of each pixel is not premultiplied by the alpha component.|
2396
2397
2398### OH_Drawing_BlendMode
2399
2400```
2401enum OH_Drawing_BlendMode
2402```
2403
2404**Description**
2405
2406Enumerates the blend modes. In blend mode, each operation generates a new color from two colors (source color and target color). These operations are the same for the red, green, and blue color channels (the alpha channel follows a different rule). The operations for the alpha channel are used as examples.
2407
2408For brevity, the following abbreviations are used:
2409
2410**s**: source.
2411
2412**d**: destination.
2413
2414**sa**: source alpha.
2415
2416**da**: destination alpha.
2417
2418The following abbreviations are used in the calculation result:
2419
2420**r**: The calculation methods of the four channels are the same.
2421
2422**ra**: Only the alpha channel is manipulated.
2423
2424**rc**: The other three color channels are manipulated.
2425
2426**Since**: 11
2427
2428| Value| Description|
2429| -------- | -------- |
2430| BLEND_MODE_CLEAR | Clear mode. r = 0.|
2431| BLEND_MODE_SRC | r = s (The four channels of **result** are equal to the four channels of **source**, that is, the result is equal to the source.)|
2432| BLEND_MODE_DST | r = d (The four channels of **result** are equal to the four channels of **destination**, that is, the result is equal to the destination.)|
2433| BLEND_MODE_SRC_OVER | r = s + (1 - sa) \* d. |
2434| BLEND_MODE_DST_OVER | r = d + (1 - da) \* s. |
2435| BLEND_MODE_SRC_IN | r = s \* da. |
2436| BLEND_MODE_DST_IN | r = d \* sa. |
2437| BLEND_MODE_SRC_OUT | r = s \* (1 - da). |
2438| BLEND_MODE_DST_OUT | r = d \* (1 - sa). |
2439| BLEND_MODE_SRC_ATOP | r = s \* da + d \* (1 - sa). |
2440| BLEND_MODE_DST_ATOP | r = d \* sa + s \* (1 - da). |
2441| BLEND_MODE_XOR | r = s \* (1 - da) + d \* (1 - sa). |
2442| BLEND_MODE_PLUS | r = min(s + d, 1). |
2443| BLEND_MODE_MODULATE | r = s \* d. |
2444| BLEND_MODE_SCREEN | Screen mode. r = s + d - s \* d|
2445| BLEND_MODE_OVERLAY | Overlay mode.|
2446| BLEND_MODE_DARKEN | Darken mode. rc = s + d - max(s \* da, d \* sa), ra = s + (1 - sa) \* d|
2447| BLEND_MODE_LIGHTEN | Lighten mode. rc = s + d - min(s \* da, d \* sa), ra = s + (1 - sa) \* d|
2448| BLEND_MODE_COLOR_DODGE | Color dodge mode.|
2449| BLEND_MODE_COLOR_BURN | Color burn mode.|
2450| BLEND_MODE_HARD_LIGHT | Hard light mode.|
2451| BLEND_MODE_SOFT_LIGHT | Soft light mode.|
2452| BLEND_MODE_DIFFERENCE | Difference mode. rc = s + d - 2 \* (min(s \* da, d \* sa)), ra = s + (1 - sa) \* d|
2453| BLEND_MODE_EXCLUSION | Exclusion mode. rc = s + d - two(s \* d), ra = s + (1 - sa) \* d|
2454| BLEND_MODE_MULTIPLY | Multiply mode. r = s \* (1 - da) + d \* (1 - sa) + s \* d|
2455| BLEND_MODE_HUE | Hue mode.|
2456| BLEND_MODE_SATURATION | Saturation mode.|
2457| BLEND_MODE_COLOR | Color mode.|
2458| BLEND_MODE_LUMINOSITY | Luminosity mode.|
2459
2460
2461### OH_Drawing_BlurType
2462
2463```
2464enum OH_Drawing_BlurType
2465```
2466
2467**Description**
2468
2469Enumerates the blur types.
2470
2471**Since**: 11
2472
2473| Value| Description|
2474| -------- | -------- |
2475| NORMAL | Blurs both inside and outside the original border.|
2476| SOLID | Draws solid inside the border, and blurs outside.|
2477| OUTER | Draws nothing inside the border, and blurs outside.|
2478| INNER | Blurs inside the border, and draws nothing outside.|
2479
2480
2481### OH_Drawing_BreakStrategy
2482
2483```
2484enum OH_Drawing_BreakStrategy
2485```
2486
2487**Description**
2488
2489Enumerates the text break strategies.
2490
2491**Since**: 11
2492
2493| Value| Description|
2494| -------- | -------- |
2495| BREAK_STRATEGY_GREEDY | Each line is filled as much as possible during line break.|
2496| BREAK_STRATEGY_HIGH_QUALITY | Text continuity is preferentially considered during line break.|
2497| BREAK_STRATEGY_BALANCED | Line breaks are performed at the word boundary.|
2498
2499
2500### OH_Drawing_CanvasClipOp
2501
2502```
2503enum OH_Drawing_CanvasClipOp
2504```
2505
2506**Description**
2507
2508Enumerates the canvas clipping modes.
2509
2510**Since**: 11
2511
2512| Value| Description|
2513| -------- | -------- |
2514| DIFFERENCE | Clips a specified area. That is, the difference set is obtained.|
2515| INTERSECT | Retains a specified area. That is, the intersection is obtained.|
2516
2517
2518### OH_Drawing_CanvasShadowFlags
2519
2520```
2521enum OH_Drawing_CanvasShadowFlags
2522```
2523
2524**Description**
2525
2526Enumerates the shadow flags.
2527
2528**Since**: 12
2529
2530| Value| Description|
2531| -------- | -------- |
2532| SHADOW_FLAGS_NONE | There is no shadow flag.|
2533| SHADOW_FLAGS_TRANSPARENT_OCCLUDER | The occluding object is transparent.|
2534| SHADOW_FLAGS_GEOMETRIC_ONLY | No analysis on the shadows is required.|
2535| SHADOW_FLAGS_ALL | All the preceding shadow flags are used.|
2536
2537
2538### OH_Drawing_ColorFormat
2539
2540```
2541enum OH_Drawing_ColorFormat
2542```
2543
2544**Description**
2545
2546Enumerates the storage formats of bitmap pixels.
2547
2548**Since**: 8
2549
2550| Value| Description|
2551| -------- | -------- |
2552| COLOR_FORMAT_UNKNOWN | Unknown format.|
2553| COLOR_FORMAT_ALPHA_8 | Each pixel is represented by 8 bits, which together indicate alpha.|
2554| COLOR_FORMAT_RGB_565 | Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, the first 5 bits indicate red, the subsequent 6 bits indicate green, and the last 5 bits indicate blue.|
2555| COLOR_FORMAT_ARGB_4444 | Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, every 4 bits indicate alpha, red, green, and blue, respectively.|
2556| COLOR_FORMAT_RGBA_8888 | Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits indicate alpha, red, green, and blue, respectively.|
2557| COLOR_FORMAT_BGRA_8888 | Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits indicate blue, green, red, and alpha, respectively.|
2558
2559
2560### OH_Drawing_CornerPos
2561
2562```
2563enum OH_Drawing_CornerPos
2564```
2565
2566**Description**
2567
2568Enumerates the corner positions of a rounded rectangle.
2569
2570**Since**: 12
2571
2572| Value| Description|
2573| -------- | -------- |
2574| CORNER_POS_TOP_LEFT | Top left corner of the rounded rectangle.|
2575| CORNER_POS_TOP_RIGHT | Top right corner of the rounded rectangle.|
2576| CORNER_POS_BOTTOM_RIGHT | Bottom right corner of the rounded rectangle.|
2577| CORNER_POS_BOTTOM_LEFT | Bottom left corner of the rounded rectangle.|
2578
2579
2580### OH_Drawing_EllipsisModal
2581
2582```
2583enum OH_Drawing_EllipsisModal
2584```
2585
2586**Description**
2587
2588Enumerates the ellipsis styles.
2589
2590**Since**: 11
2591
2592| Value| Description|
2593| -------- | -------- |
2594| ELLIPSIS_MODAL_HEAD | Places the ellipsis in the text header.|
2595| ELLIPSIS_MODAL_MIDDLE | Places the ellipsis in the middle of the text.|
2596| ELLIPSIS_MODAL_TAIL | Places the ellipsis at the end of the text.|
2597
2598
2599### OH_Drawing_FilterMode
2600
2601```
2602enum OH_Drawing_FilterMode
2603```
2604
2605**Description**
2606
2607Enumerates the filter modes.
2608
2609**Since**: 12
2610
2611| Value| Description|
2612| -------- | -------- |
2613| FILTER_MODE_NEAREST | Nearest filter mode.|
2614| FILTER_MODE_LINEAR | Linear filter mode.|
2615
2616
2617### OH_Drawing_FontConfigInfoErrorCode
2618
2619```
2620enum OH_Drawing_FontConfigInfoErrorCode
2621```
2622
2623**Description**
2624
2625Enumerates the error codes that may be used during the obtaining of system font configurations.
2626
2627**Since**: 12
2628
2629| Value| Description|
2630| -------- | -------- |
2631| SUCCESS_FONT_CONFIG_INFO | Operation successful.|
2632| ERROR_FONT_CONFIG_INFO_UNKNOWN | Unknown error.|
2633| ERROR_FONT_CONFIG_INFO_PARSE_FILE | Failed to parse the system configuration file.|
2634| ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY | Failed to allocate the memory.|
2635| ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA | Failed to copy the string data.|
2636
2637
2638### OH_Drawing_FontEdging
2639
2640```
2641enum OH_Drawing_FontEdging
2642```
2643
2644**Description**
2645
2646Enumerates the font edging types.
2647
2648**Since**: 12
2649
2650| Value| Description|
2651| -------- | -------- |
2652| FONT_EDGING_ALIAS | No anti-aliasing processing is used.|
2653| FONT_EDGING_ANTI_ALIAS | Uses anti-aliasing to smooth the jagged edges.|
2654| FONT_EDGING_SUBPIXEL_ANTI_ALIAS | Uses sub-pixel anti-aliasing to provide a smoother effect for jagged edges.|
2655
2656
2657### OH_Drawing_FontHinting
2658
2659```
2660enum OH_Drawing_FontHinting
2661```
2662
2663**Description**
2664
2665Enumerates the font hinting types.
2666
2667**Since**: 12
2668
2669| Value| Description|
2670| -------- | -------- |
2671| FONT_HINTING_NONE | No font hinting is used.|
2672| FONT_HINTING_SLIGHT | Slight font hinting is used to improve contrast.|
2673| FONT_HINTING_NORMAL | Normal font hinting is used to improve contrast.|
2674| FONT_HINTING_FULL | Full font hinting is used to improve contrast.|
2675
2676
2677### OH_Drawing_FontStyle
2678
2679```
2680enum OH_Drawing_FontStyle
2681```
2682
2683**Description**
2684
2685Enumerates the font styles.
2686
2687| Value| Description|
2688| -------- | -------- |
2689| FONT_STYLE_NORMAL | Normal style.|
2690| FONT_STYLE_ITALIC | Italic.|
2691| FONT_STYLE_OBLIQUE<sup>12+</sup> | Oblique.|
2692
2693
2694### OH_Drawing_FontWeight
2695
2696```
2697enum OH_Drawing_FontWeight
2698```
2699
2700**Description**
2701
2702Enumerates the font weights.
2703
2704| Value| Description|
2705| -------- | -------- |
2706| FONT_WEIGHT_100 | Thin.|
2707| FONT_WEIGHT_200 | Extra-light.|
2708| FONT_WEIGHT_300 | Light.|
2709| FONT_WEIGHT_400 | Normal/Regular.|
2710| FONT_WEIGHT_500 | Medium.|
2711| FONT_WEIGHT_600 | Semi-bold.|
2712| FONT_WEIGHT_700 | Bold.|
2713| FONT_WEIGHT_800 | Extra-bold.|
2714| FONT_WEIGHT_900 | Black.|
2715
2716
2717### OH_Drawing_FontWidth
2718
2719```
2720enum OH_Drawing_FontWidth
2721```
2722
2723**Description**
2724
2725Enumerates the font widths.
2726
2727**Since**: 12
2728
2729
2730### OH_Drawing_MipmapMode
2731
2732```
2733enum OH_Drawing_MipmapMode
2734```
2735
2736**Description**
2737
2738Enumerates the mipmap modes.
2739
2740**Since**: 12
2741
2742| Value| Description|
2743| -------- | -------- |
2744| MIPMAP_MODE_NONE | Mipmap level ignored.|
2745| MIPMAP_MODE_NEAREST | Nearest sampling from two adjacent mipmap levels.|
2746| MIPMAP_MODE_LINEAR | Linear interpolation sampling between two adjacent mipmap levels.|
2747
2748
2749### OH_Drawing_PathAddMode
2750
2751```
2752enum OH_Drawing_PathAddMode
2753```
2754
2755**Description**
2756
2757Enumerates the path adding modes.
2758
2759**Since**: 12
2760
2761| Value| Description|
2762| -------- | -------- |
2763| PATH_ADD_MODE_APPEND | Adds a path in append mode.|
2764| PATH_ADD_MODE_EXTEND | Adds a line segment to close the path if the previous path is not closed.|
2765
2766
2767### OH_Drawing_PathDirection
2768
2769```
2770enum OH_Drawing_PathDirection
2771```
2772
2773**Description**
2774
2775Enumerates the directions of a closed contour.
2776
2777**Since**: 12
2778
2779| Value| Description|
2780| -------- | -------- |
2781| PATH_DIRECTION_CW | Adds a closed contour clockwise.|
2782| PATH_DIRECTION_CCW | Adds a closed contour counterclockwise.|
2783
2784
2785### OH_Drawing_PathFillType
2786
2787```
2788enum OH_Drawing_PathFillType
2789```
2790
2791**Description**
2792
2793Enumerates the fill types of a path.
2794
2795**Since**: 12
2796
2797| Value| Description|
2798| -------- | -------- |
2799| PATH_FILL_TYPE_WINDING | Specifies that "inside" is computed by a non-zero sum of signed edge crossings. Specifically, draws a point and emits a ray in any direction. A count is used to record the number of intersection points of the ray and path, and the initial count is 0. When encountering a clockwise intersection point (the path passes from the left to the right of the ray), the count increases by 1. When encountering a counterclockwise intersection point (the path passes from the right to the left of the ray), the count decreases by 1. If the final count is not 0, the point is inside the path and needs to be colored. If the final count is 0, the point is not colored.|
2800| PATH_FILL_TYPE_EVEN_ODD | Specifies that "inside" is computed by an odd number of edge crossings. Specifically, draws a point and emits a ray in any direction. If the number of intersection points of the ray and path is an odd number, the point is considered to be inside the path and needs to be colored. If the number is an even number, the point is not colored.|
2801| PATH_FILL_TYPE_INVERSE_WINDING | Same as **PATH_FILL_TYPE_WINDING**, but draws outside of the path, rather than inside.|
2802| PATH_FILL_TYPE_INVERSE_EVEN_ODD | Same as **PATH_FILL_TYPE_EVEN_ODD**, but draws outside of the path, rather than inside.|
2803
2804
2805### OH_Drawing_PenLineCapStyle
2806
2807```
2808enum OH_Drawing_PenLineCapStyle
2809```
2810
2811**Description**
2812
2813Enumerates the line cap styles of a pen. The line cap style defines the style of both ends of a line segment drawn by the pen.
2814
2815**Since**: 8
2816
2817| Value| Description|
2818| -------- | -------- |
2819| LINE_FLAT_CAP | There is no cap style. Both ends of the line segment are cut off square.|
2820| LINE_SQUARE_CAP | Square cap style. Both ends have a square, the height of which is half of the width of the line segment, with the same width.|
2821| LINE_ROUND_CAP | Round cap style. Both ends have a semicircle centered, the diameter of which is the same as the width of the line segment.|
2822
2823
2824### OH_Drawing_PenLineJoinStyle
2825
2826```
2827enum OH_Drawing_PenLineJoinStyle
2828```
2829
2830**Description**
2831
2832Enumerates the line join styles of a pen. The line join style defines the shape of the joints of a polyline segment drawn by the pen.
2833
2834**Since**: 8
2835
2836| Value| Description|
2837| -------- | -------- |
2838| LINE_MITER_JOIN | Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate. In this case, you need to use the miter limit to limit the miter length.|
2839| LINE_ROUND_JOIN | Round corner.|
2840| LINE_BEVEL_JOIN | Beveled corner.|
2841
2842
2843### OH_Drawing_PlaceholderVerticalAlignment
2844
2845```
2846enum OH_Drawing_PlaceholderVerticalAlignment
2847```
2848
2849**Description**
2850
2851Enumerates the vertical alignment modes of placeholders.
2852
2853**Since**: 11
2854
2855| Value| Description|
2856| -------- | -------- |
2857| ALIGNMENT_OFFSET_AT_BASELINE | Aligned to the baseline.|
2858| ALIGNMENT_ABOVE_BASELINE | Aligned above the baseline.|
2859| ALIGNMENT_BELOW_BASELINE | Aligned below the baseline.|
2860| ALIGNMENT_TOP_OF_ROW_BOX | Aligned to the top of the row box.|
2861| ALIGNMENT_BOTTOM_OF_ROW_BOX | Aligned to the bottom of the row box.|
2862| ALIGNMENT_CENTER_OF_ROW_BOX | Aligned to the center of the row box.|
2863
2864
2865### OH_Drawing_PointMode
2866
2867```
2868enum OH_Drawing_PointMode
2869```
2870
2871**Description**
2872
2873Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open polygons.
2874
2875**Since**: 12
2876
2877| Value| Description|
2878| -------- | -------- |
2879| POINT_MODE_POINTS | Draws each point separately.|
2880| POINT_MODE_LINES | Draws every two points as a line segment.|
2881| POINT_MODE_POLYGON | Draws an array of points as an open polygon.|
2882
2883
2884### OH_Drawing_RectHeightStyle
2885
2886```
2887enum OH_Drawing_RectHeightStyle
2888```
2889
2890**Description**
2891
2892Enumerates the rectangle height styles.
2893
2894**Since**: 11
2895
2896| Value| Description|
2897| -------- | -------- |
2898| RECT_HEIGHT_STYLE_TIGHT | Tight style.|
2899| RECT_HEIGHT_STYLE_MAX | Maximum style.|
2900| RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE | Middle style that includes the line spacing.|
2901| RECT_HEIGHT_STYLE_INCLUDELINESPACETOP | Top style that includes the line spacing.|
2902| RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM | Bottom style that includes the line spacing.|
2903| RECT_HEIGHT_STYLE_STRUCT | Structure style.|
2904
2905
2906### OH_Drawing_RectWidthStyle
2907
2908```
2909enum OH_Drawing_RectWidthStyle
2910```
2911
2912**Description**
2913
2914Enumerates the rectangle width styles.
2915
2916**Since**: 11
2917
2918| Value| Description|
2919| -------- | -------- |
2920| RECT_WIDTH_STYLE_TIGHT | Tight style.|
2921| RECT_WIDTH_STYLE_MAX | Maximum style.|
2922
2923
2924### OH_Drawing_ScaleToFit
2925
2926```
2927enum OH_Drawing_ScaleToFit
2928```
2929
2930**Description**
2931
2932Enumerates the matrix scaling modes.
2933
2934**Since**: 12
2935
2936| Value| Description|
2937| -------- | -------- |
2938| SCALE_TO_FIT_FILL | Scales the source rectangle both horizontally and vertically to exactly match the destination rectangle.|
2939| SCALE_TO_FIT_START | Scales the source rectangle and aligns it to the left and top edges of the destination rectangle.|
2940| SCALE_TO_FIT_CENTER | Scales the source rectangle and aligns it to the center of the destination rectangle.|
2941| SCALE_TO_FIT_END | Scales the source rectangle and aligns it to the right and bottom edges of the destination rectangle.|
2942
2943
2944### OH_Drawing_SrcRectConstraint
2945
2946```
2947enum OH_Drawing_SrcRectConstraint
2948```
2949
2950**Description**
2951
2952Enumerates the constraint types of the source rectangle.
2953
2954**Since**: 12
2955
2956| Value| Description|
2957| -------- | -------- |
2958| STRICT_SRC_RECT_CONSTRAINT | The source rectangle must be completely contained in the image.|
2959| FAST_SRC_RECT_CONSTRAINT | The source rectangle can be partly outside the image.|
2960
2961
2962### OH_Drawing_TextAlign
2963
2964```
2965enum OH_Drawing_TextAlign
2966```
2967
2968**Description**
2969
2970Enumerates the text alignment modes.
2971
2972| Value| Description|
2973| -------- | -------- |
2974| TEXT_ALIGN_LEFT | Left-aligned.|
2975| TEXT_ALIGN_RIGHT | Right-aligned.|
2976| TEXT_ALIGN_CENTER | Center-aligned.|
2977| TEXT_ALIGN_JUSTIFY | Justified, which means that each line (except the last line) is stretched so that every line has equal width, and the left and right margins are straight.|
2978| TEXT_ALIGN_START | **TEXT_ALIGN_START** achieves the same effect as **TEXT_ALIGN_LEFT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_LTR**; it achieves the same effect as **TEXT_ALIGN_RIGHT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_RTL**.|
2979| TEXT_ALIGN_END | **TEXT_ALIGN_END** achieves the same effect as **TEXT_ALIGN_RIGHT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_LTR**; it achieves the same effect as **TEXT_ALIGN_LEFT** when **OH_Drawing_TextDirection** is **TEXT_DIRECTION_RTL**.|
2980
2981
2982### OH_Drawing_TextBaseline
2983
2984```
2985enum OH_Drawing_TextBaseline
2986```
2987
2988**Description**
2989
2990Enumerates the text baselines.
2991
2992| Value| Description|
2993| -------- | -------- |
2994| TEXT_BASELINE_ALPHABETIC | Alphabetic, where the letters in alphabets like English sit on.|
2995| TEXT_BASELINE_IDEOGRAPHIC | Ideographic, where the baseline is at the bottom of the text area.|
2996
2997
2998### OH_Drawing_TextDecoration
2999
3000```
3001enum OH_Drawing_TextDecoration
3002```
3003
3004**Description**
3005
3006Enumerates the text decorations.
3007
3008| Value| Description|
3009| -------- | -------- |
3010| TEXT_DECORATION_NONE | No decoration.|
3011| TEXT_DECORATION_UNDERLINE | An underline is used for decoration.|
3012| TEXT_DECORATION_OVERLINE | An overline is used for decoration.|
3013| TEXT_DECORATION_LINE_THROUGH | A strikethrough is used for decoration.|
3014
3015
3016### OH_Drawing_TextDecorationStyle
3017
3018```
3019enum OH_Drawing_TextDecorationStyle
3020```
3021
3022**Description**
3023
3024Enumerates the text decoration styles.
3025
3026**Since**: 11
3027
3028| Value| Description|
3029| -------- | -------- |
3030| TEXT_DECORATION_STYLE_SOLID | Solid style.|
3031| TEXT_DECORATION_STYLE_DOUBLE | Double style.|
3032| TEXT_DECORATION_STYLE_DOTTED | Dotted style.|
3033| TEXT_DECORATION_STYLE_DASHED | Dashed style.|
3034| TEXT_DECORATION_STYLE_WAVY | Wavy style.|
3035
3036
3037### OH_Drawing_TextDirection
3038
3039```
3040enum OH_Drawing_TextDirection
3041```
3042
3043**Description**
3044
3045Enumerates the text directions.
3046
3047| Value| Description|
3048| -------- | -------- |
3049| TEXT_DIRECTION_RTL | Right to left (RTL).|
3050| TEXT_DIRECTION_LTR | Left to right (LTR).|
3051
3052
3053### OH_Drawing_TextEncoding
3054
3055```
3056enum OH_Drawing_TextEncoding
3057```
3058
3059**Description**
3060
3061Enumerates the text encoding types.
3062
3063**Since**: 12
3064
3065| Value| Description|
3066| -------- | -------- |
3067| TEXT_ENCODING_UTF8 | One byte used to indicate UTF-8 or ASCII characters.|
3068| TEXT_ENCODING_UTF16 | Two bytes used to indicate most Unicode characters.|
3069| TEXT_ENCODING_UTF32 | Four bytes used to indicate all Unicode characters.|
3070| TEXT_ENCODING_GLYPH_ID | Two bytes used to indicate the glyph index.|
3071
3072
3073### OH_Drawing_TextHeightBehavior
3074
3075```
3076enum OH_Drawing_TextHeightBehavior
3077```
3078
3079**Description**
3080
3081Enumerates the text height modifier patterns.
3082
3083**Since**: 12
3084
3085| Value| Description|
3086| -------- | -------- |
3087| TEXT_HEIGHT_ALL | Enables the height set by calling [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) for the top of the first line and the bottom of the last line in a paragraph.|
3088| TEXT_HEIGHT_DISABLE_FIRST_ASCENT | Disables the height set by calling [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) for the top of the first line in a paragraph.|
3089| TEXT_HEIGHT_DISABLE_LAST_ASCENT | Disables the height set by calling [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) for the bottom of the last line in a paragraph.|
3090| TEXT_HEIGHT_DISABLE_ALL | Disables the height set by calling [OH_Drawing_SetTextStyleFontHeight](#oh_drawing_settextstylefontheight) for both the top of the first line and the bottom of the last line in a paragraph.|
3091
3092
3093### OH_Drawing_TextStyleType
3094
3095```
3096enum OH_Drawing_TextStyleType
3097```
3098
3099**Description**
3100
3101Enumerates the text style types.
3102
3103**Since**: 12
3104
3105| Value| Description|
3106| -------- | -------- |
3107| TEXT_STYLE_NONE | No text style.|
3108| TEXT_STYLE_ALL_ATTRIBUTES | All text styles.|
3109| TEXT_STYLE_FONT | Font style.|
3110| TEXT_STYLE_FOREGROUND | Text foreground style.|
3111| TEXT_STYLE_BACKGROUND | Text background style.|
3112| TEXT_STYLE_SHADOW | Text shadow style.|
3113| TEXT_STYLE_DECORATIONS | Text decoration style.|
3114| TEXT_STYLE_LETTER_SPACING | Text letter spacing style.|
3115| TEXT_STYLE_WORD_SPACING | Text word spacing style.|
3116
3117
3118### OH_Drawing_TileMode
3119
3120```
3121enum OH_Drawing_TileMode
3122```
3123
3124**Description**
3125
3126Enumerates the tile modes of the shader effect.
3127
3128**Since**: 11
3129
3130| Value| Description|
3131| -------- | -------- |
3132| CLAMP | Replicates the edge color if the shader effect draws outside of its original boundary.|
3133| REPEAT | Repeats the shader effect's image in both horizontal and vertical directions.|
3134| MIRROR | Repeats the shader effect's image in both horizontal and vertical directions, alternating mirror images.|
3135| DECAL | Renders the shader effect's image only within the original boundary, and returns transparent black elsewhere.|
3136
3137
3138### OH_Drawing_VertexMode
3139
3140```
3141enum OH_Drawing_VertexMode
3142```
3143
3144**Description**
3145
3146Enumerates the modes of interpreting the geometry of a given vertex.
3147
3148**Since**: 12
3149
3150| Value| Description|
3151| -------- | -------- |
3152| VERTEX_MODE_TRIANGLES | Draws a triangle list. Specifically, a list of isolated triangles are drawn using every three vertices. If the number of vertices is not a multiple of 3, the extra vertices will be ignored. |
3153| VERTEX_MODE_TRIANGLESSTRIP | Draws a triangle strip. Specifically, the first triangle is drawn between the first 3 vertices, and all subsequent triangles use the previous 2 vertices plus the next additional vertex.|
3154| VERTEX_MODE_TRIANGLEFAN | Draws a triangle fan. A triangle fan is similar to a triangle strip, except that all the triangles share one vertex (the first vertex).|
3155
3156
3157### OH_Drawing_WordBreakType
3158
3159```
3160enum OH_Drawing_WordBreakType
3161```
3162
3163**Description**
3164
3165Enumerates the word break types.
3166
3167**Since**: 11
3168
3169| Value| Description|
3170| -------- | -------- |
3171| WORD_BREAK_TYPE_NORMAL | Normal mode.|
3172| WORD_BREAK_TYPE_BREAK_ALL | Breaks the words at any character to prevent overflow.|
3173| WORD_BREAK_TYPE_BREAK_WORD | Breaks the words at arbitrary points to prevent overflow.|
3174| WORD_BREAK_TYPE_BREAK_HYPHEN<sup>18+</sup>  | Uses a hyphen (-) to break a word at the end of each line. If adding a hyphen is not possible, it will behave the same as **WORD_BREAK_TYPE_BREAK_WORD**.|
3175
3176
3177
3178## Function Description
3179
3180### OH_Drawing_PathGetSegment()
3181
3182```
3183OH_Drawing_ErrorCode OH_Drawing_PathGetSegment (OH_Drawing_Path* path, bool forceClosed, float start, float stop, bool startWithMoveTo, OH_Drawing_Path* dst, bool* result)
3184```
3185
3186**Description**
3187
3188Extracts a segment of a path and appends it to a destination path.
3189
3190**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3191
3192**Since**: 18
3193
3194**Parameters**
3195
3196| Name| Description|
3197| -------- | -------- |
3198| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. |
3199| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status. |
3200| start | Distance from the start point of the path to the start point of the segment. If it is less than 0, it defaults to 0. If it is greater than or equal to **stop**, the extraction fails. |
3201| stop | Distance from the start point of the path to the end point of the segment. If it is less than or equal to **start**, the extraction fails. If it is greater than the path length, it defaults to the path length. |
3202| startWithMoveTo | Whether to execute [OH_Drawing_PathMoveTo](#oh_drawing_pathmoveto) in the destination path to move to its start point. The value **true** means to move to the start point, and **false** means the opposite. |
3203| dst | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object. If the extraction succeeds, the segment is appended to the path. If the extraction fails, nothing changes. |
3204| result | Pointer to the extraction result. The value **true** means that the extraction is successful, and **false** means the opposite.   |
3205
3206**Returns**
3207
3208Returns one of the following result codes:
3209
3210- **OH_DRAWING_SUCCESS** if the operation is successful.
3211
3212- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the **path**, **dst**, and **result** parameters is a null pointer.
3213
3214### OH_Drawing_CreateSumPathEffect()
3215
3216```
3217OH_Drawing_PathEffect* OH_Drawing_CreateSumPathEffect (OH_Drawing_PathEffect* firstPathEffect, OH_Drawing_PathEffect* secondPathEffect )
3218```
3219
3220**Description**
3221
3222Creates an overlay path effect based on two distinct path effects that take effect separately.
3223
3224**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3225
3226**Since**: 18
3227
3228**Parameters**
3229
3230| Name| Description|
3231| -------- | -------- |
3232| firstPathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. |
3233| secondPathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. |
3234
3235**Returns**
3236
3237Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
3238
3239If a null pointer is returned, the creation fails. The possible failure cause is that **firstPathEffect** or **secondPathEffect** is a null pointer.
3240
3241### OH_Drawing_CreatePathDashEffect()
3242
3243```
3244OH_Drawing_PathEffect* OH_Drawing_CreatePathDashEffect (const OH_Drawing_Path* path, float advance, float phase, OH_Drawing_PathDashStyle type )
3245```
3246
3247**Description**
3248
3249Creates an **OH_Drawing_PathEffect** object with a dashed line effect.
3250
3251**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3252
3253**Since**: 18
3254
3255**Parameters**
3256
3257| Name| Description|
3258| -------- | -------- |
3259| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. |
3260| advance | Length of each dashed line segment. |
3261| phase | Offset of the pattern within the dash segment length. |
3262| type | Style of the dashed path effect. |
3263
3264**Returns**
3265
3266Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
3267
3268If a null pointer is returned, the creation fails. The possible failure cause is that **path** is a null pointer or **advance** is less than or equal to **0**.
3269
3270### OH_Drawing_CreateDiscretePathEffect()
3271
3272```
3273OH_Drawing_PathEffect* OH_Drawing_CreateDiscretePathEffect (float segLength, float deviation )
3274```
3275
3276**Description**
3277
3278Creates a path effect that segments the path and scatters the segments in an irregular pattern along the path.
3279
3280**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3281
3282**Since**: 18
3283
3284**Parameters**
3285
3286| Name| Description|
3287| -------- | -------- |
3288| segLength | Distance along the path at which each segment is fragmented. An effect is created when it is greater than 0. |
3289| deviation | Maximum amount by which the end points of the segments can be randomly displaced during rendering. |
3290
3291**Returns**
3292
3293Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
3294
3295
3296### OH_Drawing_CreateCornerPathEffect()
3297
3298```
3299OH_Drawing_PathEffect* OH_Drawing_CreateCornerPathEffect (float radius)
3300```
3301
3302**Description**
3303
3304Creates a path effect that transforms the sharp angle between line segments into a rounded corner with the specified radius.
3305
3306**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3307
3308**Since**: 18
3309
3310**Parameters**
3311
3312| Name| Description|
3313| -------- | -------- |
3314| radius | Radius of the rounded corner. The value is valid only when it is greater than 0. |
3315
3316**Returns**
3317
3318Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
3319
3320If a null pointer is returned, the creation fails. The possible failure cause is that **radius** is less than or equal to **0**.
3321
3322
3323
3324### OH_Drawing_CreateComposePathEffect()
3325
3326```
3327OH_Drawing_PathEffect* OH_Drawing_CreateComposePathEffect (OH_Drawing_PathEffect* outer, OH_Drawing_PathEffect* inner )
3328```
3329
3330**Description**
3331
3332Creates a path effect by sequentially applying the inner effect and then the outer effect.
3333
3334**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3335
3336**Since**: 18
3337
3338**Parameters**
3339
3340| Name| Description|
3341| -------- | -------- |
3342| outer | Pointer to an outer effect, which is an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. |
3343| inner | Pointer to an inner effect, which is an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. |
3344
3345**Returns**
3346
3347Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
3348
3349If a null pointer is returned, the creation fails. The possible failure cause is that **inner** or **inner** is a null pointer.
3350
3351### OH_Drawing_GpuContextCreate()
3352
3353```
3354OH_Drawing_GpuContext* OH_Drawing_GpuContextCreate (void)
3355```
3356
3357**Description**
3358
3359Creates an **OH_Drawing_GpuContext** object, for which the backend type depends on the device.
3360
3361**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3362
3363**Since**: 16
3364
3365**Returns**
3366
3367Returns the pointer to the [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object created.
3368
3369
3370### OH_Drawing_CanvasDrawArcWithCenter()
3371
3372```
3373OH_Drawing_ErrorCode OH_Drawing_CanvasDrawArcWithCenter (OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, float startAngle, float sweepAngle, bool useCenter )
3374```
3375
3376**Description**
3377
3378Draws an arc. It enables you to define the starting angle, sweep angle, and whether the arc's endpoints should connect to its center.
3379
3380**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3381
3382**Since**: 18
3383
3384**Parameters**
3385
3386| Name| Description|
3387| -------- | -------- |
3388| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
3389| rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. |
3390| startAngle | Start angle, in degrees. The value is a floating point number. When the degree is 0, the start point is located at the right end of the oval. A positive number indicates that the start point is placed clockwise, and a negative number indicates that the start point is placed counterclockwise. |
3391| sweepAngle | Angle to sweep, in degrees. The value is a floating point number. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The swipe angle can exceed 360 degrees, and a complete ellipse is drawn. |
3392| useCenter | Whether the start point and end point of the arc are connected to its center. The value **true** means that they are connected to the center; the value **false** means the opposite. |
3393
3394**Returns**
3395
3396Returns one of the following result codes: **OH_DRAWING_SUCCESS** if the operation is successful. **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **inner** is NULL.
3397
3398### OH_Drawing_CanvasDrawNestedRoundRect()
3399
3400```
3401OH_Drawing_ErrorCode OH_Drawing_CanvasDrawNestedRoundRect (OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* outer, const OH_Drawing_RoundRect* inner )
3402```
3403
3404**Description**
3405
3406Draws two nested rounded rectangles. The outer rectangle boundary must contain the inner rectangle boundary. Otherwise, there is no drawing effect.
3407
3408**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3409
3410**Since**: 18
3411
3412**Parameters**
3413
3414| Name| Description|
3415| -------- | -------- |
3416| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
3417| outer | Pointer to the outer rectangle boundary, which is an [OH_Drawing_RoundRect](#oh_drawing_roundrect) object. |
3418| inner | Pointer to the inner rectangle boundary, which is an [OH_Drawing_RoundRect](#oh_drawing_roundrect) object. |
3419
3420**Returns**
3421
3422Returns one of the following result codes:
3423
3424- **OH_DRAWING_SUCCESS** if the operation is successful.
3425
3426- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **outer**, or **inner** is NULL.
3427
3428### OH_Drawing_CanvasQuickRejectPath()
3429
3430```
3431OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectPath (OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, bool* quickReject )
3432```
3433
3434**Description**
3435
3436
3437Checks whether the path is not intersecting with the canvas area. The canvas area includes its boundaries.
3438
3439**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3440
3441**Since**: 18
3442
3443**Parameters**
3444
3445| Name| Description|
3446| -------- | -------- |
3447| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
3448| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. |
3449| quickReject | Pointer to the check result. The value **true** means that the path is not intersecting with the canvas area, and **false** means the opposite. |
3450
3451**Returns**
3452
3453Returns one of the following result codes:
3454
3455**OH_DRAWING_SUCCESS** if the operation is successful.
3456
3457**OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **path**, or **quickReject** is NULL.
3458
3459### OH_Drawing_CanvasQuickRejectRect()
3460
3461```
3462OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectRect (OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, bool* quickReject )
3463```
3464
3465**Description**
3466
3467Checks whether the rectangle is not intersecting with the canvas area. The canvas area includes its boundaries.
3468
3469**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3470
3471**Since**: 18
3472
3473**Parameters**
3474
3475| Name| Description|
3476| -------- | -------- |
3477| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
3478| rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. |
3479| quickReject | Pointer to the check result. The value **true** means that the rectangle is not intersecting with the canvas area, and **false** means the opposite. |
3480
3481**Returns**
3482
3483Returns one of the following result codes:
3484
3485- **OH_DRAWING_SUCCESS** if the operation is successful.
3486
3487- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **rect**, or **quickReject** is NULL.
3488
3489### OH_Drawing_CanvasDrawPixelMapNine()
3490
3491```
3492OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapNine (OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, const OH_Drawing_Rect* center, const OH_Drawing_Rect* dst, OH_Drawing_FilterMode mode )
3493```
3494
3495**Description**
3496
3497Splits a PixelMap into nine sections using two horizontal and two vertical lines: four edge sections, four corner sections, and a central section. If the four corner sections are smaller than the target rectangle, they will be drawn in the target rectangle without scaling. Otherwise, they will be scaled to fit the target rectangle. Any remaining space will be filled by stretching or compressing the other five sections to cover the entire target rectangle.
3498
3499**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3500
3501**Since**: 18
3502
3503**Parameters**
3504
3505| Name| Description|
3506| -------- | -------- |
3507| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
3508| pixelMap | Pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object. |
3509| center | Pointer to the central rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. It divides the image into nine sections by extending its four edges. |
3510| dst | Pointer to the target rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. |
3511| mode | Filter mode. For details about available options, see [OH_Drawing_FilterMode](#oh_drawing_filtermode-1). |
3512
3513**Returns**
3514
3515Returns one of the following result codes:
3516
3517- **OH_DRAWING_SUCCESS** if the operation is successful.
3518
3519- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL.
3520
3521### OH_Drawing_SurfaceCreateOnScreen()
3522
3523```
3524OH_Drawing_Surface* OH_Drawing_SurfaceCreateOnScreen (OH_Drawing_GpuContext* gpuContext, OH_Drawing_Image_Info imageInfo, void* window )
3525```
3526**Description**
3527
3528Creates an **OH_Drawing_Surface** object bound to the window using the GPU context to manage the content drawn on the canvas.
3529
3530Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget). **OH_DRAWING_ERROR_INVALID_PARAMETER** if **gpuContext** or **window** is NULL.
3531
3532**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3533
3534**Since**: 16
3535
3536**Parameters**
3537
3538| Name| Description|
3539| -------- | -------- |
3540| gpuContext | Pointer to an [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object. This object must be created by [OH_Drawing_GpuContextCreate](#oh_drawing_gpucontextcreate). Otherwise, the **OH_Drawing_Surface** object fails to be created. |
3541| imageInfo | [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object. |
3542| window | Pointer to the window object. |
3543
3544**Returns**
3545
3546Returns the pointer to the [OH_Drawing_Surface](#oh_drawing_surface) object created.
3547
3548### OH_Drawing_SurfaceFlush()
3549
3550```
3551OH_Drawing_ErrorCode OH_Drawing_SurfaceFlush (OH_Drawing_Surface* surface)
3552```
3553
3554**Description**
3555
3556Pushes the drawing content from an **OH_Drawing_Surface** object to the GPU for rendering.
3557
3558**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3559
3560**Since**: 16
3561
3562**Parameters**
3563
3564| Name| Description|
3565| -------- | -------- |
3566| surface | Pointer to the [OH_Drawing_Surface](#oh_drawing_surface) object created. This object must be created by calling [OH_Drawing_SurfaceCreateOnScreen](#oh_drawing_surfacecreateonscreen). Otherwise, calling the current API has no effect. |
3567
3568**Returns**
3569
3570Returns one of the following result codes:
3571
3572- **OH_DRAWING_SUCCESS** if the operation is successful.
3573
3574- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **surface** is NULL.
3575
3576### OH_Drawing_ErrorCodeReset()
3577
3578```
3579void OH_Drawing_ErrorCodeReset (void )
3580```
3581
3582**Description**
3583
3584Resets the error code of this module to **OH_DRAWING_SUCCESS**.
3585
3586When a function that does not return an error code fails, the error code obtained through [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget) is reset to the corresponding error number. However, it is not reset to **OH_DRAWING_SUCCESS** for a successful operation.
3587
3588By calling this function, you can manually reset the error code to **OH_DRAWING_SUCCESS**, avoiding interference between different functions and simplifying the debugging process.
3589
3590**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3591
3592**Since**: 18
3593
3594### OH_Drawing_FontSetThemeFontFollowed()
3595
3596```
3597OH_Drawing_ErrorCode OH_Drawing_FontSetThemeFontFollowed (OH_Drawing_Font* font, bool followed )
3598```
3599
3600**Description**
3601
3602Sets whether to follow the theme font. When **followed** is set to **true**, the theme font is used if it is enabled by the system and no typeface is set.
3603
3604**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3605
3606**Since**: 15
3607
3608**Parameters**
3609
3610| Name| Description|
3611| -------- | -------- |
3612| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
3613| followed | Whether to follow the theme font. The value **true** means to follow the theme font, and **false** means the opposite.|
3614
3615**Returns**
3616
3617Returns one of the following result codes:
3618- **OH_DRAWING_SUCCESS** if the operation is successful.
3619- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **font** is NULL.
3620
3621### OH_Drawing_FontIsThemeFontFollowed()
3622
3623```
3624OH_Drawing_ErrorCode OH_Drawing_FontIsThemeFontFollowed (const OH_Drawing_Font* font, bool* followed )
3625```
3626
3627**Description**
3628
3629Checks whether the font follows the theme font. By default, the theme font is not followed.
3630
3631**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3632
3633**Since**: 15
3634
3635**Parameters**
3636
3637| Name| Description|
3638| -------- | -------- |
3639| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
3640| followed | Check result. The value **true** means that the theme font is followed, and **false** means the opposite.  |
3641
3642**Returns**
3643
3644Returns one of the following result codes:
3645- **OH_DRAWING_SUCCESS** if the operation is successful.
3646- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **font** or **followed** is NULL.
3647
3648### OH_Drawing_GetFontCollectionGlobalInstance()
3649
3650```
3651OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance (void )
3652```
3653**Description**
3654
3655Obtains the global **OH_Drawing_FontCollection** object, which can be used to sense the theme font information. Do not release the object.
3656
3657**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3658
3659**Since**: 14
3660
3661**Returns**
3662
3663Returns the pointer to the global {@link OH_Drawing_FontCollection} object obtained.
3664
3665### OH_Drawing_CreateLineTypography()
3666
3667```
3668OH_Drawing_LineTypography* OH_Drawing_CreateLineTypography (OH_Drawing_TypographyCreate* handler)
3669```
3670
3671**Description**
3672
3673Creates a pointer to an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object, which stores the text content and style and can be used to compute typography details for individual lines of text.
3674
3675**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3676
3677**Since**: 18
3678
3679**Parameters**
3680
3681| Name| Description|
3682| -------- | -------- |
3683| handler | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler).|
3684
3685**Returns**
3686
3687Returns the pointer to the [OH_Drawing_LineTypography](#oh_drawing_linetypography) object created.
3688
3689### OH_Drawing_DestroyLineTypography()
3690
3691```
3692void OH_Drawing_DestroyLineTypography (OH_Drawing_LineTypography* lineTypography)
3693```
3694
3695**Description**
3696
3697Releases the memory occupied by an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object.
3698
3699**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3700
3701**Since**: 18
3702
3703**Parameters**
3704
3705| Name| Description|
3706| -------- | -------- |
3707| lineTypography | Pointer to an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object, which is obtained by calling [OH_Drawing_CreateLineTypography](#oh_drawing_createlinetypography).|
3708
3709### OH_Drawing_LineTypographyGetLineBreak()
3710
3711```
3712size_t OH_Drawing_LineTypographyGetLineBreak (OH_Drawing_LineTypography* lineTypography, size_t startIndex, double width )
3713```
3714
3715**Description**
3716
3717Obtains the number of characters that can fit in the layout from the specified position within a limited layout width.
3718
3719**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3720
3721**Since**: 18
3722
3723**Parameters**
3724
3725| Name| Description|
3726| -------- | -------- |
3727| lineTypography | Pointer to an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object, which is obtained by calling [OH_Drawing_CreateLineTypography](#oh_drawing_createlinetypography).|
3728| startIndex | Start position (inclusive) for layout calculation. The value must be an integer in the range [0, total number of text characters].|
3729| width | Layout width. The value is a floating point number greater than 0, in px.|
3730
3731**Returns**
3732
3733Returns the number of characters.
3734
3735### OH_Drawing_LineTypographyCreateLine()
3736
3737```
3738OH_Drawing_TextLine* OH_Drawing_LineTypographyCreateLine (OH_Drawing_LineTypography* lineTypography, size_t startIndex, size_t count )
3739```
3740
3741**Description**
3742
3743Creates a pointer to an **OH_Drawing_TextLine** object based on the text content in a specified range.
3744
3745**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3746
3747**Since**: 18
3748
3749**Parameters**
3750
3751| Name| Description|
3752| -------- | -------- |
3753| lineTypography | Pointer to an [OH_Drawing_LineTypography](#oh_drawing_linetypography) object, which is obtained by calling [OH_Drawing_CreateLineTypography](#oh_drawing_createlinetypography).|
3754| startIndex | Start position for layout calculation. The value is an integer in the range [0, total number of text characters).|
3755| count | Number of characters from the specified start position. The value is an integer in the range [0, total number of text characters). The sum of **startIndex** and **count** cannot be greater than the total number of text characters. You can use [OH_Drawing_LineTypographyGetLineBreak](#oh_drawing_linetypographygetlinebreak) to obtain the number of characters that can fit in the layout. If **count** is set to 0, a null pointer is returned.|
3756
3757**Returns**
3758
3759Returns the pointer to the **OH_Drawing_TextLine** object created.
3760
3761### OH_Drawing_CreateTextTab()
3762
3763```
3764OH_Drawing_TextTab* OH_Drawing_CreateTextTab (OH_Drawing_TextAlign alignment, float location )
3765```
3766
3767**Description**
3768
3769Creates a text tab object.
3770
3771**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3772
3773**Since**: 18
3774
3775**Parameters**
3776
3777| Name| Description|
3778| -------- | -------- |
3779| alignment | Alignment mode of the text following the tab character. The value 1 means right alignment, 2 means center alignment, and 0 or other values mean left alignment.|
3780| float | Alignment position of the text following the tab character. The unit is px. The minimum value is 1.0.|
3781
3782**Returns**
3783
3784Returns the pointer to the **OH_Drawing_TextTab** object created. If a null pointer is returned, the creation fails. A possible cause is that no memory is available.
3785
3786### OH_Drawing_DestroyTextTab()
3787
3788```
3789void OH_Drawing_DestroyTextTab (OH_Drawing_TextTab* )
3790```
3791
3792**Description**
3793
3794Releases the memory occupied by a text tab object.
3795
3796**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3797
3798**Since**: 18
3799
3800**Parameters**
3801
3802| Name| Description|
3803| -------- | -------- |
3804| OH_Drawing_TextTab | Pointer to an **OH_Drawing_TextTab** object.|
3805
3806### OH_Drawing_GetTextTabAlignment()
3807
3808```
3809OH_Drawing_TextAlign OH_Drawing_GetTextTabAlignment (OH_Drawing_TextTab* )
3810```
3811
3812**Description**
3813
3814Obtains the alignment mode of a text tab.
3815
3816**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3817
3818**Since**: 18
3819
3820**Parameters**
3821
3822| Name| Description|
3823| -------- | -------- |
3824| OH_Drawing_TextTab | Pointer to an **OH_Drawing_TextTab** object.|
3825
3826**Returns**
3827
3828Returns the text alignment mode. The value 1 means right alignment, 2 means center alignment, and 0 or other values mean left alignment.
3829
3830### OH_Drawing_GetTextTabLocation()
3831
3832```
3833float OH_Drawing_GetTextTabLocation (OH_Drawing_TextTab* )
3834```
3835
3836**Description**
3837
3838Obtains the location of a text tab.
3839
3840**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3841
3842**Since**: 18
3843
3844**Parameters**
3845
3846| Name| Description|
3847| -------- | -------- |
3848| OH_Drawing_TextTab | Pointer to an **OH_Drawing_TextTab** object.|
3849
3850**Returns**
3851
3852Returns the position of the text tab.
3853
3854### OH_Drawing_SetTypographyTextTab()
3855
3856```
3857void OH_Drawing_SetTypographyTextTab (OH_Drawing_TypographyStyle* , OH_Drawing_TextTab* TextTab )
3858```
3859
3860**Description**
3861
3862Sets the alignment mode and location of a text tab. When the text alignment mode or ellipsis style is set, the tab does not take effect. When the tab location is less than 1.0, the tab is replaced with a space.
3863
3864**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3865
3866**Since**: 18
3867
3868**Parameters**
3869
3870| Name| Description|
3871| -------- | -------- |
3872| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object.|
3873| OH_Drawing_TextTab | Pointer to an **OH_Drawing_TextTab** object.|
3874
3875### OH_Drawing_FontGetBounds()
3876
3877```
3878OH_Drawing_ErrorCode OH_Drawing_FontGetBounds (const OH_Drawing_Font* font, const uint16_t* glyphs, uint32_t count, OH_Drawing_Array* bounds )
3879```
3880
3881**Description**
3882
3883Obtains the rectangular bounding box for each glyph in the glyph array.
3884
3885**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3886
3887**Since**: 18
3888
3889**Parameters**
3890
3891| Name| Description|
3892| -------- | -------- |
3893| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
3894| glyphs | Pointer to a glyph array.|
3895| count | Length of the glyph array.|
3896| bounds | Pointer to a rectangular bounding box array.|
3897
3898**Returns**
3899
3900Returns one of the following result codes:
3901- **OH_DRAWING_SUCCESS** if the operation is successful.
3902- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **font**, **glyphs**, or **bounds** is NULL or **count** is **0**.
3903
3904### OH_Drawing_FontGetPathForGlyph()
3905
3906```
3907OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph (const OH_Drawing_Font* font, uint16_t glyph, OH_Drawing_Path* path )
3908```
3909
3910**Description**
3911
3912Obtains the path of a glyph.
3913
3914**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3915
3916**Since**: 18
3917
3918**Parameters**
3919
3920| Name| Description|
3921| -------- | -------- |
3922| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
3923| glyph | Glyph index.|
3924| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object, which is used to store the glyph path.|
3925
3926**Returns**
3927
3928Returns one of the following result codes:
3929- **OH_DRAWING_SUCCESS** if the operation is successful.
3930- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **font** or **path** is NULL or the specified glyph does not exist.
3931
3932### OH_Drawing_RectCreateArray()
3933
3934```
3935OH_Drawing_Array* OH_Drawing_RectCreateArray (size_t size)
3936```
3937
3938**Description**
3939
3940Creates a rectangle array object to store multiple rectangle objects. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_RectDestroyArray](#oh_drawing_rectdestroyarray) to release the pointer to the object.
3941
3942**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3943
3944**Since**: 18
3945
3946**Parameters**
3947
3948| Name| Description|
3949| -------- | -------- |
3950| size | Size of the rectangle array. The value cannot exceed 65536, which is the maximum number of glyph indices.|
3951
3952**Returns**
3953
3954Returns the pointer to the [OH_Drawing_Array](#oh_drawing_array) object created. If the returned object pointer is null, the creation fails. Possible causes are that no memory is available or an input parameter is incorrect.
3955
3956### OH_Drawing_RectGetArraySize()
3957
3958```
3959OH_Drawing_ErrorCode OH_Drawing_RectGetArraySize (OH_Drawing_Array* rectArray, size_t* pSize )
3960```
3961
3962**Description**
3963
3964Obtains the size of a rectangle array, which is an [OH_Drawing_Array](#oh_drawing_array) object.
3965
3966**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3967
3968**Since**: 18
3969
3970**Parameters**
3971
3972| Name| Description|
3973| -------- | -------- |
3974| rectArray | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
3975| pSize | Pointer to the size_t type, which is used as an output parameter to store the size of the rectangle array.|
3976
3977**Returns**
3978
3979Returns one of the following result codes:
3980- **OH_DRAWING_SUCCESS** if the operation is successful.
3981- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **rectArray** or **pSize** is NULL.
3982
3983### OH_Drawing_RectGetArrayElement()
3984
3985```
3986OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement (OH_Drawing_Array* rectArray, size_t index, OH_Drawing_Rect** rect )
3987```
3988
3989**Description**
3990
3991Obtains the rectangle with the specified index in a rectangle array.
3992
3993**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
3994
3995**Since**: 18
3996
3997**Parameters**
3998
3999| Name| Description|
4000| -------- | -------- |
4001| rectArray | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
4002| index | Index of the rectangle array.|
4003| rect | Double pointer to [OH_Drawing_Rect](#oh_drawing_rect), which is returned to the caller as an output parameter.|
4004
4005**Returns**
4006
4007Returns one of the following result codes:
4008- **OH_DRAWING_SUCCESS** if the operation is successful.
4009- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **rectArray** or **rect** is null or **index** is out of range.
4010
4011### OH_Drawing_RectDestroyArray()
4012
4013```
4014OH_Drawing_ErrorCode OH_Drawing_RectDestroyArray (OH_Drawing_Array* rectArray)
4015```
4016
4017**Description**
4018
4019Destroys an **OH_Drawing_Array** object and reclaims the memory occupied by the object.
4020
4021**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4022
4023**Since**: 18
4024
4025**Parameters**
4026
4027| Name| Description|
4028| -------- | -------- |
4029| rectArray | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
4030
4031**Returns**
4032
4033Returns one of the following result codes:
4034- **OH_DRAWING_SUCCESS** if the operation is successful.
4035- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **rectArray** is NULL.
4036
4037### OH_Drawing_TypographyGetTextLines()
4038
4039```
4040OH_Drawing_Array* OH_Drawing_TypographyGetTextLines (OH_Drawing_Typography* typography)
4041```
4042
4043**Description**
4044
4045Obtains the array of text lines in a typography object. This array contains one or more text line objects. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyTextLines](#oh_drawing_destroytextlines) to release the pointer to the object.
4046
4047**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4048
4049**Since**: 18
4050
4051**Parameters**
4052
4053| Name| Description|
4054| -------- | -------- |
4055| typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object.|
4056
4057**Returns**
4058
4059Returns the pointer to the [OH_Drawing_Array](#oh_drawing_array) object obtained.
4060
4061### OH_Drawing_DestroyTextLines()
4062
4063```
4064void OH_Drawing_DestroyTextLines (OH_Drawing_Array* lines)
4065```
4066
4067**Description**
4068
4069Releases the memory occupied by a text line array.
4070
4071**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4072
4073**Since**: 18
4074
4075**Parameters**
4076
4077| Name| Description|
4078| -------- | -------- |
4079| lines | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
4080
4081### OH_Drawing_DestroyTextLine()
4082
4083```
4084void OH_Drawing_DestroyTextLine (OH_Drawing_TextLine* line)
4085```
4086
4087**Description**
4088
4089Releases the memory occupied by a text line object. This is applicable only to text line objects that have requested memory on their own and not to a particular text line object within a text line array.
4090
4091**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4092
4093**Since**: 18
4094
4095**Parameters**
4096
4097| Name| Description|
4098| -------- | -------- |
4099| line | Pointer to an **OH_Drawing_TextLine** object.|
4100
4101### OH_Drawing_GetTextLineByIndex()
4102
4103```
4104OH_Drawing_TextLine* OH_Drawing_GetTextLineByIndex (OH_Drawing_Array* lines, size_t index )
4105```
4106
4107**Description**
4108
4109Obtains the text line object with the specified index in a text line array.
4110
4111**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4112
4113**Since**: 18
4114
4115**Parameters**
4116
4117| Name| Description|
4118| -------- | -------- |
4119| lines | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
4120| index | Index of the text line array.|
4121
4122**Returns**
4123
4124Returns the pointer to the **OH_Drawing_TextLine** object obtained.
4125
4126### OH_Drawing_TextLineGetGlyphCount()
4127
4128```
4129double OH_Drawing_TextLineGetGlyphCount (OH_Drawing_TextLine* line)
4130```
4131
4132**Description**
4133
4134Obtains the number of glyphs in a text line object.
4135
4136**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4137
4138**Since**: 18
4139
4140**Parameters**
4141
4142| Name| Description|
4143| -------- | -------- |
4144| line | Pointer to an **OH_Drawing_TextLine** object.|
4145
4146**Returns**
4147
4148Returns the number of glyphs in the text line object.
4149
4150### OH_Drawing_TextLineGetTextRange()
4151
4152```
4153void OH_Drawing_TextLineGetTextRange (OH_Drawing_TextLine* line, size_t* start, size_t* end )
4154```
4155
4156**Description**
4157
4158Obtains the range of the text in a text line object in the entire paragraph.
4159
4160**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4161
4162**Since**: 18
4163
4164**Parameters**
4165
4166| Name| Description|
4167| -------- | -------- |
4168| line | Pointer to an **OH_Drawing_TextLine** object.|
4169| start | Pointer to the start of the range.|
4170| end | Pointer to the end of the range.|
4171
4172### OH_Drawing_TextLineGetGlyphRuns()
4173
4174```
4175OH_Drawing_Array* OH_Drawing_TextLineGetGlyphRuns (OH_Drawing_TextLine* line)
4176```
4177
4178**Description**
4179
4180Obtains the array of glyph runs in a text line object.
4181
4182**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4183
4184**Since**: 18
4185
4186**Parameters**
4187
4188| Name| Description|
4189| -------- | -------- |
4190| line | Pointer to an **OH_Drawing_TextLine** object.|
4191
4192**Returns**
4193
4194Returns the pointer to the [OH_Drawing_Array](#oh_drawing_array), which holds multiple **OH_Drawing_Run** objects. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyRuns](#oh_drawing_destroyruns) to release the pointer to the object.
4195
4196### OH_Drawing_DestroyRuns()
4197
4198```
4199void OH_Drawing_DestroyRuns (OH_Drawing_Array* runs)
4200```
4201
4202**Description**
4203
4204Releases the memory occupied by a glyph run array.
4205
4206**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4207
4208**Since**: 18
4209
4210**Parameters**
4211
4212| Name| Description|
4213| -------- | -------- |
4214| runs | Pointer to an [OH_Drawing_Array](#oh_drawing_array), which holds multiple **OH_Drawing_Run** objects.|
4215
4216### OH_Drawing_GetRunByIndex()
4217
4218```
4219OH_Drawing_Run* OH_Drawing_GetRunByIndex (OH_Drawing_Array* runs, size_t index )
4220```
4221
4222**Description**
4223
4224Obtains the glyph run object with the specified index in a glyph run array.
4225
4226**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4227
4228**Since**: 18
4229
4230**Parameters**
4231
4232| Name| Description|
4233| -------- | -------- |
4234| runs | Pointer to an [OH_Drawing_Array](#oh_drawing_array), which holds multiple **OH_Drawing_Run** objects.|
4235| index | Index of the glyph run array.|
4236
4237**Returns**
4238
4239Returns the pointer to the **OH_Drawing_Run** object obtained.
4240
4241### OH_Drawing_TextLinePaint()
4242
4243```
4244void OH_Drawing_TextLinePaint (OH_Drawing_TextLine* line, OH_Drawing_Canvas* canvas, double x, double y )
4245```
4246
4247**Description**
4248
4249Paints a text line on the canvas with the coordinate point (x, y) as the upper left corner.
4250
4251**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4252
4253**Since**: 18
4254
4255**Parameters**
4256
4257| Name| Description|
4258| -------- | -------- |
4259| line | Pointer to an **OH_Drawing_TextLine** object.|
4260| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
4261| x | Horizontal coordinate of the upper left corner, in px.|
4262| y | Vertical coordinate of the upper left corner, in px.|
4263
4264### OH_Drawing_TextLineCreateTruncatedLine()
4265
4266```
4267OH_Drawing_TextLine* OH_Drawing_TextLineCreateTruncatedLine (OH_Drawing_TextLine* line, double width, int mode, const char* ellipsis )
4268```
4269
4270**Description**
4271
4272Creates a truncated text line object.
4273
4274**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4275
4276**Since**: 18
4277
4278**Parameters**
4279
4280| Name| Description|
4281| -------- | -------- |
4282| line | Pointer to an **OH_Drawing_TextLine** object.|
4283| width | Line width after truncation.|
4284| mode | Truncation type. The value is an enumerated value of [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal). Currently, only **ELLIPSIS_MODAL_HEAD** and **ELLIPSIS_MODAL_TAIL** are supported.|
4285| ellipsis | Pointer to the string used to mark a truncation.|
4286
4287**Returns**
4288
4289Returns the pointer to the **OH_Drawing_TextLine** object created.
4290
4291### OH_Drawing_TextLineGetTypographicBounds()
4292
4293```
4294double OH_Drawing_TextLineGetTypographicBounds (OH_Drawing_TextLine* line, double* ascent, double* descent, double* leading )
4295```
4296
4297**Description**
4298
4299Obtains the typographic boundary of a text line object. The typographic boundary is related to the font and font size used for typography, but not the characters within the text. For example, for the string " a b " (which has a space before "a" and a space after "b"), the typographic boundary encompasses the spaces at the beginning and end. For the strings "j" and "E", the typographic boundaries are the same, indicating that they are irrelevant to specific characters.
4300
4301**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4302
4303**Since**: 18
4304
4305**Parameters**
4306
4307| Name| Description|
4308| -------- | -------- |
4309| line | Pointer to an **OH_Drawing_TextLine** object. height = ascent + descent + leading.|
4310| ascent | Pointer to the ascent of the text line object.|
4311| descent | Pointer to the descent of the text line object.|
4312| leading | Pointer to the leading of the text line object.|
4313
4314**Returns**
4315
4316Returns the total width of the layout boundary.
4317
4318### OH_Drawing_TextLineGetImageBounds()
4319
4320```
4321OH_Drawing_Rect* OH_Drawing_TextLineGetImageBounds (OH_Drawing_TextLine* line)
4322```
4323
4324**Description**
4325
4326Obtains the image boundary of a text line object.
4327
4328The image boundary, equivalent to a visual boundary, is related to the font, font size, and characters. For example, for the string " a b " (which has a space before "a" and a space after "b"), only "a b" are visible to users, and therefore the image boundary does not include these spaces at the beginning and end. For the strings "j" and "E", their image boundaries are different. Specifically, the width of the boundary for "j" is narrower than that for "E", and the height of the boundary for "j" is taller than that for "E".
4329
4330**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4331
4332**Since**: 18
4333
4334**Parameters**
4335
4336| Name| Description|
4337| -------- | -------- |
4338| line | Pointer to an **OH_Drawing_TextLine** object.|
4339
4340**Returns**
4341
4342Returns the pointer to [OH_Drawing_Rect](#oh_drawing_rect) of the text line object. When [OH_Drawing_Rect](#oh_drawing_rect) is no loner required, call [OH_Drawing_RectDestroy](#oh_drawing_rectdestroy) to release the pointer to the object.
4343
4344### OH_Drawing_TextLineGetTrailingSpaceWidth()
4345
4346```
4347double OH_Drawing_TextLineGetTrailingSpaceWidth (OH_Drawing_TextLine* line)
4348```
4349
4350**Description**
4351
4352Obtains the width of the spaces at the end of a text line object.
4353
4354**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4355
4356**Since**: 18
4357
4358**Parameters**
4359
4360| Name| Description|
4361| -------- | -------- |
4362| line | Pointer to an **OH_Drawing_TextLine** object.|
4363
4364**Returns**
4365
4366Returns the pointer to the width of the spaces.
4367
4368### OH_Drawing_TextLineGetStringIndexForPosition()
4369
4370```
4371int32_t OH_Drawing_TextLineGetStringIndexForPosition (OH_Drawing_TextLine* line, OH_Drawing_Point* point )
4372```
4373
4374**Description**
4375
4376Obtains the index of a character at the specified position in a text line object.
4377
4378**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4379
4380**Since**: 18
4381
4382**Parameters**
4383
4384| Name| Description|
4385| -------- | -------- |
4386| line | Pointer to an **OH_Drawing_TextLine** object.|
4387| point | Pointer to the position, which is an [OH_Drawing_Point](#oh_drawing_point) object.|
4388
4389**Returns**
4390
4391Returns the index of the character. For example, for the string "abc", the index of "a" is 0, the index of "b" is 1, and the index of "c" is 2. If the specified position is at "a", then **0** is returned.
4392
4393### OH_Drawing_TextLineGetOffsetForStringIndex()
4394
4395```
4396double OH_Drawing_TextLineGetOffsetForStringIndex (OH_Drawing_TextLine* line, int32_t index )
4397```
4398
4399**Description**
4400
4401Obtains the offset of a character with the specified index in a text line object.
4402
4403**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4404
4405**Since**: 18
4406
4407**Parameters**
4408
4409| Name| Description|
4410| -------- | -------- |
4411| line | Pointer to an **OH_Drawing_TextLine** object.|
4412| index | Index of the character.|
4413
4414**Returns**
4415
4416Returns the offset.
4417
4418### OH_Drawing_TextLineEnumerateCaretOffsets()
4419
4420```
4421void OH_Drawing_TextLineEnumerateCaretOffsets (OH_Drawing_TextLine* line, Drawing_CaretOffsetsCallback callback )
4422```
4423
4424**Description**
4425
4426Enumerates the offset and index of each character in a text line object and passes them to a custom callback function. You can use the offset and index array for other operations.
4427
4428**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4429
4430**Since**: 18
4431
4432**Parameters**
4433
4434| Name| Description|
4435| -------- | -------- |
4436| line | Pointer to an **OH_Drawing_TextLine** object.|
4437| callback | User-defined function, which is [Drawing_CaretOffsetsCallback](#drawing_caretoffsetscallback).|
4438
4439### OH_Drawing_TextLineGetAlignmentOffset()
4440
4441```
4442double OH_Drawing_TextLineGetAlignmentOffset (OH_Drawing_TextLine* line, double alignmentFactor, double alignmentWidth )
4443```
4444
4445**Description**
4446
4447Obtains the offset of a text line object after alignment based on the alignment factor and alignment width.
4448
4449**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4450
4451**Since**: 18
4452
4453**Parameters**
4454
4455| Name| Description|
4456| -------- | -------- |
4457| line | Pointer to an **OH_Drawing_TextLine** object.|
4458| alignmentFactor | Alignment factor, which determines how text is aligned. A value less than or equal to 0.0 means that the text is left-aligned; a value between 0.0 and 0.5 means that the text is slightly left-aligned; the value 0.5 means that is text is centered; a value between 0.5 and 1 means that the text is slightly right-aligned; a value greater than or equal to 1.0 means that the text is right-aligned.|
4459| alignmentWidth | Alignment width, that is, the offset of the lower right corner of the text line object relative to the start position. If the specified alignment width is less than the actual width of the text line object, **0** is returned.|
4460
4461**Returns**
4462
4463Returns the offset obtained.
4464
4465### OH_Drawing_AddTextStyleDecoration()
4466
4467```
4468void OH_Drawing_AddTextStyleDecoration (OH_Drawing_TextStyle* , int  )
4469```
4470
4471**Description**
4472
4473Adds the decoration for a text style. Multiple decoration lines can be displayed.
4474
4475**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4476
4477**Since**: 18
4478
4479**Parameters**
4480
4481| Name| Description|
4482| -------- | -------- |
4483| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle).|
4484| int | Decoration to add. The value **1** means to add an underline, **2** means to add an overline, and 4 means to add a strikethrough. You can add various text decorations in a single operation using bitwise OR. If you set decoration styles that are not defined in [OH_Drawing_TextDecoration](#oh_drawing_textdecoration), the existing decorations remain unchanged.|
4485
4486### OH_Drawing_RemoveTextStyleDecoration()
4487
4488```
4489void OH_Drawing_RemoveTextStyleDecoration (OH_Drawing_TextStyle* , int  )
4490```
4491
4492**Description**
4493
4494Removes the decoration for a text style.
4495
4496**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4497
4498**Since**: 18
4499
4500**Parameters**
4501
4502| Name| Description|
4503| -------- | -------- |
4504| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle).|
4505| int | Decoration to remove. The value **1** means to remove an underline, **2** means to remove an overline, and 4 means to remove a strikethrough. You can remove various text decorations in a single operation using bitwise OR.  If you set decoration styles that are not defined in [OH_Drawing_TextDecoration](#oh_drawing_textdecoration), the existing decorations remain unchanged.|
4506
4507### OH_Drawing_FontGetTextPath()
4508
4509```
4510OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath (const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path )
4511```
4512
4513**Description**
4514
4515Obtains the text outline path.
4516
4517**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4518
4519**Since**: 18
4520
4521**Parameters**
4522
4523| Name| Description|
4524| -------- | -------- |
4525| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
4526| text | Pointer to the text string.|
4527| byteLength | Length of the text path. If the length is greater than the length of the text string, undefined behavior occurs.|
4528| encoding | Text encoding format. UTF-8, UTF-16, UTF-32, and glyph indices are supported. For details about the format, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding).|
4529| x | X coordinate of the text in the drawing area, with the origin as the start point.|
4530| y | Y coordinate of the text in the drawing area, with the origin as the start point.|
4531| path | Pointer to the text outline path.|
4532
4533**Returns**
4534
4535Returns one of the following error codes: **IMAGE_RESULT_SUCCESS** if the operation is successful. **OH_DRAWING_ERROR_INVALID_PARAMETER** if any of **font**, **text**, and **path** is a null pointer.
4536
4537### OH_Drawing_GetDrawingArraySize()
4538
4539```
4540size_t OH_Drawing_GetDrawingArraySize (OH_Drawing_Array* drawingArray)
4541```
4542
4543**Description**
4544
4545Obtains the number of objects in an [OH_Drawing_Array](#oh_drawing_array).
4546
4547**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4548
4549**Since**: 14
4550
4551**Parameters**
4552
4553| Name| Description|
4554| -------- | -------- |
4555| drawingArray | Pointer to an [OH_Drawing_Array](#oh_drawing_array) object.|
4556
4557**Returns**
4558
4559Returns the number of objects in the array.
4560
4561
4562### OH_Drawing_GetRunStringIndices()
4563
4564```
4565OH_Drawing_Array* OH_Drawing_GetRunStringIndices (OH_Drawing_Run* run, int64_t start, int64_t length )
4566```
4567
4568**Description**
4569
4570Obtains an array of character indices of glyphs within a specified range of a run, where the indices are offsets relative to the entire paragraph.
4571
4572**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4573
4574**Since**: 18
4575
4576**Parameters**
4577
4578| Name| Description|
4579| -------- | -------- |
4580| run | Pointer to an **OH_Drawing_Run** object.|
4581| start | Start position in the run. If a negative number is passed, a null pointer is returned.|
4582| length | Length of the range in the run. If the length is 0, all character indices of the run are obtained. If the length is less than 0, a null pointer is returned.|
4583
4584**Returns**
4585
4586Returns the pointer to a character index array, which is an [OH_Drawing_Array](#oh_drawing_array) object. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyRunStringIndices](#oh_drawing_destroyrunstringindices) to release the pointer to the object.
4587
4588
4589### OH_Drawing_GetRunStringIndicesByIndex()
4590
4591```
4592uint64_t OH_Drawing_GetRunStringIndicesByIndex (OH_Drawing_Array* stringIndices, size_t index )
4593```
4594
4595**Description**
4596
4597Obtains character indices of glyphs in a run by index.
4598
4599**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4600
4601**Since**: 18
4602
4603**Parameters**
4604
4605| Name| Description|
4606| -------- | -------- |
4607| stringIndices | Pointer to a character index array.|
4608| index | Index of the character index array.|
4609
4610**Returns**
4611
4612Returns the character indices.
4613
4614
4615### OH_Drawing_DestroyRunStringIndices()
4616
4617```
4618void OH_Drawing_DestroyRunStringIndices (OH_Drawing_Array* stringIndices)
4619```
4620
4621**Description**
4622
4623Releases the pointer to a character index array object.
4624
4625**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4626
4627**Since**: 18
4628
4629**Parameters**
4630
4631| Name| Description|
4632| -------- | -------- |
4633| stringIndices | Pointer to a character index array.|
4634
4635
4636### OH_Drawing_GetRunStringRange()
4637
4638```
4639void OH_Drawing_GetRunStringRange (OH_Drawing_Run* run, uint64_t* location, uint64_t* length )
4640```
4641
4642**Description**
4643
4644Obtains the range of glyphs generated by a run.
4645
4646**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4647
4648**Since**: 18
4649
4650**Parameters**
4651
4652| Name| Description|
4653| -------- | -------- |
4654| run | Pointer to an **OH_Drawing_Run** object.|
4655| location | Start position of the range in the run, which is an offset relative to the entire paragraph.|
4656| length | Length of the range.|
4657
4658
4659### OH_Drawing_GetRunTypographicBounds()
4660
4661```
4662float OH_Drawing_GetRunTypographicBounds (OH_Drawing_Run* run, float* ascent, float* descent, float* leading )
4663```
4664
4665**Description**
4666
4667Obtains the typographic boundary of a run.
4668
4669The typographic boundary is related to the font and font size used for typography, but not the characters within the text.
4670
4671**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4672
4673**Since**: 18
4674
4675**Parameters**
4676
4677| Name| Description|
4678| -------- | -------- |
4679| run | Pointer to an **OH_Drawing_Run** object.|
4680| ascent | Distance from the top of the tallest character to the baseline in the run.|
4681| descent | Distance from the bottom of the lowest character to the baseline in the run.|
4682| leading | Vertical space between lines in the run.|
4683
4684**Returns**
4685
4686Returns the layout width of the run.
4687
4688
4689### OH_Drawing_RunPaint()
4690
4691```
4692void OH_Drawing_RunPaint (OH_Drawing_Canvas* canvas, OH_Drawing_Run* run, double x, double y )
4693```
4694
4695**Description**
4696
4697Paints the text contained in a run on the canvas.
4698
4699**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4700
4701**Since**: 18
4702
4703**Parameters**
4704
4705| Name| Description|
4706| -------- | -------- |
4707| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
4708| run | Pointer to an **OH_Drawing_Run** object.|
4709| x | X coordinate of the run.|
4710| y | Y coordinate of the run.|
4711
4712
4713### OH_Drawing_GetRunImageBounds()
4714
4715```
4716OH_Drawing_Rect* OH_Drawing_GetRunImageBounds (OH_Drawing_Run* run)
4717```
4718
4719**Description**
4720
4721Obtains the image boundary of a run.
4722
4723The image boundary is related to characters and is equivalent to the visual boundary.
4724
4725**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4726
4727**Since**: 18
4728
4729**Parameters**
4730
4731| Name| Description|
4732| -------- | -------- |
4733| run | Pointer to an **OH_Drawing_Run** object.|
4734
4735**Returns**
4736
4737Returns the pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which describes the image boundary of the run. When [OH_Drawing_Rect](#oh_drawing_rect) is no longer required, call [OH_Drawing_DestroyRunImageBounds](#oh_drawing_destroyrunimagebounds) to release the pointer to the object.
4738
4739
4740### OH_Drawing_DestroyRunImageBounds()
4741
4742```
4743void OH_Drawing_DestroyRunImageBounds (OH_Drawing_Rect* rect)
4744```
4745
4746**Description**
4747
4748Releases the pointer to an image boundary object of a run.
4749
4750**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4751
4752**Since**: 18
4753
4754**Parameters**
4755
4756| Name| Description|
4757| -------- | -------- |
4758| rect | Pointer to the image boundary, which is an [OH_Drawing_Rect](#oh_drawing_rect) object.|
4759
4760
4761### OH_Drawing_GetRunGlyphs()
4762
4763```
4764OH_Drawing_Array* OH_Drawing_GetRunGlyphs (OH_Drawing_Run* run, int64_t start, int64_t length )
4765```
4766
4767**Description**
4768
4769Obtains an array of glyphs within the specified range of a run.
4770
4771**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4772
4773**Since**: 18
4774
4775**Parameters**
4776
4777| Name| Description|
4778| -------- | -------- |
4779| run | Pointer to an **OH_Drawing_Run** object.|
4780| start | Start position of the run. If a negative number is passed, a null pointer is returned.|
4781| length | Length of the range in the run. If the length is 0, all character indices of the run are obtained. If the length is less than 0, a null pointer is returned.|
4782
4783**Returns**
4784
4785Returns the pointer to an [OH_Drawing_Array](#oh_drawing_array) object, which holds the glyphs. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyRunGlyphs](#oh_drawing_destroyrunglyphs) to release the pointer to the object.
4786
4787
4788### OH_Drawing_GetRunGlyphsByIndex()
4789
4790```
4791uint16_t OH_Drawing_GetRunGlyphsByIndex (OH_Drawing_Array* glyphs, size_t index )
4792```
4793
4794**Description**
4795
4796Obtains individual glyphs in a run by index.
4797
4798**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4799
4800**Since**: 18
4801
4802**Parameters**
4803
4804| Name| Description|
4805| -------- | -------- |
4806| glyphs | Pointer to the glyph array, which is an [OH_Drawing_Array](#oh_drawing_array) object.|
4807| index | Index of the glyph array.|
4808
4809**Returns**
4810
4811Returns the individual glyphs.
4812
4813
4814### OH_Drawing_DestroyRunGlyphs()
4815
4816```
4817void OH_Drawing_DestroyRunGlyphs (OH_Drawing_Array* glyphs)
4818```
4819
4820**Description**
4821
4822Releases the pointer to a glyph array in a run.
4823
4824**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4825
4826**Since**: 18
4827
4828**Parameters**
4829
4830| Name| Description|
4831| -------- | -------- |
4832| glyphs | Pointer to the glyph array, which is an [OH_Drawing_Array](#oh_drawing_array) object.|
4833
4834### OH_Drawing_GetRunPositions()
4835
4836```
4837OH_Drawing_Array* OH_Drawing_GetRunPositions (OH_Drawing_Run* run, int64_t start, int64_t length )
4838```
4839
4840**Description**
4841
4842Obtains the positions of glyphs within the specified range of a run.
4843
4844**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4845
4846**Since**: 18
4847
4848**Parameters**
4849
4850| Name| Description|
4851| -------- | -------- |
4852| run | Pointer to an **OH_Drawing_Run** object.|
4853| start | Start position in the run. If a negative number is passed, a null pointer is returned.|
4854| length | Length of the range in the run. If the length is 0, all character indices of the run are obtained. If the length is less than 0, a null pointer is returned.|
4855
4856**Returns**
4857
4858Returns the pointer to an [OH_Drawing_Array](#oh_drawing_array) object, which holds the glyph positions. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroyRunPositions](#oh_drawing_destroyrunpositions) to release the pointer to the object.
4859
4860### OH_Drawing_GetRunPositionsByIndex()
4861
4862```
4863OH_Drawing_Point* OH_Drawing_GetRunPositionsByIndex (OH_Drawing_Array* positions, size_t index )
4864```
4865
4866**Description**
4867
4868Obtains the positions of individual glyphs in a run by index.
4869
4870**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4871
4872**Since**: 18
4873
4874**Parameters**
4875
4876| Name| Description|
4877| -------- | -------- |
4878| positions | Pointer to the glyph position array, which is an [OH_Drawing_Array](#oh_drawing_array) object.|
4879| index | Index of the glyph position array in the run.|
4880
4881**Returns**
4882
4883Returns the pointer to an [OH_Drawing_Point](#oh_drawing_point) object, which holds the positions of individual glyphs in the run.
4884
4885
4886### OH_Drawing_DestroyRunPositions()
4887
4888```
4889void OH_Drawing_DestroyRunPositions (OH_Drawing_Array* positions)
4890```
4891
4892**Description**
4893
4894Releases the pointer to a glyph position array in a run.
4895
4896**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4897
4898**Since**: 18
4899
4900**Parameters**
4901
4902| Name| Description|
4903| -------- | -------- |
4904| positions | Pointer to the glyph position array, which is an [OH_Drawing_Array](#oh_drawing_array) object.|
4905
4906### OH_Drawing_GetRunGlyphCount()
4907
4908```
4909uint32_t OH_Drawing_GetRunGlyphCount (OH_Drawing_Run* run)
4910```
4911
4912**Description**
4913
4914Obtains the number of glyphs in a run.
4915
4916**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4917
4918**Since**: 18
4919
4920**Parameters**
4921
4922| Name| Description|
4923| -------- | -------- |
4924| run | Pointer to an **OH_Drawing_Run** object.|
4925
4926**Returns**
4927
4928Returns the number of glyphs.
4929
4930### OH_Drawing_MatchFontDescriptors()
4931
4932```
4933OH_Drawing_FontDescriptor* OH_Drawing_MatchFontDescriptors (OH_Drawing_FontDescriptor* , size_t*  )
4934```
4935
4936**Description**
4937
4938Obtains all system font descriptors that match a font descriptor. In the [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) struct, the **path** field is not used for matching, and other fields are valid only when they are not set to their default values. If all fields in [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) are set to their default values, all system font descriptors are returned. If no matching is found, NULL is returned. When [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) is no longer required, call [OH_Drawing_DestroyFontDescriptors](_drawing.md#oh_drawing_destroyfontdescriptors) to release the pointer to the object.
4939
4940**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4941
4942**Since**: 18
4943
4944**Parameters**
4945
4946| Name                                                        | Description                                                        |
4947| ------------------------------------------------------------ | ------------------------------------------------------------ |
4948| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Pointer to [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md). You are advised to use [OH_Drawing_CreateFontDescriptor](#oh_drawing_createfontdescriptor) to obtain a valid [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) instance. If you want to create an [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) instance, maintain the default values for the fields that are not used for matching|
4949| size_t                                                       | Pointer to the number of elements in the array.                                  |
4950
4951**Returns**
4952
4953Returns an [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) array, which must be released by calling [OH_Drawing_DestroyFontDescriptors](#oh_drawing_destroyfontdescriptors).
4954
4955### OH_Drawing_DestroyFontDescriptors()
4956
4957```
4958void OH_Drawing_DestroyFontDescriptors (OH_Drawing_FontDescriptor* , size_t  )
4959```
4960
4961**Description**
4962
4963Releases an array of [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) objects.
4964
4965**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4966
4967**Since**: 18
4968
4969**Parameters**
4970
4971| Name| Description|
4972| -------- | -------- |
4973| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Pointer to an array of [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) objects.|
4974| size_t | Number of [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) objects in the array.|
4975
4976### OH_Drawing_DestroySystemFontFullNames()
4977
4978```
4979void OH_Drawing_DestroySystemFontFullNames (OH_Drawing_Array* )
4980```
4981
4982**Description**
4983
4984Releases the memory occupied by the font name array obtained by font type.
4985
4986**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
4987
4988**Since**: 14
4989
4990**Parameters**
4991
4992| Name| Description|
4993| -------- | -------- |
4994| OH_Drawing_Array | Pointer to an [OH_Drawing_Array](#oh_drawing_array) that holds the font names.|
4995
4996### OH_Drawing_GetSystemFontFullNameByIndex()
4997
4998```
4999const OH_Drawing_String* OH_Drawing_GetSystemFontFullNameByIndex (OH_Drawing_Array* , size_t  )
5000```
5001
5002**Description**
5003
5004Obtains the font name with the specified index in the font name array.
5005
5006**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5007
5008**Since**: 14
5009
5010**Parameters**
5011
5012| Name| Description|
5013| -------- | -------- |
5014| OH_Drawing_Array | Pointer to an [OH_Drawing_Array](#oh_drawing_array) that holds the font names.|
5015| size_t | Index of the font in the array.|
5016
5017**Returns**
5018
5019Returns the pointer to the font name, which is an [OH_Drawing_String](_o_h___drawing___string.md) object.
5020
5021### OH_Drawing_GetSystemFontFullNamesByType()
5022
5023```
5024OH_Drawing_Array* OH_Drawing_GetSystemFontFullNamesByType (OH_Drawing_SystemFontType )
5025```
5026
5027**Description**
5028
5029Obtains an array of font names by font type.
5030
5031**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5032
5033**Since**: 14
5034
5035**Parameters**
5036
5037| Name| Description|
5038| -------- | -------- |
5039| OH_Drawing_SystemFontType | Font type, which is defined in [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype).|
5040
5041**Returns**
5042
5043Returns the pointer to an [OH_Drawing_Array](#oh_drawing_array), which holds the font names. When [OH_Drawing_Array](#oh_drawing_array) is no longer required, call [OH_Drawing_DestroySystemFontFullNames](#oh_drawing_destroysystemfontfullnames) to release the pointer to the object.
5044
5045### OH_Drawing_GetFontDescriptorByFullName()
5046
5047```
5048OH_Drawing_FontDescriptor* OH_Drawing_GetFontDescriptorByFullName (const OH_Drawing_String* , OH_Drawing_SystemFontType  )
5049```
5050
5051**Description**
5052
5053Obtains a font descriptor based on the font name and type. System fonts, style fonts, and user-installed fonts are supported. A font descriptor is a data structure that describes font features. It contains details of the font appearance and properties.
5054
5055**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5056
5057**Since**: 14
5058
5059**Parameters**
5060
5061| Name| Description|
5062| -------- | -------- |
5063| [OH_Drawing_String](_o_h___drawing___string.md) | Pointer to the font name, which is [OH_Drawing_String](_o_h___drawing___string.md).|
5064| OH_Drawing_SystemFontType | Font type, which is defined in [OH_Drawing_SystemFontType](#oh_drawing_systemfonttype).|
5065
5066**Returns**
5067
5068Returns the pointer to an [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object. When [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) is no longer required, call [OH_Drawing_DestroyFontDescriptor](#oh_drawing_destroyfontdescriptor) to release the pointer to the object.
5069
5070### OH_Drawing_TypefaceCreateFromFileWithArguments()
5071
5072```
5073OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFileWithArguments (const char* path, const OH_Drawing_FontArguments* fontArguments )
5074```
5075
5076**Description**
5077
5078Creates an **OH_Drawing_Typeface** object with font arguments through a file. If the **OH_Drawing_Typeface** object does not support the variation described in the font arguments, this function creates an **OH_Drawing_Typeface** object with the default font arguments. In this case, this function provides the same capability as [OH_Drawing_TypefaceCreateFromFile](#oh_drawing_typefacecreatefromfile).
5079
5080**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5081
5082**Since**: 13
5083
5084**Parameters**
5085
5086| Name| Description|
5087| -------- | -------- |
5088| path | Pointer to the file path.|
5089| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.|
5090
5091**Returns**
5092
5093Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **path** or **fontArguments** is NULL, or the path is invalid.
5094
5095
5096### OH_Drawing_TypefaceCreateFromCurrent()
5097
5098```
5099OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromCurrent (const OH_Drawing_Typeface* current, const OH_Drawing_FontArguments* fontArguments )
5100```
5101
5102**Description**
5103
5104Creates an **OH_Drawing_Typeface** object with font arguments based on an existing **OH_Drawing_Typeface** object.
5105
5106**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5107
5108**Since**: 13
5109
5110**Parameters**
5111
5112| Name| Description|
5113| -------- | -------- |
5114| current | Pointer to an [OH_Drawing_Typeface](#oh_drawing_typeface) object.|
5115| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.|
5116
5117**Returns**
5118
5119Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created. If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **path** or **fontArguments** is NULL, or the existing **OH_Drawing_FontArguments** object does not support the variation described in the font arguments.
5120
5121
5122### OH_Drawing_FontArgumentsAddVariation()
5123
5124```
5125OH_Drawing_ErrorCode OH_Drawing_FontArgumentsAddVariation (OH_Drawing_FontArguments* fontArguments, const char* axis, float value )
5126```
5127
5128**Description**
5129
5130Adds a variation to an **OH_Drawing_FontArguments** object.
5131
5132**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5133
5134**Since**: 13
5135
5136**Parameters**
5137
5138| Name| Description|
5139| -------- | -------- |
5140| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.|
5141| axis | Pointer to the label of the variation. The value must contain four ASCII characters. The supported labels depend on the loaded font file. For example, **'wght'** is the font weight label.|
5142| value | Value of the variation label.|
5143
5144**Returns**
5145
5146Returns one of the following result codes:
5147- **OH_DRAWING_SUCCESS** if the operation is successful.
5148- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **fontArguments** or **axis** is NULL or the length of **axis** is not 4.
5149
5150
5151### OH_Drawing_FontArgumentsCreate()
5152
5153```
5154OH_Drawing_FontArguments* OH_Drawing_FontArgumentsCreate (void)
5155```
5156
5157**Description**
5158
5159Creates an **OH_Drawing_FontArguments** object. The font arguments are used to create an **OH_Drawing_Typeface** object with custom attributes.
5160
5161**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5162
5163**Since**: 13
5164
5165**Returns**
5166
5167Returns the pointer to the **OH_Drawing_FontArguments** object created.
5168
5169
5170### OH_Drawing_FontArgumentsDestroy()
5171
5172```
5173OH_Drawing_ErrorCode OH_Drawing_FontArgumentsDestroy (OH_Drawing_FontArguments* fontArguments)
5174```
5175
5176**Description**
5177
5178Destroys an **OH_Drawing_FontArguments** object.
5179
5180**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5181
5182**Since**: 13
5183
5184**Parameters**
5185
5186| Name| Description|
5187| -------- | -------- |
5188| fontArguments | Pointer to an [OH_Drawing_FontArguments](#oh_drawing_fontarguments) object.|
5189
5190**Returns**
5191
5192Returns one of the following result codes:
5193- **OH_DRAWING_SUCCESS** if the operation is successful.
5194- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **fontArguments** is NULL.
5195
5196
5197### OH_Drawing_TypographyGetLongestLineWithIndent()
5198
5199```
5200double OH_Drawing_TypographyGetLongestLineWithIndent (OH_Drawing_Typography* )
5201```
5202
5203**Description**
5204
5205Obtains the width of the longest line of a typography object, including its indentation. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. You are advised to round up the return value. If the text content is empty, **0.0** is returned.
5206
5207**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5208
5209**Since**: 13
5210
5211**Parameters**
5212
5213| Name| Description|
5214| -------- | -------- |
5215| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography).|
5216
5217**Returns**
5218
5219Returns the width of the longest line, including its indentation, in px.
5220
5221
5222
5223### OH_Drawing_RecordCmdDestroy()
5224
5225```
5226OH_Drawing_ErrorCode OH_Drawing_RecordCmdDestroy (OH_Drawing_RecordCmd* recordCmd)
5227```
5228
5229**Description**
5230
5231Destroys an **OH_Drawing_RecordCmd** object and reclaims the memory occupied by the object.
5232
5233**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5234
5235**Since**: 13
5236
5237**Parameters**
5238
5239| Name| Description|
5240| -------- | -------- |
5241| recordCmd | Pointer to an [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object.|
5242
5243**Returns**
5244
5245Returns one of the following result codes:
5246- **OH_DRAWING_SUCCESS** if the operation is successful.
5247- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmd** is NULL.
5248
5249
5250### OH_Drawing_RecordCmdUtilsBeginRecording()
5251
5252```
5253OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsBeginRecording (OH_Drawing_RecordCmdUtils* recordCmdUtils, int32_t width, int32_t height, OH_Drawing_Canvas** canvas )
5254```
5255
5256**Description**
5257
5258Starts recording. This function must be used in pair with [OH_Drawing_RecordCmdUtilsFinishRecording](#oh_drawing_recordcmdutilsfinishrecording).
5259
5260The **OH_Drawing_RecordCmdUtils** object generates a canvas object of the recording type and calls the interface of the drawing object to record all drawing commands.
5261
5262**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5263
5264**Since**: 13
5265
5266**Parameters**
5267
5268| Name| Description|
5269| -------- | -------- |
5270| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.|
5271| width | Width of the canvas.|
5272| height | Height of the canvas.|
5273| canvas | Double pointer to the [OH_Drawing_Canvas](#oh_drawing_canvas) object. You do not need to release this pointer. This object does not support nested calling of [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd).|
5274
5275**Returns**
5276
5277Returns one of the following result codes:
5278- **OH_DRAWING_SUCCESS** if the operation is successful.
5279- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **canvas** is NULL.
5280- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **width** or **height** is less than 0.
5281- **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient.
5282
5283
5284### OH_Drawing_RecordCmdUtilsCreate()
5285
5286```
5287OH_Drawing_RecordCmdUtils* OH_Drawing_RecordCmdUtilsCreate (void )
5288```
5289
5290**Description**
5291
5292Creates an **OH_Drawing_RecordCmdUtils** object.
5293
5294**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5295
5296**Since**: 13
5297
5298**Returns**
5299
5300Returns the pointer to the **OH_Drawing_RecordCmdUtils** object created.
5301
5302
5303### OH_Drawing_RecordCmdUtilsDestroy()
5304
5305```
5306OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsDestroy (OH_Drawing_RecordCmdUtils* recordCmdUtils)
5307```
5308
5309**Description**
5310
5311Destroys an **OH_Drawing_RecordCmdUtils** object and reclaims the memory occupied by the object.
5312
5313**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5314
5315**Since**: 13
5316
5317**Parameters**
5318
5319| Name| Description|
5320| -------- | -------- |
5321| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.|
5322
5323**Returns**
5324
5325Returns one of the following result codes:
5326- **OH_DRAWING_SUCCESS** if the operation is successful.
5327- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmdUtils** is NULL.
5328
5329
5330### OH_Drawing_RecordCmdUtilsFinishRecording()
5331
5332```
5333OH_Drawing_ErrorCode OH_Drawing_RecordCmdUtilsFinishRecording (OH_Drawing_RecordCmdUtils* recordCmdUtils, OH_Drawing_RecordCmd** recordCmd )
5334```
5335
5336**Description**
5337
5338Ends recording. This function must be called after [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording).
5339
5340The **OH_Drawing_RecordCmdUtils** object ends recording and stores the drawing commands recorded by the canvas object of the recording type into the generated [OH_Drawing_RecordCmdUtilsBeginRecording](#oh_drawing_recordcmdutilsbeginrecording) object.
5341
5342**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5343
5344**Since**: 13
5345
5346**Parameters**
5347
5348| Name| Description|
5349| -------- | -------- |
5350| recordCmdUtils | Pointer to an [OH_Drawing_RecordCmdUtils](#oh_drawing_recordcmdutils) object.|
5351| recordCmd | Double pointer to the [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object. You need to call [OH_Drawing_CanvasDrawRecordCmd](#oh_drawing_canvasdrawrecordcmd) to draw the object, and call [OH_Drawing_RecordCmdDestroy](#oh_drawing_recordcmddestroy) to release it.|
5352
5353**Returns**
5354
5355Returns one of the following result codes:
5356- **OH_DRAWING_SUCCESS** if the operation is successful.
5357- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **recordCmd** is NULL.
5358- **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient.
5359
5360
5361### OH_Drawing_CanvasDrawRecordCmd()
5362
5363```
5364OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd (OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd )
5365```
5366
5367**Description**
5368
5369Draws an **OH_Drawing_RecordCmd** object.
5370
5371**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5372
5373**Since**: 13
5374
5375**Parameters**
5376
5377| Name| Description|
5378| -------- | -------- |
5379| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. Only a canvas of the recording type is supported.|
5380| recordCmd | Pointer to the [OH_Drawing_RecordCmd](#oh_drawing_recordcmd) object.|
5381
5382**Returns**
5383
5384Returns one of the following result codes:
5385- **OH_DRAWING_SUCCESS** if the operation is successful.
5386- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL.
5387
5388
5389
5390### OH_Drawing_TypographyDestroyTextBox()
5391
5392```
5393void OH_Drawing_TypographyDestroyTextBox (OH_Drawing_TextBox* )
5394```
5395
5396**Description**
5397
5398Releases the memory occupied by a text box.
5399
5400**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5401
5402**Since**: 12
5403
5404**Parameters**
5405
5406| Name| Description|
5407| -------- | -------- |
5408| OH_Drawing_TextBox | Pointer to an [OH_Drawing_TextBox](#oh_drawing_textbox) object.|
5409
5410
5411### OH_Drawing_SetTextShadow()
5412
5413```
5414void OH_Drawing_SetTextShadow (OH_Drawing_TextShadow* shadow, uint32_t color, OH_Drawing_Point* offset, double blurRadius )
5415```
5416
5417**Description**
5418
5419Sets a text shadow.
5420
5421**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5422
5423**Since**: 12
5424
5425**Parameters**
5426
5427| Name| Description|
5428| -------- | -------- |
5429| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow).|
5430| color | Color of the text shadow. For example, if the input parameter is 0xAABBCCDD, AA indicates opacity, BB indicates the value of the red component, CC indicates the value of the green component, and DD indicates the value of the blue component.|
5431| OH_Drawing_Point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object, which is the position of the text shadow relative to the text.|
5432| blurRadius | Blur radius. The value is a floating point number and has no unit. The value **0.0** means that there is no blur effect.|
5433
5434
5435
5436### OH_Drawing_CanvasDrawSingleCharacter()
5437
5438```
5439OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacter (OH_Drawing_Canvas* canvas, const char* str, const OH_Drawing_Font* font, float x, float y )
5440```
5441
5442**Description**
5443
5444Draws a single character. If the typeface of the current font does not support the character to draw, the system typeface is used to draw the character.
5445
5446**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5447
5448**Since**: 12
5449
5450**Parameters**
5451
5452| Name| Description|
5453| -------- | -------- |
5454| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5455| str | Pointer to the single character to draw. A string can be passed in, but only the first character in the string is parsed and drawn in UTF-8 encoding.|
5456| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
5457| x | X coordinate of the left point of the character baseline.|
5458| y | Y coordinate of the left point of the character baseline.|
5459
5460**Returns**
5461
5462Returns one of the following result codes:
5463- **OH_DRAWING_SUCCESS** if the operation is successful.
5464- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, or **font** is NULL, or the length of **str** is **0**.
5465
5466
5467
5468### OH_Drawing_FontMeasureSingleCharacter()
5469
5470```
5471OH_Drawing_ErrorCode OH_Drawing_FontMeasureSingleCharacter (const OH_Drawing_Font* font, const char* str, float* textWidth )
5472```
5473
5474**Description**
5475
5476Measures the width of a single character. If the typeface of the current font does not support the character to measure, the system typeface is used to measure the character width.
5477
5478**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5479
5480**Since**: 12
5481
5482**Parameters**
5483
5484| Name| Description|
5485| -------- | -------- |
5486| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
5487| str | Pointer to the single character to measure. A string can be passed in, but only the first character in the string is parsed and measured in UTF-8 encoding.|
5488| textWidth | Pointer to the character width obtained.|
5489
5490**Returns**
5491
5492Returns one of the following result codes:
5493- **OH_DRAWING_SUCCESS** if the operation is successful.
5494- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **str**, or **textWidth** is NULL, or the length of **str** is **0**.
5495
5496
5497
5498### OH_Drawing_TypographyPaintOnPath()
5499
5500```
5501void OH_Drawing_TypographyPaintOnPath (OH_Drawing_Typography* , OH_Drawing_Canvas* , OH_Drawing_Path* , double , double  )
5502```
5503
5504**Description**
5505
5506Draws text along a path.
5507
5508**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5509
5510**Since**: 12
5511
5512**Parameters**
5513
5514| Name| Description|
5515| -------- | -------- |
5516| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography).|
5517| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object, which is obtained by calling [OH_Drawing_CanvasCreate](#oh_drawing_canvascreate).|
5518| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object, which is obtained by calling [OH_Drawing_PathCreate](#oh_drawing_pathcreate).|
5519| double | Horizontal offset along the path direction. A positive number indicates a position that is ahead along the path from its start point, and a negative number indicates a position that is behind from the start point.|
5520| double | Vertical offset along the path direction. A positive number indicates a position on the left side of the path, and a negative number indicates a position on the right side of the path.|
5521
5522
5523### OH_Drawing_RoundRectOffset()
5524
5525```
5526OH_Drawing_ErrorCode OH_Drawing_RoundRectOffset (OH_Drawing_RoundRect* roundRect, float dx, float dy )
5527```
5528
5529**Description**
5530
5531Translates a rounded rectangle by an offset along the X axis and Y axis.
5532
5533**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5534
5535**Since**: 12
5536
5537**Parameters**
5538
5539| Name| Description|
5540| -------- | -------- |
5541| roundRect | Pointer to an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) object.|
5542| dx | X offset.|
5543| dy | Y offset.|
5544
5545**Returns**
5546
5547Returns one of the following result codes:
5548- **OH_DRAWING_SUCCESS** if the operation is successful.
5549- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **roundRect** is NULL.
5550
5551
5552### OH_Drawing_PointGetX()
5553
5554```
5555OH_Drawing_ErrorCode OH_Drawing_PointGetX (const OH_Drawing_Point* point, float* x )
5556```
5557
5558**Description**
5559
5560Obtains the X coordinate of a point.
5561
5562**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5563
5564**Since**: 12
5565
5566**Parameters**
5567
5568| Name| Description|
5569| -------- | -------- |
5570| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.|
5571| x | Pointer to the X coordinate.|
5572
5573**Returns**
5574
5575Returns one of the following result codes:
5576- **OH_DRAWING_SUCCESS** if the operation is successful.
5577- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **x** is NULL.
5578
5579
5580### OH_Drawing_PointGetY()
5581
5582```
5583OH_Drawing_ErrorCode OH_Drawing_PointGetY (const OH_Drawing_Point* point, float* y )
5584```
5585
5586**Description**
5587
5588Obtains the Y coordinate of a point.
5589
5590**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5591
5592**Since**: 12
5593
5594**Parameters**
5595
5596| Name| Description|
5597| -------- | -------- |
5598| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.|
5599| y | Pointer to the Y coordinate.|
5600
5601**Returns**
5602
5603Returns one of the following result codes:
5604- **OH_DRAWING_SUCCESS** if the operation is successful.
5605- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **y** is NULL.
5606
5607
5608### OH_Drawing_PointSet()
5609
5610```
5611OH_Drawing_ErrorCode OH_Drawing_PointSet (OH_Drawing_Point* point, float x, float y )
5612```
5613
5614**Description**
5615
5616Sets the X and Y coordinates of a point.
5617
5618**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5619
5620**Since**: 12
5621
5622**Parameters**
5623
5624| Name| Description|
5625| -------- | -------- |
5626| point | Pointer to an [OH_Drawing_Point](#oh_drawing_point) object.|
5627| x | Pointer to the X coordinate.|
5628| y | Pointer to the Y coordinate.|
5629
5630**Returns**
5631
5632Returns one of the following result codes:
5633- **OH_DRAWING_SUCCESS** if the operation is successful.
5634- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **point** is NULL.
5635
5636
5637### OH_Drawing_FontMeasureText()
5638
5639```
5640OH_Drawing_ErrorCode OH_Drawing_FontMeasureText (const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, OH_Drawing_Rect* bounds, float* textWidth )
5641```
5642
5643**Description**
5644
5645Obtains the text width and bounding box.
5646
5647**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5648
5649**Since**: 12
5650
5651**Parameters**
5652
5653| Name| Description|
5654| -------- | -------- |
5655| font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
5656| text | Pointer to the text.|
5657| byteLength | Length of the text, in bytes.|
5658| encoding | Encoding type of the text.|
5659| bounds | Pointer to the bounding box. The value can be NULL.|
5660| textWidth | Pointer to the text width.|
5661
5662**Returns**
5663
5664Returns one of the following result codes:
5665- **OH_DRAWING_SUCCESS** if the operation is successful.
5666- **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **text**, and **textWidth** is NULL, or **byteLength** is **0**.
5667
5668
5669### OH_Drawing_CanvasClipRegion()
5670
5671```
5672OH_Drawing_ErrorCode OH_Drawing_CanvasClipRegion (OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region, OH_Drawing_CanvasClipOp clipOp )
5673```
5674
5675**Description**
5676
5677Clips a rectangle.
5678
5679**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5680
5681**Since**: 12
5682
5683**Parameters**
5684
5685| Name| Description|
5686| -------- | -------- |
5687| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5688| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.|
5689| clipOp | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop).|
5690
5691**Returns**
5692
5693Returns one of the following result codes:
5694- **OH_DRAWING_SUCCESS** if the operation is successful.
5695- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **region** is NULL.
5696- **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **clipOp** is not set to one of the enumerated values.
5697
5698
5699### OH_Drawing_CanvasDrawColor()
5700
5701```
5702OH_Drawing_ErrorCode OH_Drawing_CanvasDrawColor (OH_Drawing_Canvas* canvas, uint32_t color, OH_Drawing_BlendMode blendMode )
5703```
5704
5705**Description**
5706
5707Fills the entire canvas with the specified color and blend mode.
5708
5709**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5710
5711**Since**: 12
5712
5713**Parameters**
5714
5715| Name| Description|
5716| -------- | -------- |
5717| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5718| color | Color, represented by a 32-bit (ARGB) variable.|
5719| blendMode | Blend mode.|
5720
5721**Returns**
5722
5723Returns one of the following result codes:
5724- **OH_DRAWING_SUCCESS** if the operation is successful.
5725- **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas** is NULL.
5726- **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **blendMode** is not set to one of the enumerated values.
5727
5728
5729### OH_Drawing_CanvasGetImageInfo()
5730
5731```
5732OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo (OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo )
5733```
5734
5735**Description**
5736
5737Obtains the image information of a canvas.
5738
5739**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5740
5741**Since**: 12
5742
5743**Parameters**
5744
5745| Name| Description|
5746| -------- | -------- |
5747| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5748| imageInfo | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.|
5749
5750**Returns**
5751
5752Returns one of the following result codes:
5753- **OH_DRAWING_SUCCESS** if the operation is successful.
5754- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **imageInfo** is NULL.
5755
5756
5757### OH_Drawing_CanvasIsClipEmpty()
5758
5759```
5760OH_Drawing_ErrorCode OH_Drawing_CanvasIsClipEmpty (OH_Drawing_Canvas* canvas, bool* isClipEmpty )
5761```
5762
5763**Description**
5764
5765Checks whether the region that can be drawn is empty after cropping.
5766
5767**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5768
5769**Since**: 12
5770
5771**Parameters**
5772
5773| Name| Description|
5774| -------- | -------- |
5775| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5776| isClipEmpty | Pointer to the variable that specifies whether the region is empty. The value **true** means that the region is empty, and **false** means the opposite.|
5777
5778**Returns**
5779
5780Returns one of the following result codes:
5781- **OH_DRAWING_SUCCESS** if the operation is successful.
5782- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **isClipEmpty** is NULL.
5783
5784
5785### OH_Drawing_CanvasDrawPoint()
5786
5787```
5788OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPoint (OH_Drawing_Canvas* canvas, const OH_Drawing_Point2D* point )
5789```
5790
5791**Description**
5792
5793Draws a point.
5794
5795**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5796
5797**Since**: 12
5798
5799**Parameters**
5800
5801| Name| Description|
5802| -------- | -------- |
5803| canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object.|
5804| point | Pointer to an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) object.|
5805
5806**Returns**
5807
5808Returns one of the following result codes:
5809- **OH_DRAWING_SUCCESS** if the operation is successful.
5810- **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **point** is NULL.
5811
5812
5813### OH_Drawing_MatrixGetAll()
5814
5815```
5816OH_Drawing_ErrorCode OH_Drawing_MatrixGetAll (OH_Drawing_Matrix* matrix, float value[9] )
5817```
5818
5819**Description**
5820
5821Obtains all element values of a matrix.
5822
5823**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5824
5825**Since**: 12
5826
5827**Parameters**
5828
5829| Name| Description|
5830| -------- | -------- |
5831| matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.|
5832| value | Array used to store the obtained element values.|
5833
5834**Returns**
5835
5836Returns one of the following result codes:
5837- **OH_DRAWING_SUCCESS** if all element values of the matrix are successfully obtained.
5838- **OH_DRAWING_ERROR_INVALID_PARAMETER** if the matrix element values fail to be obtained. The failure cause is that **matrix** or **value** is NULL.
5839
5840
5841
5842### OH_Drawing_ErrorCodeGet()
5843
5844```
5845OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet ()
5846```
5847
5848**Description**
5849
5850Obtains the latest error code of the module. After the function is successfully executed, the error code returned by this function will not be modified.
5851
5852**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5853
5854**Since**: 12
5855
5856**Returns**
5857
5858Returns the enumerated values of the error code.
5859
5860### OH_Drawing_BrushCopy()
5861
5862```
5863OH_Drawing_Brush* OH_Drawing_BrushCopy (OH_Drawing_Brush* brush)
5864```
5865
5866**Description**
5867
5868Copies an existing [OH_Drawing_Brush](#oh_drawing_brush) object to create a new one.
5869
5870Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
5871
5872If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
5873
5874**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5875
5876**Since**: 12
5877
5878**Parameters**
5879
5880| Name| Description|
5881| -------- | -------- |
5882| brush | Pointer to an **OH_Drawing_Brush** object.|
5883
5884**Returns**
5885
5886Returns the pointer to the [OH_Drawing_Brush](#oh_drawing_brush) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **brush** is NULL.
5887
5888
5889
5890### OH_Drawing_FilterSetImageFilter()
5891
5892```
5893void OH_Drawing_FilterSetImageFilter (OH_Drawing_Filter* , OH_Drawing_ImageFilter* )
5894```
5895
5896**Description**
5897
5898Sets an **OH_Drawing_ImageFilter** object for an **OH_Drawing_Filter** object.
5899
5900Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
5901
5902If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
5903
5904**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5905
5906**Since**: 12
5907
5908**Parameters**
5909
5910| Name| Description|
5911| -------- | -------- |
5912| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object.|
5913| OH_Drawing_ImageFilter | Pointer to an [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object. If NULL is passed in, the image filter effect of the object will be cleared.|
5914
5915
5916### OH_Drawing_ImageFilterCreateBlur()
5917
5918```
5919OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur (float sigmaX, float sigmaY, OH_Drawing_TileMode , OH_Drawing_ImageFilter* input )
5920```
5921
5922**Description**
5923
5924Creates an **OH_Drawing_ImageFilter** object with a given blur type.
5925
5926**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5927
5928**Since**: 12
5929
5930**Parameters**
5931
5932| Name| Description|
5933| -------- | -------- |
5934| sigmaX | Standard deviation of the Gaussian blur to apply along the X axis. The value must be greater than 0.|
5935| sigmaY | Standard deviation of the Gaussian blur to apply along the Y axis. The value must be greater than 0.|
5936| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).|
5937| input | Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image filter is directly applied to the original image.|
5938
5939**Returns**
5940
5941Returns the pointer to the [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available.
5942
5943
5944### OH_Drawing_ImageFilterCreateFromColorFilter()
5945
5946```
5947OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter (OH_Drawing_ColorFilter* colorFilter, OH_Drawing_ImageFilter* input )
5948```
5949
5950**Description**
5951
5952Creates an **OH_Drawing_ImageFilter** object with a color filter effect.
5953
5954Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
5955
5956If **colorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
5957
5958**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5959
5960**Since**: 12
5961
5962**Parameters**
5963
5964| Name| Description|
5965| -------- | -------- |
5966| colorFilter | Pointer to an [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) object.|
5967| input | Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image filter is directly applied to the original image.|
5968
5969**Returns**
5970
5971Returns the pointer to the [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **colorFilter** is NULL.
5972
5973
5974### OH_Drawing_ImageFilterDestroy()
5975
5976```
5977void OH_Drawing_ImageFilterDestroy (OH_Drawing_ImageFilter* )
5978```
5979
5980**Description**
5981
5982Destroys an **OH_Drawing_ImageFilter** object and reclaims the memory occupied by the object.
5983
5984**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
5985
5986**Since**: 12
5987
5988**Parameters**
5989
5990| Name| Description|
5991| -------- | -------- |
5992| OH_Drawing_ImageFilter | Pointer to an [OH_Drawing_ImageFilter](#oh_drawing_imagefilter) object.|
5993
5994
5995### OH_Drawing_MatrixMapPoints()
5996
5997```
5998void OH_Drawing_MatrixMapPoints (const OH_Drawing_Matrix* , const OH_Drawing_Point2D* src, OH_Drawing_Point2D* dst, int count )
5999```
6000
6001**Description**
6002
6003Maps a source point array to a destination point array by means of matrix transformation.
6004
6005Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6006
6007If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6008
6009**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6010
6011**Since**: 12
6012
6013**Parameters**
6014
6015| Name| Description|
6016| -------- | -------- |
6017| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.|
6018| src | Array of source points.|
6019| dst | Array of destination points. The number of destination points must be the same as that of source points.|
6020| count | Number of source points or destination points.|
6021
6022
6023### OH_Drawing_MatrixMapRect()
6024
6025```
6026bool OH_Drawing_MatrixMapRect (const OH_Drawing_Matrix* , const OH_Drawing_Rect* src, OH_Drawing_Rect* dst )
6027```
6028
6029**Description**
6030
6031Maps a rectangle to the smallest rectangle that can enclose the vertices to which the four source vertices are mapped by means of matrix transformation.
6032
6033Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6034
6035If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
6036
6037**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6038
6039**Since**: 12
6040
6041**Parameters**
6042
6043| Name| Description|
6044| -------- | -------- |
6045| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object.|
6046| src | Pointer to the source rectangle.|
6047| dst | Pointer to the destination rectangle.|
6048
6049**Returns**
6050
6051Returns **true** if the source rectangle is equal to the destination rectangle; returns **false** otherwise.
6052
6053
6054### OH_Drawing_PathAddPolygon()
6055
6056```
6057void OH_Drawing_PathAddPolygon (OH_Drawing_Path* path, const OH_Drawing_Point2D* points, uint32_t count, bool isClosed )
6058```
6059
6060**Description**
6061
6062Adds a polygon to a path.
6063
6064Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6065
6066If either **path** or **points** is NULL or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6067
6068**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6069
6070**Since**: 12
6071
6072**Parameters**
6073
6074| Name| Description|
6075| -------- | -------- |
6076| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object.|
6077| points | Pointer to an array that holds the vertex coordinates of the polygon.|
6078| count | Size of the array.|
6079| isClosed | Whether the path is closed. The value **true** means that the path is closed, and **false** means the opposite.|
6080
6081
6082### OH_Drawing_PathAddCircle()
6083
6084```
6085void OH_Drawing_PathAddCircle (OH_Drawing_Path* path, float x, float y, float radius, OH_Drawing_PathDirection  )
6086```
6087
6088**Description**
6089
6090Adds a circle to a path in the specified direction.
6091
6092Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6093
6094If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6095
6096If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6097
6098If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6099
6100**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6101
6102**Since**: 12
6103
6104**Parameters**
6105
6106| Name| Description|
6107| -------- | -------- |
6108| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6109| x | X coordinate of the circle center.|
6110| y | Y coordinate of the circle center.|
6111| radius | Radius of the circle.|
6112| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection).|
6113
6114
6115### OH_Drawing_PathBuildFromSvgString()
6116
6117```
6118bool OH_Drawing_PathBuildFromSvgString (OH_Drawing_Path* path, const char* str )
6119```
6120
6121**Description**
6122
6123Parses the path represented by an SVG string.
6124
6125Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6126
6127If either **path** or **str** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6128
6129**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6130
6131**Since**: 12
6132
6133**Parameters**
6134
6135| Name| Description|
6136| -------- | -------- |
6137| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6138| str | Pointer to the SVG string.|
6139
6140**Returns**
6141
6142Returns **true** if the SVG string is parsed successfully; returns **false** otherwise.
6143
6144
6145### OH_Drawing_PathGetBounds()
6146
6147```
6148void OH_Drawing_PathGetBounds (OH_Drawing_Path* , OH_Drawing_Rect*  )
6149```
6150
6151**Description**
6152
6153Obtains the minimum bounds that enclose a path.
6154
6155Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6156
6157If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6158
6159**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6160
6161**Since**: 12
6162
6163**Parameters**
6164
6165| Name| Description|
6166| -------- | -------- |
6167| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6168| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.|
6169
6170
6171### OH_Drawing_PathIsClosed()
6172
6173```
6174bool OH_Drawing_PathIsClosed (OH_Drawing_Path* path, bool forceClosed )
6175```
6176
6177**Description**
6178
6179Checks whether a path is closed.
6180
6181Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6182
6183If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6184
6185**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6186
6187**Since**: 12
6188
6189**Parameters**
6190
6191| Name| Description|
6192| -------- | -------- |
6193| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6194| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.|
6195
6196**Returns**
6197
6198Returns **true** if the path is closed; returns **false** otherwise.
6199
6200
6201### OH_Drawing_PathGetPositionTangent()
6202
6203```
6204bool OH_Drawing_PathGetPositionTangent (OH_Drawing_Path* path, bool forceClosed, float distance, OH_Drawing_Point2D* position, OH_Drawing_Point2D* tangent )
6205```
6206
6207**Description**
6208
6209Obtains the coordinates and tangent at a distance from the start point of a path.
6210
6211Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6212
6213If any of **path**, **position**, or **tangent** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6214
6215**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6216
6217**Since**: 12
6218
6219**Parameters**
6220
6221| Name| Description|
6222| -------- | -------- |
6223| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6224| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.|
6225| distance | Distance from the start point. If a negative number is passed in, the value **0** is used. If a value greater than the path length is passed in, the path length is used.|
6226| position | Pointer to the coordinates.|
6227| tangent | Pointer to the tangent, where **tangent.x** and **tangent.y** represent the cosine and sine of the tangent of the point, respectively.|
6228
6229**Returns**
6230
6231Returns **true** if the operation is successful; returns **false** otherwise.
6232
6233
6234### OH_Drawing_PathOp()
6235
6236```
6237bool OH_Drawing_PathOp (OH_Drawing_Path* path, const OH_Drawing_Path* other, OH_Drawing_PathOpMode op )
6238```
6239
6240**Description**
6241
6242Combines two paths based on the specified operation mode.
6243
6244Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6245
6246If either **path** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6247
6248If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6249
6250**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6251
6252**Since**: 12
6253
6254**Parameters**
6255
6256| Name| Description|
6257| -------- | -------- |
6258| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object, in which the resulting path is saved.|
6259| other | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6260| op | Operation mode of the path. For details about the available options, see [OH_Drawing_PathOpMode](#oh_drawing_pathopmode).|
6261
6262**Returns**
6263
6264Returns **true** if the resulting path is not empty; returns **false** otherwise.
6265
6266
6267### OH_Drawing_PathGetMatrix()
6268
6269```
6270bool OH_Drawing_PathGetMatrix (OH_Drawing_Path* path, bool forceClosed, float distance, OH_Drawing_Matrix* matrix, OH_Drawing_PathMeasureMatrixFlags flag )
6271```
6272
6273**Description**
6274
6275Obtains a transformation matrix at a distance from the start point of a path.
6276
6277Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6278
6279If either **path** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6280
6281If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6282
6283**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6284
6285**Since**: 12
6286
6287**Parameters**
6288
6289| Name| Description|
6290| -------- | -------- |
6291| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6292| forceClosed | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status.|
6293| distance | Distance from the start point. If a negative number is passed in, the value **0** is used. If a value greater than the path length is passed in, the path length is used.|
6294| matrix | Pointer to the transformation matrix.|
6295| flag | Type of the matrix information. For details about the available options, see [OH_Drawing_PathMeasureMatrixFlags](#oh_drawing_pathmeasurematrixflags).|
6296
6297**Returns**
6298
6299Returns **true** if the transformation matrix is obtained successfully; returns **false** otherwise. The possible failure cause is that **path** is NULL or the path length is 0.
6300
6301
6302### OH_Drawing_PenGetFillPath()
6303
6304```
6305bool OH_Drawing_PenGetFillPath (OH_Drawing_Pen* , const OH_Drawing_Path* src, OH_Drawing_Path* dst, const OH_Drawing_Rect* , const OH_Drawing_Matrix*  )
6306```
6307
6308**Description**
6309
6310Obtains the source path outline drawn using a pen and represents it using a destination path.
6311
6312Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6313
6314If any of **OH_Drawing_Pen**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6315
6316**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6317
6318**Since**: 12
6319
6320**Parameters**
6321
6322| Name| Description|
6323| -------- | -------- |
6324| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.|
6325| src | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object.|
6326| dst | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object.|
6327| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object. NULL is recommended.|
6328| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. NULL is recommended. The default value is an identity matrix.|
6329
6330**Returns**
6331
6332Returns **true** if the destination path is obtained; returns **false** otherwise.
6333
6334
6335### OH_Drawing_PenCopy()
6336
6337```
6338OH_Drawing_Pen* OH_Drawing_PenCopy (OH_Drawing_Pen* pen)
6339```
6340
6341**Description**
6342
6343Copies an existing [OH_Drawing_Pen](#oh_drawing_pen) object to create a new one.
6344
6345Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6346
6347If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6348
6349**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6350
6351**Since**: 12
6352
6353**Parameters**
6354
6355| Name| Description|
6356| -------- | -------- |
6357| pen | Pointer to an **OH_Drawing_Pen** object.|
6358
6359**Returns**
6360
6361Returns the pointer to the [OH_Drawing_Pen](#oh_drawing_pen) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or **pen** is NULL.
6362
6363
6364### OH_Drawing_PixelMapGetFromNativePixelMap()
6365
6366```
6367OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromNativePixelMap (NativePixelMap_* )
6368```
6369
6370**Description**
6371
6372Obtains the pixel map defined by this module from a pixel map defined by the image framework.
6373
6374**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6375
6376**Since**: 12
6377
6378**Parameters**
6379
6380| Name| Description|
6381| -------- | -------- |
6382| NativePixelMap_ | Pointer to a **NativePixelMap_** object, which is the pixel map defined by the image framework.|
6383
6384**Returns**
6385
6386Returns the pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object, which is the pixel map defined by this module. If NULL is returned, the creation fails. The possible failure cause is that **NativePixelMap_** is NULL.
6387
6388
6389### OH_Drawing_PixelMapGetFromOhPixelMapNative()
6390
6391```
6392OH_Drawing_PixelMap* OH_Drawing_PixelMapGetFromOhPixelMapNative (OH_PixelmapNative* )
6393```
6394
6395**Description**
6396
6397Obtains the pixel map defined by this module from a pixel map defined by the image framework.
6398
6399**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6400
6401**Since**: 12
6402
6403**Parameters**
6404
6405| Name| Description|
6406| -------- | -------- |
6407| OH_PixelmapNative | Pointer to an **OH_PixelmapNative** object, which is the pixel map defined by the image framework.|
6408
6409**Returns**
6410
6411Returns the pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object, which is the pixel map defined by this module. If NULL is returned, the creation fails. The possible failure cause is that **OH_PixelmapNative** is NULL.
6412
6413
6414### OH_Drawing_PixelMapDissolve()
6415
6416```
6417void OH_Drawing_PixelMapDissolve (OH_Drawing_PixelMap* )
6418```
6419
6420**Description**
6421
6422Removes the relationship between a pixel map defined by this module and a pixel map defined by the image framework. The relationship is established by calling [OH_Drawing_PixelMapGetFromNativePixelMap](#oh_drawing_pixelmapgetfromnativepixelmap) or [OH_Drawing_PixelMapGetFromOhPixelMapNative](#oh_drawing_pixelmapgetfromohpixelmapnative).
6423
6424**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6425
6426**Since**: 12
6427
6428**Parameters**
6429
6430| Name| Description|
6431| -------- | -------- |
6432| OH_Drawing_PixelMap | Pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object.|
6433
6434
6435### OH_Drawing_RectJoin()
6436
6437```
6438bool OH_Drawing_RectJoin (OH_Drawing_Rect* rect, const OH_Drawing_Rect* other )
6439```
6440
6441**Description**
6442
6443Obtains the union of two rectangles.
6444
6445Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6446
6447If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6448
6449**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6450
6451**Since**: 12
6452
6453**Parameters**
6454
6455| Name| Description|
6456| -------- | -------- |
6457| rect | Pointer to the first rectangle, which is an **OH_Drawing_Rect** object.|
6458| other | Pointer to the second rectangle, which is an **OH_Drawing_Rect** object.|
6459
6460**Returns**
6461
6462Returns **true** if the union is obtained; returns **false** otherwise. The possible failure cause is that at least one of the parameters **rect** and **other** is NULL or the size of the rectangle specified by **other** is empty.
6463
6464
6465### OH_Drawing_RegionContains()
6466
6467```
6468bool OH_Drawing_RegionContains (OH_Drawing_Region* region, int32_t x, int32_t y )
6469```
6470
6471**Description**
6472
6473Checks whether a region contains the specified point.
6474
6475Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6476
6477If **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6478
6479**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6480
6481**Since**: 12
6482
6483**Parameters**
6484
6485| Name| Description|
6486| -------- | -------- |
6487| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.|
6488| int32_t | X coordinate of the point.|
6489| int32_t | Y coordinate of the point.|
6490
6491**Returns**
6492
6493Returns **true** if the region contains the specified point; returns **false** otherwise.
6494
6495
6496### OH_Drawing_RegionOp()
6497
6498```
6499bool OH_Drawing_RegionOp (OH_Drawing_Region* region, const OH_Drawing_Region* other, OH_Drawing_RegionOpMode op )
6500```
6501
6502**Description**
6503
6504Combines two regions based on the specified operation mode.
6505
6506Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6507
6508If either **region** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6509
6510If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6511
6512**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6513
6514**Since**: 12
6515
6516**Parameters**
6517
6518| Name| Description|
6519| -------- | -------- |
6520| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object, in which the resulting region is saved.|
6521| other | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.|
6522| op | Operation mode of the region. For details about the available options, see [OH_Drawing_RegionOpMode](#oh_drawing_regionopmode).|
6523
6524**Returns**
6525
6526Returns **true** if the resulting region is not empty; returns false otherwise.
6527
6528
6529### OH_Drawing_RegionSetPath()
6530
6531```
6532bool OH_Drawing_RegionSetPath (OH_Drawing_Region* region, const OH_Drawing_Path* path, const OH_Drawing_Region* clip )
6533```
6534
6535**Description**
6536
6537Sets a region to the area described by the path.
6538
6539Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6540
6541If **region**, **path**, or **clip** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6542
6543**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6544
6545**Since**: 12
6546
6547**Parameters**
6548
6549| Name| Description|
6550| -------- | -------- |
6551| region | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.|
6552| path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.|
6553| clip | Pointer to an [OH_Drawing_Region](#oh_drawing_region) object.|
6554
6555**Returns**
6556
6557Returns **true** if the resulting region is not empty; returns false otherwise.
6558
6559
6560### OH_Drawing_ShaderEffectCreateColorShader()
6561
6562```
6563OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateColorShader (const uint32_t color)
6564```
6565
6566**Description**
6567
6568Creates an **OH_Drawing_ShaderEffect** object with a single color.
6569
6570**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6571
6572**Since**: 12
6573
6574**Parameters**
6575
6576| Name| Description|
6577| -------- | -------- |
6578| color | Color in the ARGB format. The value is a 32-bit unsigned integer.|
6579
6580**Returns**
6581
6582Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available.
6583
6584
6585### OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix()
6586
6587```
6588OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix (const OH_Drawing_Point2D* startPt, const OH_Drawing_Point2D* endPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix*  )
6589```
6590
6591**Description**
6592
6593Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.
6594
6595Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6596
6597If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6598
6599If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6600
6601**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6602
6603**Since**: 12
6604
6605**Parameters**
6606
6607| Name| Description|
6608| -------- | -------- |
6609| startPt | Start point.|
6610| endPt | End point.|
6611| colors | Colors to distribute.|
6612| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start point and end point.|
6613| size | Number of colors and positions (if **pos** is not NULL).|
6614| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).|
6615| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.|
6616
6617**Returns**
6618
6619Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **startPt**, **endPt**, and **colors** is NULL.
6620
6621
6622### OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix()
6623
6624```
6625OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix (const OH_Drawing_Point2D* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix*  )
6626```
6627
6628**Description**
6629
6630Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.
6631
6632Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6633
6634If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6635
6636If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6637
6638**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6639
6640**Since**: 12
6641
6642**Parameters**
6643
6644| Name| Description|
6645| -------- | -------- |
6646| centerPt | Center of the circle.|
6647| radius | Radius of the gradient.|
6648| colors | Colors to distribute in the radial direction.|
6649| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed in the radial direction.|
6650| size | Number of colors and positions (if **pos** is not NULL).|
6651| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode).|
6652| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.|
6653
6654**Returns**
6655
6656Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **centerPt** and **colors** is NULL.
6657
6658
6659### OH_Drawing_ShaderEffectCreateTwoPointConicalGradient()
6660
6661```
6662OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateTwoPointConicalGradient (const OH_Drawing_Point2D* startPt, float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode , const OH_Drawing_Matrix*  )
6663```
6664
6665**Description**
6666
6667Creates an **OH_Drawing_ShaderEffect** object that generates a gradient between two given circles.
6668
6669Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6670
6671If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6672
6673If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6674
6675**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6676
6677**Since**: 12
6678
6679**Parameters**
6680
6681| Name| Description|
6682| -------- | -------- |
6683| startPt | Pointer to the center of the start circle.|
6684| startRadius | Start radius of the gradient. The value should be a non-negative number.|
6685| endPt | Pointer to the center of the end circle.|
6686| endRadius | End radius of the gradient. The value should be a non-negative number.|
6687| colors | Colors to distribute between the two circles.|
6688| pos | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the two circles.|
6689| size | Number of colors and positions (if **pos** is not NULL).|
6690| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1).|
6691| OH_Drawing_Matrix | Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.|
6692
6693**Returns**
6694
6695Returns the pointer to the [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object created. If NULL is returned, the creation fails. The possible failure cause is that no memory is available or at least one of the parameters **startPt**, **endPt**, and **colors** is NULL.
6696
6697
6698
6699### OH_Drawing_TextBlobUniqueID()
6700
6701```
6702uint32_t OH_Drawing_TextBlobUniqueID (const OH_Drawing_TextBlob* )
6703```
6704
6705**Description**
6706
6707Obtains the unique identifier of a text blob. The identifier is a non-zero value.
6708
6709Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6710
6711If **OH_Drawing_TextBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6712
6713**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6714
6715**Since**: 12
6716
6717**Parameters**
6718
6719| Name| Description|
6720| -------- | -------- |
6721| OH_Drawing_TextBlob | Pointer to an [OH_Drawing_TextBlob](#oh_drawing_textblob) object.|
6722
6723**Returns**
6724
6725Returns the unique identifier of the text blob.
6726
6727
6728### OH_Drawing_PenSetShadowLayer()
6729
6730```
6731void OH_Drawing_PenSetShadowLayer (OH_Drawing_Pen* , OH_Drawing_ShadowLayer* )
6732```
6733
6734**Description**
6735
6736Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn.
6737
6738Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6739
6740If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6741
6742**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6743
6744**Since**: 12
6745
6746**Parameters**
6747
6748| Name| Description|
6749| -------- | -------- |
6750| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.|
6751| OH_Drawing_ShadowLayer | Pointer to an [OH_Drawing_ShadowLayer](#oh_drawing_shadowlayer) object. If NULL is passed in, the shadow layer effect will be cleared.|
6752
6753
6754### OH_Drawing_BrushSetShadowLayer()
6755
6756```
6757void OH_Drawing_BrushSetShadowLayer (OH_Drawing_Brush* , OH_Drawing_ShadowLayer* )
6758```
6759
6760**Description**
6761
6762Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn.
6763
6764Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6765
6766If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6767
6768**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6769
6770**Since**: 12
6771
6772**Parameters**
6773
6774| Name| Description|
6775| -------- | -------- |
6776| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.|
6777| OH_Drawing_ShadowLayer | Pointer to an **OH_Drawing_ShadowLayer** object. If NULL is passed in, the shadow layer effect of the brush will be cleared.|
6778
6779
6780### OH_Drawing_ShadowLayerCreate()
6781
6782```
6783OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate (float blurRadius, float x, float y, uint32_t color )
6784```
6785
6786**Description**
6787
6788Creates an **OH_Drawing_ShadowLayer** object.
6789
6790Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6791
6792If **blurRadius** is less than or equal to **0**, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6793
6794**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6795
6796**Since**: 12
6797
6798**Parameters**
6799
6800| Name| Description|
6801| -------- | -------- |
6802| blurRadius | Radius of the shadow layer. The value must be greater than 0.|
6803| x | Offset on the X axis.|
6804| y | Offset on the Y axis.|
6805| color | Color of the shadow.|
6806
6807**Returns**
6808
6809Returns the pointer to the **OH_Drawing_ShadowLayer** object created.
6810
6811
6812### OH_Drawing_ShadowLayerDestroy()
6813
6814```
6815void OH_Drawing_ShadowLayerDestroy (OH_Drawing_ShadowLayer* )
6816```
6817
6818**Description**
6819
6820Destroys an **OH_Drawing_ShadowLayer** object and reclaims the memory occupied by the object.
6821
6822**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6823
6824**Since**: 12
6825
6826**Parameters**
6827
6828| Name| Description|
6829| -------- | -------- |
6830| OH_Drawing_ShadowLayer | Pointer to the shadow layer.|
6831
6832
6833### OH_Drawing_FontSetBaselineSnap()
6834
6835```
6836void OH_Drawing_FontSetBaselineSnap (OH_Drawing_Font* , bool baselineSnap )
6837```
6838
6839**Description**
6840
6841Sets whether to request that baselines be snapped to pixels when the current canvas matrix is axis aligned.
6842
6843Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6844
6845If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6846
6847**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6848
6849**Since**: 12
6850
6851**Parameters**
6852
6853| Name| Description|
6854| -------- | -------- |
6855| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6856| baselineSnap | Check result. The value **true** means to request that baselines be snapped to pixels, and **false** means the opposite.|
6857
6858
6859### OH_Drawing_FontIsBaselineSnap()
6860
6861```
6862bool OH_Drawing_FontIsBaselineSnap (const OH_Drawing_Font* )
6863```
6864
6865**Description**
6866
6867Checks whether baselines are requested to be snapped to pixels when the current canvas matrix is axis aligned.
6868
6869Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6870
6871If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6872
6873**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6874
6875**Since**: 12
6876
6877**Parameters**
6878
6879| Name| Description|
6880| -------- | -------- |
6881| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6882
6883**Returns**
6884
6885Returns **true** if the baselines are requested to be snapped to pixels; returns **false** otherwise.
6886
6887
6888### OH_Drawing_FontSetEdging()
6889
6890```
6891void OH_Drawing_FontSetEdging (OH_Drawing_Font* , OH_Drawing_FontEdging  )
6892```
6893
6894**Description**
6895
6896Sets a font edging effect.
6897
6898Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6899
6900If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6901
6902If **OH_Drawing_FontEdging** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
6903
6904**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6905
6906**Since**: 12
6907
6908**Parameters**
6909
6910| Name| Description|
6911| -------- | -------- |
6912| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6913| OH_Drawing_FontEdging | Font edging effect.|
6914
6915
6916### OH_Drawing_FontGetEdging()
6917
6918```
6919OH_Drawing_FontEdging OH_Drawing_FontGetEdging (const OH_Drawing_Font* )
6920```
6921
6922**Description**
6923
6924Obtains the font edging effect.
6925
6926Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6927
6928If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6929
6930**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6931
6932**Since**: 12
6933
6934**Parameters**
6935
6936| Name| Description|
6937| -------- | -------- |
6938| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6939
6940**Returns**
6941
6942Returns the font edging effect.
6943
6944
6945
6946### OH_Drawing_FontSetForceAutoHinting()
6947
6948```
6949void OH_Drawing_FontSetForceAutoHinting (OH_Drawing_Font* , bool isForceAutoHinting )
6950```
6951
6952**Description**
6953
6954Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs.
6955
6956Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6957
6958If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6959
6960**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6961
6962**Since**: 12
6963
6964**Parameters**
6965
6966| Name| Description|
6967| -------- | -------- |
6968| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6969| isForceAutoHinting | Check result. The value **true** means to forcibly use auto hinting, and **false** means the opposite.|
6970
6971
6972### OH_Drawing_FontIsForceAutoHinting()
6973
6974```
6975bool OH_Drawing_FontIsForceAutoHinting (const OH_Drawing_Font* )
6976```
6977
6978**Description**
6979
6980Checks whether auto hinting is forcibly used.
6981
6982Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
6983
6984If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
6985
6986**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
6987
6988**Since**: 12
6989
6990**Parameters**
6991
6992| Name| Description|
6993| -------- | -------- |
6994| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
6995
6996**Returns**
6997
6998Returns **true** if auto hinting is forcibly used; returns **false** otherwise.
6999
7000
7001### OH_Drawing_FontSetSubpixel()
7002
7003```
7004void OH_Drawing_FontSetSubpixel (OH_Drawing_Font* , bool isSubpixel )
7005```
7006
7007**Description**
7008
7009Sets whether to use sub-pixel rendering for a font.
7010
7011Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7012
7013If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7014
7015**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7016
7017**Since**: 12
7018
7019**Parameters**
7020
7021| Name| Description|
7022| -------- | -------- |
7023| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7024| isSubpixel | Check result. The value **true** means to use sub-pixel rendering for the font, and **false** means the opposite.|
7025
7026
7027### OH_Drawing_FontIsSubpixel()
7028
7029```
7030bool OH_Drawing_FontIsSubpixel (const OH_Drawing_Font* )
7031```
7032
7033**Description**
7034
7035Checks whether sub-pixel rendering is used for a font.
7036
7037Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7038
7039If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7040
7041**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7042
7043**Since**: 12
7044
7045**Parameters**
7046
7047| Name| Description|
7048| -------- | -------- |
7049| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7050
7051**Returns**
7052
7053Returns **true** if sub-pixel rendering is used for the font; returns **false** otherwise.
7054
7055
7056### OH_Drawing_FontGetTextSize()
7057
7058```
7059float OH_Drawing_FontGetTextSize (const OH_Drawing_Font* )
7060```
7061
7062**Description**
7063
7064Obtains the text size.
7065
7066Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7067
7068If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7069
7070**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7071
7072**Since**: 12
7073
7074**Parameters**
7075
7076| Name| Description|
7077| -------- | -------- |
7078| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7079
7080**Returns**
7081
7082Returns a floating point number representing the text size.
7083
7084
7085### OH_Drawing_FontTextToGlyphs()
7086
7087```
7088uint32_t OH_Drawing_FontTextToGlyphs (const OH_Drawing_Font* , const void* text, uint32_t byteLength, OH_Drawing_TextEncoding encoding, uint16_t* glyphs, int maxGlyphCount )
7089```
7090
7091**Description**
7092
7093Converts text into glyph indices.
7094
7095Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7096
7097If any of **OH_Drawing_Font**, **text**, and **glyphs** is NULL, **byteLength** is **0**, or **maxGlyphCount** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7098
7099**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7100
7101**Since**: 12
7102
7103**Parameters**
7104
7105| Name| Description|
7106| -------- | -------- |
7107| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7108| text | Pointer to the start address of the storage.|
7109| byteLength | Text length, in bytes.|
7110| encoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding).|
7111| glyphs | Pointer to the start address for storing the glyph indices.|
7112| maxGlyphCount | Maximum number of glyphs.|
7113
7114**Returns**
7115
7116Returns the number of glyph indices.
7117
7118
7119### OH_Drawing_FontGetWidths()
7120
7121```
7122void OH_Drawing_FontGetWidths (const OH_Drawing_Font* , const uint16_t* glyphs, int count, float* widths )
7123```
7124
7125**Description**
7126
7127Obtains the width of each glyph in a string of text.
7128
7129Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7130
7131If any of **OH_Drawing_Font**, **glyphs**, and **widths** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7132
7133**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7134
7135**Since**: 12
7136
7137**Parameters**
7138
7139| Name| Description|
7140| -------- | -------- |
7141| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7142| glyphs | Pointer to the start address for storing the glyph indices.|
7143| count | Number of glyph indices.|
7144| widths | Pointer to the start address for storing the glyph widths.|
7145
7146
7147### OH_Drawing_FontIsLinearText()
7148
7149```
7150bool OH_Drawing_FontIsLinearText (const OH_Drawing_Font* )
7151```
7152
7153**Description**
7154
7155Checks whether linear scaling is used for a font.
7156
7157Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7158
7159If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7160
7161**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7162
7163**Since**: 12
7164
7165**Parameters**
7166
7167| Name| Description|
7168| -------- | -------- |
7169| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7170
7171**Returns**
7172
7173Returns **true** if linear scaling is used; returns **false** otherwise.
7174
7175
7176### OH_Drawing_FontGetTextSkewX()
7177
7178```
7179float OH_Drawing_FontGetTextSkewX (const OH_Drawing_Font* )
7180```
7181
7182**Description**
7183
7184Obtains the horizontal skew factor of a font.
7185
7186Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7187
7188If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7189
7190**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7191
7192**Since**: 12
7193
7194**Parameters**
7195
7196| Name| Description|
7197| -------- | -------- |
7198| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7199
7200**Returns**
7201
7202Returns a floating point number representing the horizontal skew factor.
7203
7204
7205### OH_Drawing_FontIsFakeBoldText()
7206
7207```
7208bool OH_Drawing_FontIsFakeBoldText (const OH_Drawing_Font* )
7209```
7210
7211**Description**
7212
7213Checks whether fake bold is used for a font.
7214
7215Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7216
7217If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7218
7219**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7220
7221**Since**: 12
7222
7223**Parameters**
7224
7225| Name| Description|
7226| -------- | -------- |
7227| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7228
7229**Returns**
7230
7231Returns **true** if fake bold is used; returns **false** otherwise.
7232
7233
7234### OH_Drawing_FontSetScaleX()
7235
7236```
7237void OH_Drawing_FontSetScaleX (OH_Drawing_Font* , float scaleX )
7238```
7239
7240**Description**
7241
7242Sets a horizontal scale factor for a font.
7243
7244Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7245
7246If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7247
7248**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7249
7250**Since**: 12
7251
7252**Parameters**
7253
7254| Name| Description|
7255| -------- | -------- |
7256| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7257| scaleX | Horizontal scale factor.|
7258
7259
7260### OH_Drawing_FontGetScaleX()
7261
7262```
7263float OH_Drawing_FontGetScaleX (const OH_Drawing_Font* )
7264```
7265
7266**Description**
7267
7268Obtains the horizontal scale factor of a font.
7269
7270Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7271
7272If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7273
7274**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7275
7276**Since**: 12
7277
7278**Parameters**
7279
7280| Name| Description|
7281| -------- | -------- |
7282| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7283
7284**Returns**
7285
7286Returns the horizontal scale factor.
7287
7288
7289### OH_Drawing_FontSetHinting()
7290
7291```
7292void OH_Drawing_FontSetHinting (OH_Drawing_Font* , OH_Drawing_FontHinting  )
7293```
7294
7295**Description**
7296
7297Sets a font hinting effect.
7298
7299Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7300
7301If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7302
7303If **OH_Drawing_FontHinting** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
7304
7305**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7306
7307**Since**: 12
7308
7309**Parameters**
7310
7311| Name| Description|
7312| -------- | -------- |
7313| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7314| OH_Drawing_FontHinting | Font hinting effect. For details about the available options, see [OH_Drawing_FontHinting](#oh_drawing_fonthinting).|
7315
7316
7317### OH_Drawing_FontGetHinting()
7318
7319```
7320OH_Drawing_FontHinting OH_Drawing_FontGetHinting (const OH_Drawing_Font* )
7321```
7322
7323**Description**
7324
7325Obtains the font hinting effect.
7326
7327Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7328
7329If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7330
7331**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7332
7333**Since**: 12
7334
7335**Parameters**
7336
7337| Name| Description|
7338| -------- | -------- |
7339| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7340
7341**Returns**
7342
7343Returns the font hinting effect. For details about the available options, see [OH_Drawing_FontHinting](#oh_drawing_fonthinting).
7344
7345
7346### OH_Drawing_FontSetEmbeddedBitmaps()
7347
7348```
7349void OH_Drawing_FontSetEmbeddedBitmaps (OH_Drawing_Font* , bool isEmbeddedBitmaps )
7350```
7351
7352**Description**
7353
7354Sets whether to use bitmaps in a font.
7355
7356Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7357
7358If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7359
7360**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7361
7362**Since**: 12
7363
7364**Parameters**
7365
7366| Name| Description|
7367| -------- | -------- |
7368| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7369| isEmbeddedBitmaps | Whether to use bitmaps in the font. The value **true** means to use bitmaps in the font, and **false** means the opposite.|
7370
7371
7372### OH_Drawing_FontIsEmbeddedBitmaps()
7373
7374```
7375bool OH_Drawing_FontIsEmbeddedBitmaps (const OH_Drawing_Font* )
7376```
7377
7378**Description**
7379
7380Checks whether bitmaps are used in a font.
7381
7382Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7383
7384If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7385
7386**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7387
7388**Since**: 12
7389
7390**Parameters**
7391
7392| Name| Description|
7393| -------- | -------- |
7394| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.|
7395
7396**Returns**
7397
7398Returns **true** if bitmaps are used; returns **false** otherwise.
7399
7400
7401### OH_Drawing_BitmapBuild()
7402
7403```
7404void OH_Drawing_BitmapBuild (OH_Drawing_Bitmap* , const uint32_t width, const uint32_t height, const OH_Drawing_BitmapFormat*  )
7405```
7406
7407**Description**
7408
7409Initializes the width and height of a bitmap and sets the pixel format for the bitmap.
7410
7411Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7412
7413If either **OH_Drawing_Bitmap** or **OH_Drawing_BitmapFormat** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7414
7415**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7416
7417**Since**: 8
7418
7419**Parameters**
7420
7421| Name| Description|
7422| -------- | -------- |
7423| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7424| width | Width of the bitmap to be initialized.|
7425| height | Height of the bitmap to be initialized.|
7426| [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) | Pointer to the pixel format of the bitmap to be initialized, including the pixel color type and alpha type.|
7427
7428
7429### OH_Drawing_BitmapCreate()
7430
7431```
7432OH_Drawing_Bitmap* OH_Drawing_BitmapCreate (void )
7433```
7434
7435**Description**
7436
7437Creates an **OH_Drawing_Bitmap** object.
7438
7439**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7440
7441**Since**: 8
7442
7443**Returns**
7444
7445Returns the pointer to the **OH_Drawing_Bitmap** object created.
7446
7447
7448### OH_Drawing_BitmapCreateFromPixels()
7449
7450```
7451OH_Drawing_Bitmap* OH_Drawing_BitmapCreateFromPixels (OH_Drawing_Image_Info* , void* pixels, uint32_t rowBytes )
7452```
7453
7454**Description**
7455
7456Creates an **OH_Drawing_Bitmap** object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for.
7457
7458Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7459
7460If either **OH_Drawing_Image_Info** or **pixels** is NULL or **rowBytes** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7461
7462**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7463
7464**Since**: 12
7465
7466**Parameters**
7467
7468| Name| Description|
7469| -------- | -------- |
7470| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.|
7471| pixels | Pointer to the start address of the memory for storing the bitmap pixels. You need to apply for the memory and ensure its validity.|
7472| rowBytes | Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0.|
7473
7474**Returns**
7475
7476Returns the pointer to the [OH_Drawing_Bitmap](#oh_drawing_bitmap) object created.
7477
7478
7479### OH_Drawing_BitmapDestroy()
7480
7481```
7482void OH_Drawing_BitmapDestroy (OH_Drawing_Bitmap* )
7483```
7484
7485**Description**
7486
7487Destroys an **OH_Drawing_Bitmap** object and reclaims the memory occupied by the object.
7488
7489**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7490
7491**Since**: 8
7492
7493**Parameters**
7494
7495| Name| Description|
7496| -------- | -------- |
7497| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7498
7499
7500### OH_Drawing_BitmapGetAlphaFormat()
7501
7502```
7503OH_Drawing_AlphaFormat OH_Drawing_BitmapGetAlphaFormat (OH_Drawing_Bitmap* )
7504```
7505
7506**Description**
7507
7508Obtains the alpha component of a bitmap.
7509
7510Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7511
7512If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7513
7514**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7515
7516**Since**: 12
7517
7518**Parameters**
7519
7520| Name| Description|
7521| -------- | -------- |
7522| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7523
7524**Returns**
7525
7526Returns the alpha component. For details about the supported formats, see [OH_Drawing_AlphaFormat](#oh_drawing_alphaformat).
7527
7528
7529### OH_Drawing_BitmapGetColorFormat()
7530
7531```
7532OH_Drawing_ColorFormat OH_Drawing_BitmapGetColorFormat (OH_Drawing_Bitmap* )
7533```
7534
7535**Description**
7536
7537Obtains the pixel format of a bitmap.
7538
7539Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7540
7541If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7542
7543**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7544
7545**Since**: 12
7546
7547**Parameters**
7548
7549| Name| Description|
7550| -------- | -------- |
7551| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7552
7553**Returns**
7554
7555Returns the pixel format. For details about the supported formats, see [OH_Drawing_ColorFormat](#oh_drawing_colorformat).
7556
7557
7558### OH_Drawing_BitmapGetHeight()
7559
7560```
7561uint32_t OH_Drawing_BitmapGetHeight (OH_Drawing_Bitmap* )
7562```
7563
7564**Description**
7565
7566Obtains the height of a bitmap.
7567
7568Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7569
7570If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7571
7572**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7573
7574**Since**: 8
7575
7576**Parameters**
7577
7578| Name| Description|
7579| -------- | -------- |
7580| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7581
7582**Returns**
7583
7584Returns the height.
7585
7586
7587### OH_Drawing_BitmapGetImageInfo()
7588
7589```
7590void OH_Drawing_BitmapGetImageInfo (OH_Drawing_Bitmap* , OH_Drawing_Image_Info*  )
7591```
7592
7593**Description**
7594
7595Obtains the image information of a bitmap.
7596
7597Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7598
7599If either **OH_Drawing_Bitmap** or **OH_Drawing_Image_Info** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7600
7601**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7602
7603**Since**: 12
7604
7605**Parameters**
7606
7607| Name| Description|
7608| -------- | -------- |
7609| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.|
7610| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.|
7611
7612
7613### OH_Drawing_BitmapGetPixels()
7614
7615```
7616void* OH_Drawing_BitmapGetPixels (OH_Drawing_Bitmap* )
7617```
7618
7619**Description**
7620
7621Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.
7622
7623Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7624
7625If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7626
7627**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7628
7629**Since**: 8
7630
7631**Parameters**
7632
7633| Name| Description|
7634| -------- | -------- |
7635| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7636
7637**Returns**
7638
7639Returns the pixel address.
7640
7641
7642### OH_Drawing_BitmapGetWidth()
7643
7644```
7645uint32_t OH_Drawing_BitmapGetWidth (OH_Drawing_Bitmap* )
7646```
7647
7648**Description**
7649
7650Obtains the width of a bitmap.
7651
7652Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7653
7654If **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7655
7656**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7657
7658**Since**: 8
7659
7660**Parameters**
7661
7662| Name| Description|
7663| -------- | -------- |
7664| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.|
7665
7666**Returns**
7667
7668Returns the width.
7669
7670### OH_Drawing_BitmapReadPixels()
7671
7672```
7673bool OH_Drawing_BitmapReadPixels (OH_Drawing_Bitmap* , const OH_Drawing_Image_Info* dstInfo, void* dstPixels, size_t dstRowBytes, int32_t srcX, int32_t srcY )
7674```
7675
7676**Description**
7677
7678Reads pixels of a rectangle in a bitmap to the specified buffer.
7679
7680Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7681
7682If any of **OH_Drawing_Bitmap**, **dstInfo**, and **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7683
7684**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7685
7686**Since**: 12
7687
7688**Parameters**
7689
7690| Name| Description|
7691| -------- | -------- |
7692| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object.|
7693| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.|
7694| dstPixels | Pointer to the buffer for storing the pixels read.|
7695| dstRowBytes | Number of bytes in each row of the pixel data read. The value must be greater than or equal to the minimum number of bytes in each row in the [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object.|
7696| srcX | Start X coordinate of the pixel data to read from the bitmap. The value must be less than the width of the bitmap.|
7697| srcY | Start Y coordinate of the pixel data to read from the bitmap. The value must be less than the height of the bitmap.|
7698
7699**Returns**
7700
7701Returns **true** if the pixels are read; returns **false** otherwise.
7702
7703
7704### OH_Drawing_BrushCreate()
7705
7706```
7707OH_Drawing_Brush* OH_Drawing_BrushCreate (void )
7708```
7709
7710**Description**
7711
7712Creates an **OH_Drawing_Brush** object.
7713
7714**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7715
7716**Since**: 8
7717
7718**Returns**
7719
7720Returns the pointer to the **OH_Drawing_Brush** object created.
7721
7722
7723### OH_Drawing_BrushDestroy()
7724
7725```
7726void OH_Drawing_BrushDestroy (OH_Drawing_Brush* )
7727```
7728
7729**Description**
7730
7731Destroys an **OH_Drawing_Brush** object and reclaims the memory occupied by the object.
7732
7733**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7734
7735**Since**: 8
7736
7737**Parameters**
7738
7739| Name             | Description                                |
7740| ---------------- | ------------------------------------------ |
7741| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7742
7743
7744### OH_Drawing_BrushGetAlpha()
7745
7746```
7747uint8_t OH_Drawing_BrushGetAlpha (const OH_Drawing_Brush* )
7748```
7749
7750**Description**
7751
7752Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape.
7753
7754Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7755
7756If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7757
7758**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7759
7760**Since**: 11
7761
7762**Parameters**
7763
7764| Name             | Description                                |
7765| ---------------- | ------------------------------------------ |
7766| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7767
7768**Returns**
7769
7770Returns an 8-bit variable that describes the alpha value.
7771
7772
7773### OH_Drawing_BrushGetColor()
7774
7775```
7776uint32_t OH_Drawing_BrushGetColor (const OH_Drawing_Brush* )
7777```
7778
7779**Description**
7780
7781Obtains the color of a brush. The color is used by the brush to fill in a shape.
7782
7783Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7784
7785If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7786
7787**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7788
7789**Since**: 8
7790
7791**Parameters**
7792
7793| Name             | Description                                |
7794| ---------------- | ------------------------------------------ |
7795| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7796
7797**Returns**
7798
7799Returns a 32-bit (ARGB) variable that describes the color.
7800
7801
7802### OH_Drawing_BrushGetFilter()
7803
7804```
7805void OH_Drawing_BrushGetFilter (OH_Drawing_Brush* , OH_Drawing_Filter*  )
7806```
7807
7808**Description**
7809
7810Obtains the filter of a brush. The filter is a container that holds a mask filter and color filter.
7811
7812Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7813
7814If either **OH_Drawing_Brush** or **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7815
7816**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7817
7818**Since**: 12
7819
7820**Parameters**
7821
7822| Name              | Description                                                  |
7823| ----------------- | ------------------------------------------------------------ |
7824| OH_Drawing_Brush  | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object.  |
7825| OH_Drawing_Filter | Pointer to the [OH_Drawing_Filter](#oh_drawing_filter) object obtained. |
7826
7827
7828### OH_Drawing_BrushIsAntiAlias()
7829
7830```
7831bool OH_Drawing_BrushIsAntiAlias (const OH_Drawing_Brush* )
7832```
7833
7834**Description**
7835
7836Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.
7837
7838Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7839
7840If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7841
7842**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7843
7844**Since**: 8
7845
7846**Parameters**
7847
7848| Name             | Description                                |
7849| ---------------- | ------------------------------------------ |
7850| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7851
7852**Returns**
7853
7854Returns **true** if anti-aliasing is enabled; returns **false** otherwise.
7855
7856
7857### OH_Drawing_BrushReset()
7858
7859```
7860void OH_Drawing_BrushReset (OH_Drawing_Brush* )
7861```
7862
7863**Description**
7864
7865Resets a brush to the initial state. All configured attributes are cleared.
7866
7867Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7868
7869If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7870
7871**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7872
7873**Since**: 12
7874
7875**Parameters**
7876
7877| Name             | Description                                                 |
7878| ---------------- | ----------------------------------------------------------- |
7879| OH_Drawing_Brush | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object. |
7880
7881
7882### OH_Drawing_BrushSetAlpha()
7883
7884```
7885void OH_Drawing_BrushSetAlpha (OH_Drawing_Brush* , uint8_t alpha )
7886```
7887
7888**Description**
7889
7890Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape.
7891
7892Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7893
7894If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7895
7896**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7897
7898**Since**: 11
7899
7900**Parameters**
7901
7902| Name             | Description                                |
7903| ---------------- | ------------------------------------------ |
7904| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7905| alpha            | Alpha value, which is an 8-bit variable.   |
7906
7907
7908### OH_Drawing_BrushSetAntiAlias()
7909
7910```
7911void OH_Drawing_BrushSetAntiAlias (OH_Drawing_Brush* , bool  )
7912```
7913
7914**Description**
7915
7916Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-transparent.
7917
7918Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7919
7920If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7921
7922**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7923
7924**Since**: 8
7925
7926**Parameters**
7927
7928| Name             | Description                                                  |
7929| ---------------- | ------------------------------------------------------------ |
7930| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object.                   |
7931| bool             | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite. |
7932
7933
7934### OH_Drawing_BrushSetBlendMode()
7935
7936```
7937void OH_Drawing_BrushSetBlendMode (OH_Drawing_Brush* , OH_Drawing_BlendMode  )
7938```
7939
7940**Description**
7941
7942Sets a blender for a brush. The blender implements the specified blend mode.
7943
7944Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7945
7946If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7947
7948If **OH_Drawing_BlendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
7949
7950**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7951
7952**Since**: 12
7953
7954**Parameters**
7955
7956| Name                 | Description                                                  |
7957| -------------------- | ------------------------------------------------------------ |
7958| OH_Drawing_Brush     | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object.  |
7959| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). |
7960
7961
7962### OH_Drawing_BrushSetColor()
7963
7964```
7965void OH_Drawing_BrushSetColor (OH_Drawing_Brush* , uint32_t color )
7966```
7967
7968**Description**
7969
7970Sets the color for a brush. The color is used by the brush to fill in a shape.
7971
7972Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7973
7974If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
7975
7976**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
7977
7978**Since**: 8
7979
7980**Parameters**
7981
7982| Name             | Description                                |
7983| ---------------- | ------------------------------------------ |
7984| OH_Drawing_Brush | Pointer to an **OH_Drawing_Brush** object. |
7985| color            | Color, which is a 32-bit (ARGB) variable.  |
7986
7987
7988### OH_Drawing_BrushSetFilter()
7989
7990```
7991void OH_Drawing_BrushSetFilter (OH_Drawing_Brush* , OH_Drawing_Filter*  )
7992```
7993
7994**Description**
7995
7996Sets a filter for a brush. The filter is a container that holds a mask filter and color filter.
7997
7998Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
7999
8000If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8001
8002**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8003
8004**Since**: 11
8005
8006**Parameters**
8007
8008| Name              | Description                                                  |
8009| ----------------- | ------------------------------------------------------------ |
8010| OH_Drawing_Brush  | Pointer to an **OH_Drawing_Brush** object.                   |
8011| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. If null is passed in, the filter will be cleared. |
8012
8013
8014### OH_Drawing_BrushSetShaderEffect()
8015
8016```
8017void OH_Drawing_BrushSetShaderEffect (OH_Drawing_Brush* , OH_Drawing_ShaderEffect*  )
8018```
8019
8020**Description**
8021
8022Sets the shader effect for a brush.
8023
8024Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8025
8026If **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8027
8028**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8029
8030**Since**: 11
8031
8032**Parameters**
8033
8034| Name                    | Description                                                  |
8035| ----------------------- | ------------------------------------------------------------ |
8036| OH_Drawing_Brush        | Pointer to an **OH_Drawing_Brush** object.                   |
8037| OH_Drawing_ShaderEffect | Pointer to an **OH_Drawing_ShaderEffect** object. If NULL is passed in, the shader effect of the brush will be cleared. |
8038
8039
8040### OH_Drawing_CanvasAttachBrush()
8041
8042```
8043void OH_Drawing_CanvasAttachBrush (OH_Drawing_Canvas* , const OH_Drawing_Brush*  )
8044```
8045
8046**Description**
8047
8048Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape. If the brush effect changes after this function is called, you must call the function again to use the new effect in the subsequent drawing.
8049
8050Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8051
8052If either **OH_Drawing_Canvas** or **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8053
8054**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8055
8056**Since**: 8
8057
8058**Parameters**
8059
8060| Name              | Description                                 |
8061| ----------------- | ------------------------------------------- |
8062| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8063| OH_Drawing_Brush  | Pointer to an **OH_Drawing_Brush** object.  |
8064
8065
8066### OH_Drawing_CanvasAttachPen()
8067
8068```
8069void OH_Drawing_CanvasAttachPen (OH_Drawing_Canvas* , const OH_Drawing_Pen*  )
8070```
8071
8072**Description**
8073
8074Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If the pen effect changes after this function is called, you must call the function again to use the new effect in the subsequent drawing.
8075
8076Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8077
8078If either **OH_Drawing_Canvas** or **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8079
8080**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8081
8082**Since**: 8
8083
8084**Parameters**
8085
8086| Name              | Description                                 |
8087| ----------------- | ------------------------------------------- |
8088| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8089| OH_Drawing_Pen    | Pointer to an **OH_Drawing_Pen** object.    |
8090
8091
8092### OH_Drawing_CanvasBind()
8093
8094```
8095void OH_Drawing_CanvasBind (OH_Drawing_Canvas* , OH_Drawing_Bitmap*  )
8096```
8097
8098**Description**
8099
8100Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is called CPU rendering.) A canvas bound to a bitmap is a non-recording canvas.
8101
8102Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8103
8104If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8105
8106**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8107
8108**Since**: 8
8109
8110**Parameters**
8111
8112| Name              | Description                                 |
8113| ----------------- | ------------------------------------------- |
8114| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8115| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object. |
8116
8117
8118### OH_Drawing_CanvasClear()
8119
8120```
8121void OH_Drawing_CanvasClear (OH_Drawing_Canvas* , uint32_t color )
8122```
8123
8124**Description**
8125
8126Clears a canvas by using a given color.
8127
8128Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8129
8130If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8131
8132**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8133
8134**Since**: 8
8135
8136**Parameters**
8137
8138| Name              | Description                                 |
8139| ----------------- | ------------------------------------------- |
8140| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8141| color             | Color, which is a 32-bit (ARGB) variable.   |
8142
8143
8144### OH_Drawing_CanvasClipPath()
8145
8146```
8147void OH_Drawing_CanvasClipPath (OH_Drawing_Canvas* , const OH_Drawing_Path* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias )
8148```
8149
8150**Description**
8151
8152Clips a path.
8153
8154Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8155
8156If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8157
8158If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8159
8160**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8161
8162**Since**: 11
8163
8164**Parameters**
8165
8166| Name              | Description                                                  |
8167| ----------------- | ------------------------------------------------------------ |
8168| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
8169| OH_Drawing_Path   | Pointer to an **OH_Drawing_Path** object.                    |
8170| clipOp            | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop). |
8171| doAntiAlias       | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite. |
8172
8173
8174### OH_Drawing_CanvasClipRect()
8175
8176```
8177void OH_Drawing_CanvasClipRect (OH_Drawing_Canvas* , const OH_Drawing_Rect* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias )
8178```
8179
8180**Description**
8181
8182Clips a rectangle.
8183
8184Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8185
8186If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8187
8188If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8189
8190**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8191
8192**Since**: 11
8193
8194**Parameters**
8195
8196| Name              | Description                                                  |
8197| ----------------- | ------------------------------------------------------------ |
8198| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
8199| OH_Drawing_Rect   | Pointer to an **OH_Drawing_Rect** object.                    |
8200| clipOp            | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop). |
8201| doAntiAlias       | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite. |
8202
8203### OH_Drawing_CanvasClipRoundRect()
8204
8205```
8206void OH_Drawing_CanvasClipRoundRect (OH_Drawing_Canvas* , const OH_Drawing_RoundRect* , OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias )
8207```
8208
8209**Description**
8210
8211Clips a rounded rectangle.
8212
8213Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8214
8215If either **OH_Drawing_Canvas** or **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8216
8217If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8218
8219**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8220
8221**Since**: 12
8222
8223**Parameters**
8224
8225| Name                 | Description                                                  |
8226| -------------------- | ------------------------------------------------------------ |
8227| OH_Drawing_Canvas    | Pointer to an **OH_Drawing_Canvas** object.                  |
8228| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object.               |
8229| clipOp               | Clip mode. For details about the available options, see [OH_Drawing_CanvasClipOp](#oh_drawing_canvasclipop). |
8230| doAntiAlias          | Whether to perform anti-aliasing. The value **true** means to perform anti-aliasing, and **false** means the opposite. |
8231
8232### OH_Drawing_CanvasConcatMatrix()
8233
8234```
8235void OH_Drawing_CanvasConcatMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix*  )
8236```
8237
8238**Description**
8239
8240Preconcats the existing matrix with the passed-in matrix. The drawing operation triggered before this function is called is not affected.
8241
8242Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8243
8244If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8245
8246**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8247
8248**Since**: 12
8249
8250**Parameters**
8251
8252| Name              | Description                                                  |
8253| ----------------- | ------------------------------------------------------------ |
8254| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8255| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
8256
8257
8258### OH_Drawing_CanvasCreate()
8259
8260```
8261OH_Drawing_Canvas* OH_Drawing_CanvasCreate (void )
8262```
8263
8264**Description**
8265
8266Creates an **OH_Drawing_Canvas** object.
8267
8268**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8269
8270**Since**: 8
8271
8272**Returns**
8273
8274Returns the pointer to the **OH_Drawing_Canvas** object created.
8275
8276
8277### OH_Drawing_CanvasDestroy()
8278
8279```
8280void OH_Drawing_CanvasDestroy (OH_Drawing_Canvas* )
8281```
8282
8283**Description**
8284
8285Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object.
8286
8287**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8288
8289**Since**: 8
8290
8291**Parameters**
8292
8293| Name              | Description                                 |
8294| ----------------- | ------------------------------------------- |
8295| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8296
8297
8298### OH_Drawing_CanvasDetachBrush()
8299
8300```
8301void OH_Drawing_CanvasDetachBrush (OH_Drawing_Canvas* )
8302```
8303
8304**Description**
8305
8306Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a shape.
8307
8308Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8309
8310If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8311
8312**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8313
8314**Since**: 8
8315
8316**Parameters**
8317
8318| Name              | Description                                 |
8319| ----------------- | ------------------------------------------- |
8320| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8321
8322
8323### OH_Drawing_CanvasDetachPen()
8324
8325```
8326void OH_Drawing_CanvasDetachPen (OH_Drawing_Canvas* )
8327```
8328
8329**Description**
8330
8331Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline a shape.
8332
8333Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8334
8335If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8336
8337**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8338
8339**Since**: 8
8340
8341**Parameters**
8342
8343| Name              | Description                                 |
8344| ----------------- | ------------------------------------------- |
8345| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8346
8347
8348### OH_Drawing_CanvasDrawArc()
8349
8350```
8351void OH_Drawing_CanvasDrawArc (OH_Drawing_Canvas* , const OH_Drawing_Rect* , float startAngle, float sweepAngle )
8352```
8353
8354**Description**
8355
8356Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn.
8357
8358Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8359
8360If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8361
8362**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8363
8364**Since**: 11
8365
8366**Parameters**
8367
8368| Name              | Description                                                  |
8369| ----------------- | ------------------------------------------------------------ |
8370| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
8371| OH_Drawing_Rect   | Pointer to an **OH_Drawing_Rect** object.                    |
8372| startAngle        | Start angle. When the degree is 0, the start point is located at the right end of the oval. A positive number indicates that the start point is placed clockwise, and a negative number indicates that the start point is placed counterclockwise. |
8373| sweepAngle        | Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The valid range is from -360 degrees to 360 degrees. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn. |
8374
8375
8376### OH_Drawing_CanvasDrawBackground()
8377
8378```
8379void OH_Drawing_CanvasDrawBackground (OH_Drawing_Canvas* , const OH_Drawing_Brush*  )
8380```
8381
8382**Description**
8383
8384Draws a background filled with a brush.
8385
8386Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8387
8388If either **OH_Drawing_Canvas** or **OH_Drawing_Brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8389
8390**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8391
8392**Since**: 12
8393
8394**Parameters**
8395
8396| Name              | Description                                 |
8397| ----------------- | ------------------------------------------- |
8398| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8399| OH_Drawing_Brush  | Pointer to an **OH_Drawing_Brush** object.  |
8400
8401
8402### OH_Drawing_CanvasDrawBitmap()
8403
8404```
8405void OH_Drawing_CanvasDrawBitmap (OH_Drawing_Canvas* , const OH_Drawing_Bitmap* , float left, float top )
8406```
8407
8408**Description**
8409
8410Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, includes single points called pixels (image elements).
8411
8412Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8413
8414If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8415
8416**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8417
8418**Since**: 11
8419
8420**Parameters**
8421
8422| Name              | Description                                          |
8423| ----------------- | ---------------------------------------------------- |
8424| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.          |
8425| OH_Drawing_Bitmap | Pointer to an **OH_Drawing_Bitmap** object.          |
8426| left              | X coordinate of the upper left corner of the bitmap. |
8427| top               | Y coordinate of the upper left corner of the bitmap. |
8428
8429
8430### OH_Drawing_CanvasDrawBitmapRect()
8431
8432```
8433void OH_Drawing_CanvasDrawBitmapRect (OH_Drawing_Canvas* , const OH_Drawing_Bitmap* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*  )
8434```
8435
8436**Description**
8437
8438Draws a portion of a bitmap onto a specified area of the canvas.
8439
8440Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8441
8442If any of **OH_Drawing_Canvas**, **OH_Drawing_Bitmap**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8443
8444**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8445
8446**Since**: 12
8447
8448**Parameters**
8449
8450| Name                       | Description                                                  |
8451| -------------------------- | ------------------------------------------------------------ |
8452| OH_Drawing_Canvas          | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8453| OH_Drawing_Bitmap          | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object. |
8454| src                        | Pointer to a rectangle on the bitmap. If NULL is passed in, it refers to the entire bitmap. |
8455| dst                        | Pointer to a rectangle on the canvas.                        |
8456| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used. |
8457
8458
8459### OH_Drawing_CanvasDrawCircle()
8460
8461```
8462void OH_Drawing_CanvasDrawCircle (OH_Drawing_Canvas* , const OH_Drawing_Point* , float radius )
8463```
8464
8465**Description**
8466
8467Draws a circle.
8468
8469Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8470
8471If either **OH_Drawing_Canvas** or **OH_Drawing_Point** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8472
8473If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8474
8475**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8476
8477**Since**: 11
8478
8479**Parameters**
8480
8481| Name              | Description                                                  |
8482| ----------------- | ------------------------------------------------------------ |
8483| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
8484| OH_Drawing_Point  | Pointer to an **OH_Drawing_Point** object, which indicates the center of the circle. |
8485| radius            | Radius of the circle. The value is invalid if it is less than or equal to 0. |
8486
8487
8488### OH_Drawing_CanvasDrawImageRect()
8489
8490```
8491void OH_Drawing_CanvasDrawImageRect (OH_Drawing_Canvas* , OH_Drawing_Image* , OH_Drawing_Rect* dst, OH_Drawing_SamplingOptions*  )
8492```
8493
8494**Description**
8495
8496Draws an image onto a specified area of the canvas.
8497
8498Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8499
8500If any of **OH_Drawing_Canvas**, **OH_Drawing_Image**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8501
8502**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8503
8504**Since**: 12
8505
8506**Parameters**
8507
8508| Name                       | Description                                                  |
8509| -------------------------- | ------------------------------------------------------------ |
8510| OH_Drawing_Canvas          | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8511| OH_Drawing_Image           | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.  |
8512| dst                        | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.    |
8513| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used. |
8514
8515
8516### OH_Drawing_CanvasDrawImageRectWithSrc()
8517
8518```
8519void OH_Drawing_CanvasDrawImageRectWithSrc (OH_Drawing_Canvas* , const OH_Drawing_Image* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* , OH_Drawing_SrcRectConstraint  )
8520```
8521
8522**Description**
8523
8524Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is scaled and translated to the destination rectangle.
8525
8526Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8527
8528If any of **OH_Drawing_Canvas**, **OH_Drawing_Image**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8529
8530**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8531
8532**Since**: 12
8533
8534**Parameters**
8535
8536| Name                         | Description                                                  |
8537| ---------------------------- | ------------------------------------------------------------ |
8538| OH_Drawing_Canvas            | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8539| OH_Drawing_Image             | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.  |
8540| src                          | Pointer to a source rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. |
8541| dst                          | Pointer to a destination rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. |
8542| OH_Drawing_SamplingOptions   | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used. |
8543| OH_Drawing_SrcRectConstraint | Constraint type. For details about the available options, see [OH_Drawing_SrcRectConstraint](#oh_drawing_srcrectconstraint-1). |
8544
8545
8546### OH_Drawing_CanvasDrawLine()
8547
8548```
8549void OH_Drawing_CanvasDrawLine (OH_Drawing_Canvas* , float x1, float y1, float x2, float y2 )
8550```
8551
8552**Description**
8553
8554Draws a line segment.
8555
8556Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8557
8558If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8559
8560**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8561
8562**Since**: 8
8563
8564**Parameters**
8565
8566| Name              | Description                                          |
8567| ----------------- | ---------------------------------------------------- |
8568| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.          |
8569| x1                | X coordinate of the start point of the line segment. |
8570| y1                | Y coordinate of the start point of the line segment. |
8571| x2                | X coordinate of the end point of the line segment.   |
8572| y2                | Y coordinate of the end point of the line segment.   |
8573
8574
8575### OH_Drawing_CanvasDrawOval()
8576
8577```
8578void OH_Drawing_CanvasDrawOval (OH_Drawing_Canvas* , const OH_Drawing_Rect*  )
8579```
8580
8581**Description**
8582
8583Draws an oval.
8584
8585Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8586
8587If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8588
8589**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8590
8591**Since**: 11
8592
8593**Parameters**
8594
8595| Name              | Description                                 |
8596| ----------------- | ------------------------------------------- |
8597| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8598| OH_Drawing_Rect   | Pointer to an **OH_Drawing_Rect** object.   |
8599
8600
8601### OH_Drawing_CanvasDrawPath()
8602
8603```
8604void OH_Drawing_CanvasDrawPath (OH_Drawing_Canvas* , const OH_Drawing_Path*  )
8605```
8606
8607**Description**
8608
8609Draws a path.
8610
8611Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8612
8613If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8614
8615**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8616
8617**Since**: 8
8618
8619**Parameters**
8620
8621| Name              | Description                                 |
8622| ----------------- | ------------------------------------------- |
8623| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8624| OH_Drawing_Path   | Pointer to an **OH_Drawing_Path** object.   |
8625
8626
8627### OH_Drawing_CanvasDrawPixelMapRect()
8628
8629```
8630void OH_Drawing_CanvasDrawPixelMapRect (OH_Drawing_Canvas* , OH_Drawing_PixelMap* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*  )
8631```
8632
8633**Description**
8634
8635Draws a portion of a pixel map onto a specified area of the canvas.
8636
8637Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8638
8639If any of **OH_Drawing_Canvas**, **OH_Drawing_PixelMap**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8640
8641**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8642
8643**Since**: 12
8644
8645**Parameters**
8646
8647| Name                       | Description                                                  |
8648| -------------------------- | ------------------------------------------------------------ |
8649| OH_Drawing_Canvas          | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8650| OH_Drawing_PixelMap        | Pointer to an [OH_Drawing_PixelMap](#oh_drawing_pixelmap) object. |
8651| src                        | Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map. |
8652| dst                        | Pointer to a rectangle on the canvas.                        |
8653| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. If NULL is passed in, the default sampling options are used. |
8654
8655
8656### OH_Drawing_CanvasDrawPoints()
8657
8658```
8659void OH_Drawing_CanvasDrawPoints (OH_Drawing_Canvas* , OH_Drawing_PointMode mode, uint32_t count, const OH_Drawing_Point2D*  )
8660```
8661
8662**Description**
8663
8664Draws multiple points. You can draw a single point, a line segment, or an open polygon.
8665
8666Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8667
8668If either **OH_Drawing_Canvas** or **OH_Drawing_Point2D** is NULL or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8669
8670If **mode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8671
8672**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8673
8674**Since**: 12
8675
8676**Parameters**
8677
8678| Name                                               | Description                                                  |
8679| -------------------------------------------------- | ------------------------------------------------------------ |
8680| OH_Drawing_Canvas                                  | Pointer to an **OH_Drawing_Canvas** object.                  |
8681| mode                                               | Mode of drawing multiple points. For details about the available options, see [OH_Drawing_PointMode](#oh_drawing_pointmode). |
8682| count                                              | Number of vertices, that is, the number of vertices in the vertex array. |
8683| [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Pointer to an array holding the vertices.                    |
8684
8685
8686### OH_Drawing_CanvasDrawRect()
8687
8688```
8689void OH_Drawing_CanvasDrawRect (OH_Drawing_Canvas* , const OH_Drawing_Rect*  )
8690```
8691
8692**Description**
8693
8694Draws a rectangle.
8695
8696Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8697
8698If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8699
8700**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8701
8702**Since**: 11
8703
8704**Parameters**
8705
8706| Name              | Description                                 |
8707| ----------------- | ------------------------------------------- |
8708| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8709| OH_Drawing_Rect   | Pointer to an **OH_Drawing_Rect** object.   |
8710
8711
8712### OH_Drawing_CanvasDrawRegion()
8713
8714```
8715void OH_Drawing_CanvasDrawRegion (OH_Drawing_Canvas* , const OH_Drawing_Region*  )
8716```
8717
8718**Description**
8719
8720Draws a region.
8721
8722Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8723
8724If either **OH_Drawing_Canvas** or **OH_Drawing_Region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8725
8726**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8727
8728**Since**: 12
8729
8730**Parameters**
8731
8732| Name              | Description                                 |
8733| ----------------- | ------------------------------------------- |
8734| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8735| OH_Drawing_Region | Pointer to an **OH_Drawing_Region** object. |
8736
8737
8738### OH_Drawing_CanvasDrawRoundRect()
8739
8740```
8741void OH_Drawing_CanvasDrawRoundRect (OH_Drawing_Canvas* , const OH_Drawing_RoundRect*  )
8742```
8743
8744**Description**
8745
8746Draws a rounded rectangle.
8747
8748Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8749
8750If either **OH_Drawing_Canvas** or **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8751
8752**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8753
8754**Since**: 11
8755
8756**Parameters**
8757
8758| Name                 | Description                                    |
8759| -------------------- | ---------------------------------------------- |
8760| OH_Drawing_Canvas    | Pointer to an **OH_Drawing_Canvas** object.    |
8761| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object. |
8762
8763
8764### OH_Drawing_CanvasDrawShadow()
8765
8766```
8767void OH_Drawing_CanvasDrawShadow (OH_Drawing_Canvas* , OH_Drawing_Path* , OH_Drawing_Point3D planeParams, OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, OH_Drawing_CanvasShadowFlags flag )
8768```
8769
8770**Description**
8771
8772Draws a spot shadow and uses a given path to outline the ambient shadow.
8773
8774Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8775
8776If either **OH_Drawing_Canvas** or **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8777
8778If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8779
8780**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8781
8782**Since**: 12
8783
8784**Parameters**
8785
8786| Name              | Description                                                  |
8787| ----------------- | ------------------------------------------------------------ |
8788| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8789| OH_Drawing_Path   | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object, which is used to generate the shadow. |
8790| planeParams       | Z-axis offset of an occluder relative to the canvas, based on its x and y coordinates. |
8791| devLightPos       | Position of the light relative to the canvas.                |
8792| lightRadius       | Radius of the light source. The value must be greater than or equal to 0. |
8793| ambientColor      | Ambient shadow color, which is a 32-bit (ARGB) variable.     |
8794| spotColor         | Point shadow color, which is a 32-bit (ARGB) variable.       |
8795| flag              | Shadow flag. For details about the available options, see [OH_Drawing_CanvasShadowFlags](#oh_drawing_canvasshadowflags). |
8796
8797
8798### OH_Drawing_CanvasDrawTextBlob()
8799
8800```
8801void OH_Drawing_CanvasDrawTextBlob (OH_Drawing_Canvas* , const OH_Drawing_TextBlob* , float x, float y )
8802```
8803
8804**Description**
8805
8806Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, that character will not be drawn.
8807
8808Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8809
8810If either **OH_Drawing_Canvas** or **OH_Drawing_TextBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8811
8812**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8813
8814**Since**: 11
8815
8816**Parameters**
8817
8818| Name                | Description                                             |
8819| ------------------- | ------------------------------------------------------- |
8820| OH_Drawing_Canvas   | Pointer to an **OH_Drawing_Canvas** object.             |
8821| OH_Drawing_TextBlob | Pointer to an **OH_Drawing_TextBlob** object.           |
8822| x                   | X coordinate of the lower left corner of the text blob. |
8823| y                   | Y coordinate of the lower left corner of the text blob. |
8824
8825
8826### OH_Drawing_CanvasDrawVertices()
8827
8828```
8829void OH_Drawing_CanvasDrawVertices (OH_Drawing_Canvas* , OH_Drawing_VertexMode vertexMmode, int32_t vertexCount, const OH_Drawing_Point2D* positions, const OH_Drawing_Point2D* texs, const uint32_t* colors, int32_t indexCount, const uint16_t* indices, OH_Drawing_BlendMode mode )
8830```
8831
8832**Description**
8833
8834Draws a triangular grid described by a vertex array.
8835
8836Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8837
8838If either **OH_Drawing_Canvas** or **positions** is NULL, **vertexCount** is less than 3, or **indexCount** is less than 3 but not 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8839
8840If either **vertexMmode** or **mode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
8841
8842**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8843
8844**Since**: 12
8845
8846**Parameters**
8847
8848| Name              | Description                                                  |
8849| ----------------- | ------------------------------------------------------------ |
8850| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
8851| vertexMmode       | Vertex drawing mode. For details about the available options, see [OH_Drawing_VertexMode](#oh_drawing_vertexmode). |
8852| vertexCount       | Number of elements in the vertex array. The value must be greater than or equal to 3. |
8853| positions         | Pointer to the array that holds the position of every vertex. The array cannot be null and its length must be equal to the value of **vertexCount**. |
8854| texs              | Pointer to the array that holds the texture space coordinate corresponding to each vertex. The array can be null. If the array is not null, its length must be equal to the value of **vertexCount**. |
8855| colors            | Pointer to the array that holds the color corresponding to each vertex. It is used for interpolation in a triangle. The array can be null. If the array is not null, its length must be equal to the value of **vertexCount**. |
8856| indexCount        | Number of indices. The value can be 0 or a value greater than or equal to 3. |
8857| indices           | Pointer to the array that holds the index of each vertex. The array can be null. If the array is not null, its length must be equal to the value of **indexCount**. |
8858| mode              | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). |
8859
8860
8861### OH_Drawing_CanvasGetHeight()
8862
8863```
8864int32_t OH_Drawing_CanvasGetHeight (OH_Drawing_Canvas* )
8865```
8866
8867**Description**
8868
8869Obtains the canvas height.
8870
8871Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8872
8873If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8874
8875**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8876
8877**Since**: 12
8878
8879**Parameters**
8880
8881| Name              | Description                                                  |
8882| ----------------- | ------------------------------------------------------------ |
8883| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8884
8885**Returns**
8886
8887Returns the canvas height, in pixels.
8888
8889
8890### OH_Drawing_CanvasGetLocalClipBounds()
8891
8892```
8893void OH_Drawing_CanvasGetLocalClipBounds (OH_Drawing_Canvas* , OH_Drawing_Rect*  )
8894```
8895
8896**Description**
8897
8898Obtains the bounds of the cropping region of a canvas. This function cannot be used for recorded canvases.
8899
8900Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8901
8902If either **OH_Drawing_Canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8903
8904**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8905
8906**Since**: 12
8907
8908**Parameters**
8909
8910| Name              | Description                                                  |
8911| ----------------- | ------------------------------------------------------------ |
8912| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8913| OH_Drawing_Rect   | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is obtained by calling [OH_Drawing_RectCreate](#oh_drawing_rectcreate). |
8914
8915
8916### OH_Drawing_CanvasGetSaveCount()
8917
8918```
8919uint32_t OH_Drawing_CanvasGetSaveCount (OH_Drawing_Canvas* )
8920```
8921
8922**Description**
8923
8924Obtains the number of canvas statuses (canvas matrices) saved in the stack.
8925
8926Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8927
8928If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8929
8930**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8931
8932**Since**: 11
8933
8934**Parameters**
8935
8936| Name              | Description                                 |
8937| ----------------- | ------------------------------------------- |
8938| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
8939
8940**Returns**
8941
8942Returns a 32-bit value that describes the number of canvas statuses (canvas matrices). The initial number is **1**.
8943
8944
8945### OH_Drawing_CanvasGetTotalMatrix()
8946
8947```
8948void OH_Drawing_CanvasGetTotalMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix*  )
8949```
8950
8951**Description**
8952
8953Obtains the 3x3 matrix of a canvas.
8954
8955Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8956
8957If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8958
8959**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8960
8961**Since**: 12
8962
8963**Parameters**
8964
8965| Name              | Description                                                  |
8966| ----------------- | ------------------------------------------------------------ |
8967| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8968| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object, which is obtained by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate). |
8969
8970
8971### OH_Drawing_CanvasGetWidth()
8972
8973```
8974int32_t OH_Drawing_CanvasGetWidth (OH_Drawing_Canvas* )
8975```
8976
8977**Description**
8978
8979Obtains the canvas width.
8980
8981Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
8982
8983If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
8984
8985**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
8986
8987**Since**: 12
8988
8989**Parameters**
8990
8991| Name              | Description                                                  |
8992| ----------------- | ------------------------------------------------------------ |
8993| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
8994
8995**Returns**
8996
8997Returns the canvas width, in px.
8998
8999
9000### OH_Drawing_CanvasReadPixels()
9001
9002```
9003bool OH_Drawing_CanvasReadPixels (OH_Drawing_Canvas* , OH_Drawing_Image_Info* , void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY )
9004```
9005
9006**Description**
9007
9008Copies pixel data from a canvas to a specified address. This function cannot be used for recorded canvases.
9009
9010Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9011
9012If any of **OH_Drawing_Canvas**, **OH_Drawing_Image_Info**, and **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9013
9014**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9015
9016**Since**: 12
9017
9018**Parameters**
9019
9020| Name                                                      | Description                                                  |
9021| --------------------------------------------------------- | ------------------------------------------------------------ |
9022| OH_Drawing_Canvas                                         | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
9023| [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object. |
9024| dstPixels                                                 | Pointer to the start address for storing the pixel data.     |
9025| dstRowBytes                                               | Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0. |
9026| srcX                                                      | X offset of the pixels on the canvas, in px.                 |
9027| srcY                                                      | Y offset of the pixels on the canvas, in px.                 |
9028
9029**Returns**
9030
9031Returns **true** if the pixel data is copied to the start address of the storage; returns **false** otherwise.
9032
9033
9034### OH_Drawing_CanvasReadPixelsToBitmap()
9035
9036```
9037bool OH_Drawing_CanvasReadPixelsToBitmap (OH_Drawing_Canvas* , OH_Drawing_Bitmap* , int32_t srcX, int32_t srcY )
9038```
9039
9040**Description**
9041
9042Copies pixel data from a canvas to an image. This function cannot be used for recorded canvases.
9043
9044Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9045
9046If either **OH_Drawing_Canvas** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9047
9048**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9049
9050**Since**: 12
9051
9052**Parameters**
9053
9054| Name              | Description                                                  |
9055| ----------------- | ------------------------------------------------------------ |
9056| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
9057| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object. |
9058| srcX              | X offset of the pixels on the canvas, in px.                 |
9059| srcY              | Y offset of the pixels on the canvas, in px.                 |
9060
9061**Returns**
9062
9063Returns **true** if the pixel data is copied to the image; returns **false** otherwise.
9064
9065
9066### OH_Drawing_CanvasResetMatrix()
9067
9068```
9069void OH_Drawing_CanvasResetMatrix (OH_Drawing_Canvas* )
9070```
9071
9072**Description**
9073
9074Resets the matrix of a canvas to an identity matrix.
9075
9076Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9077
9078If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9079
9080**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9081
9082**Since**: 12
9083
9084**Parameters**
9085
9086| Name              | Description                                                  |
9087| ----------------- | ------------------------------------------------------------ |
9088| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
9089
9090
9091### OH_Drawing_CanvasRestore()
9092
9093```
9094void OH_Drawing_CanvasRestore (OH_Drawing_Canvas* )
9095```
9096
9097**Description**
9098
9099Restores the canvas status (canvas matrix) saved on the top of the stack.
9100
9101Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9102
9103If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9104
9105**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9106
9107**Since**: 8
9108
9109**Parameters**
9110
9111| Name              | Description                                 |
9112| ----------------- | ------------------------------------------- |
9113| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
9114
9115
9116### OH_Drawing_CanvasRestoreToCount()
9117
9118```
9119void OH_Drawing_CanvasRestoreToCount (OH_Drawing_Canvas* , uint32_t saveCount )
9120```
9121
9122**Description**
9123
9124Restores to a given number of canvas statuses (canvas matrices).
9125
9126Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9127
9128If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9129
9130**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9131
9132**Since**: 11
9133
9134**Parameters**
9135
9136| Name              | Description                                                  |
9137| ----------------- | ------------------------------------------------------------ |
9138| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
9139| saveCount         | Number of canvas statuses (canvas matrices). If the value is less than or equal to 1, the canvas is restored to the initial state. If the value is greater than the number of canvas statuses that have been saved, no operation is performed. |
9140
9141
9142### OH_Drawing_CanvasRotate()
9143
9144```
9145void OH_Drawing_CanvasRotate (OH_Drawing_Canvas* , float degrees, float px, float py )
9146```
9147
9148**Description**
9149
9150Rotates a canvas by a given angle. A positive number indicates a clockwise rotation, and a negative number indicates a counterclockwise rotation.
9151
9152Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9153
9154If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9155
9156**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9157
9158**Since**: 11
9159
9160**Parameters**
9161
9162| Name              | Description                                 |
9163| ----------------- | ------------------------------------------- |
9164| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
9165| degrees           | Angle to rotate.                            |
9166| px                | X coordinate of the rotation center.        |
9167| py                | Y coordinate of the rotation center.        |
9168
9169
9170### OH_Drawing_CanvasSave()
9171
9172```
9173void OH_Drawing_CanvasSave (OH_Drawing_Canvas* )
9174```
9175
9176**Description**
9177
9178Saves the current canvas status (canvas matrix) to the top of the stack. This function must be used in pair with [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore).
9179
9180Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9181
9182If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9183
9184**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9185
9186**Since**: 8
9187
9188**Parameters**
9189
9190| Name              | Description                                 |
9191| ----------------- | ------------------------------------------- |
9192| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
9193
9194
9195### OH_Drawing_CanvasSaveLayer()
9196
9197```
9198void OH_Drawing_CanvasSaveLayer (OH_Drawing_Canvas* , const OH_Drawing_Rect* , const OH_Drawing_Brush*  )
9199```
9200
9201**Description**
9202
9203Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call [OH_Drawing_CanvasRestore](#oh_drawing_canvasrestore), the changes made to the matrix and clipping region are discarded, and the bitmap is drawn.
9204
9205Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9206
9207If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9208
9209**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9210
9211**Since**: 12
9212
9213**Parameters**
9214
9215| Name              | Description                                                  |
9216| ----------------- | ------------------------------------------------------------ |
9217| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
9218| OH_Drawing_Rect   | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is used to limit the size of the graphics layer. If NULL is passed in, the size is not limited. |
9219| OH_Drawing_Brush  | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object. The alpha value, filter effect, and blend mode of the brush are applied when the bitmap is drawn. If NULL is passed in, no effect is applied. |
9220
9221
9222### OH_Drawing_CanvasScale()
9223
9224```
9225void OH_Drawing_CanvasScale (OH_Drawing_Canvas* , float sx, float sy )
9226```
9227
9228**Description**
9229
9230Scales a canvas.
9231
9232Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9233
9234If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9235
9236**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9237
9238**Since**: 11
9239
9240**Parameters**
9241
9242| Name              | Description                                 |
9243| ----------------- | ------------------------------------------- |
9244| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
9245| sx                | Scale ratio on the X axis.                  |
9246| sy                | Scale ratio on the Y axis.                  |
9247
9248
9249### OH_Drawing_CanvasSetMatrix()
9250
9251```
9252void OH_Drawing_CanvasSetMatrix (OH_Drawing_Canvas* , OH_Drawing_Matrix*  )
9253```
9254
9255**Description**
9256
9257Sets the matrix status for a canvas.
9258
9259Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9260
9261If either **OH_Drawing_Canvas** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9262
9263**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9264
9265**Since**: 12
9266
9267**Parameters**
9268
9269| Name              | Description                                                  |
9270| ----------------- | ------------------------------------------------------------ |
9271| OH_Drawing_Canvas | Pointer to an [OH_Drawing_Canvas](#oh_drawing_canvas) object. |
9272| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object, which is obtained by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate). |
9273
9274
9275### OH_Drawing_CanvasSkew()
9276
9277```
9278void OH_Drawing_CanvasSkew (OH_Drawing_Canvas* , float sx, float sy )
9279```
9280
9281**Description**
9282
9283Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and applies the resulting matrix to the canvas. The skew transformation matrix is as follows: \|1 sx 0\| \|sy 1 0\| \|0 0 1\|
9284
9285Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9286
9287If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9288
9289**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9290
9291**Since**: 12
9292
9293**Parameters**
9294
9295| Name              | Description                                                  |
9296| ----------------- | ------------------------------------------------------------ |
9297| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object.                  |
9298| sx                | Amount of tilt on the X axis. A positive number tilts the drawing rightwards along the positive direction of the Y axis, and a negative number tilts the drawing leftwards along the positive direction of the Y axis. |
9299| sy                | Amount of tilt on the Y axis. A positive number tilts the drawing downwards along the positive direction of the X axis, and a negative number tilts the drawing upwards along the positive direction of the X axis. |
9300
9301
9302### OH_Drawing_CanvasTranslate()
9303
9304```
9305void OH_Drawing_CanvasTranslate (OH_Drawing_Canvas* , float dx, float dy )
9306```
9307
9308**Description**
9309
9310Translates a canvas by a given distance.
9311
9312Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9313
9314If **OH_Drawing_Canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9315
9316**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9317
9318**Since**: 11
9319
9320**Parameters**
9321
9322| Name              | Description                                 |
9323| ----------------- | ------------------------------------------- |
9324| OH_Drawing_Canvas | Pointer to an **OH_Drawing_Canvas** object. |
9325| dx                | Distance to translate on the X axis.        |
9326| dy                | Distance to translate on the Y axis.        |
9327
9328
9329### OH_Drawing_ColorFilterCreateBlendMode()
9330
9331```
9332OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateBlendMode (uint32_t color, OH_Drawing_BlendMode  )
9333```
9334
9335**Description**
9336
9337Creates an **OH_Drawing_ColorFilter** object with a given blend mode.
9338
9339**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9340
9341**Since**: 11
9342
9343**Parameters**
9344
9345| Name                 | Description                                                  |
9346| -------------------- | ------------------------------------------------------------ |
9347| color                | Color, which is a 32-bit (ARGB) variable.                    |
9348| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). |
9349
9350**Returns**
9351
9352Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9353
9354
9355### OH_Drawing_ColorFilterCreateCompose()
9356
9357```
9358OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateCompose (OH_Drawing_ColorFilter* colorFilter1, OH_Drawing_ColorFilter* colorFilter2 )
9359```
9360
9361**Description**
9362
9363Creates an **OH_Drawing_ColorFilter** object by combining another two color filters.
9364
9365Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9366
9367If either **colorFilter1** or **colorFilter2** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9368
9369**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9370
9371**Since**: 11
9372
9373**Parameters**
9374
9375| Name         | Description                         |
9376| ------------ | ----------------------------------- |
9377| colorFilter1 | Pointer to the first color filter.  |
9378| colorFilter2 | Pointer to the second color filter. |
9379
9380**Returns**
9381
9382Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9383
9384
9385### OH_Drawing_ColorFilterCreateLinearToSrgbGamma()
9386
9387```
9388OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLinearToSrgbGamma (void )
9389```
9390
9391**Description**
9392
9393Creates an **OH_Drawing_ColorFilter** object that applies the sRGB gamma curve to the RGB channels.
9394
9395**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9396
9397**Since**: 11
9398
9399**Returns**
9400
9401Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9402
9403
9404### OH_Drawing_ColorFilterCreateLuma()
9405
9406```
9407OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateLuma (void )
9408```
9409
9410**Description**
9411
9412Creates an **OH_Drawing_ColorFilter** object that multiplies the passed-in luma into the alpha channel and sets the RGB channels to zero.
9413
9414**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9415
9416**Since**: 11
9417
9418**Returns**
9419
9420Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9421
9422
9423### OH_Drawing_ColorFilterCreateMatrix()
9424
9425```
9426OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateMatrix (const float matrix[20])
9427```
9428
9429**Description**
9430
9431Creates an **OH_Drawing_ColorFilter** object with a given 5x4 color matrix.
9432
9433Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9434
9435If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9436
9437**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9438
9439**Since**: 11
9440
9441**Parameters**
9442
9443| Name   | Description                                                  |
9444| ------ | ------------------------------------------------------------ |
9445| matrix | Matrix, which is represented by a floating-point array with a length of 20. |
9446
9447**Returns**
9448
9449Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9450
9451
9452### OH_Drawing_ColorFilterCreateSrgbGammaToLinear()
9453
9454```
9455OH_Drawing_ColorFilter* OH_Drawing_ColorFilterCreateSrgbGammaToLinear (void )
9456```
9457
9458**Description**
9459
9460Creates an **OH_Drawing_ColorFilter** object that applies the RGB channels to the sRGB gamma curve.
9461
9462**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9463
9464**Since**: 11
9465
9466**Returns**
9467
9468Returns the pointer to the **OH_Drawing_ColorFilter** object created.
9469
9470
9471### OH_Drawing_ColorFilterDestroy()
9472
9473```
9474void OH_Drawing_ColorFilterDestroy (OH_Drawing_ColorFilter* )
9475```
9476
9477**Description**
9478
9479Destroys an **OH_Drawing_ColorFilter** object and reclaims the memory occupied by the object.
9480
9481**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9482
9483**Since**: 11
9484
9485**Parameters**
9486
9487| Name                   | Description                                      |
9488| ---------------------- | ------------------------------------------------ |
9489| OH_Drawing_ColorFilter | Pointer to an **OH_Drawing_ColorFilter** object. |
9490
9491
9492### OH_Drawing_ColorSetArgb()
9493
9494```
9495uint32_t OH_Drawing_ColorSetArgb (uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue )
9496```
9497
9498**Description**
9499
9500Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color.
9501
9502**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9503
9504**Since**: 8
9505
9506**Parameters**
9507
9508| Name  | Description                                           |
9509| ----- | ----------------------------------------------------- |
9510| alpha | Alpha, which is a variable ranging from 0x00 to 0xFF. |
9511| red   | Read, which is a variable ranging from 0x00 to 0xFF.  |
9512| green | Green, which is a variable ranging from 0x00 to 0xFF. |
9513| blue  | Blue, which is a variable ranging from 0x00 to 0xFF.  |
9514
9515**Returns**
9516
9517Returns a 32-bit (ARGB) variable that describes the color.
9518
9519
9520### OH_Drawing_ColorSpaceCreateSrgb()
9521
9522```
9523OH_Drawing_ColorSpace* OH_Drawing_ColorSpaceCreateSrgb (void )
9524```
9525
9526**Description**
9527
9528Creates an sRGB color space.
9529
9530**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9531
9532**Since**: 12
9533
9534**Returns**
9535
9536Returns the pointer to the [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object created.
9537
9538
9539### OH_Drawing_ColorSpaceCreateSrgbLinear()
9540
9541```
9542OH_Drawing_ColorSpace* OH_Drawing_ColorSpaceCreateSrgbLinear (void )
9543```
9544
9545**Description**
9546
9547Creates an sRGB linear (Gamma 1.0) color space.
9548
9549**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9550
9551**Since**: 12
9552
9553**Returns**
9554
9555Returns the pointer to the [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object created.
9556
9557
9558### OH_Drawing_ColorSpaceDestroy()
9559
9560```
9561void OH_Drawing_ColorSpaceDestroy (OH_Drawing_ColorSpace* )
9562```
9563
9564**Description**
9565
9566Destroys an **OH_Drawing_ColorSpace** object and reclaims the memory occupied by the object.
9567
9568**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9569
9570**Since**: 12
9571
9572**Parameters**
9573
9574| Name                  | Description                                                  |
9575| --------------------- | ------------------------------------------------------------ |
9576| OH_Drawing_ColorSpace | Pointer to an [OH_Drawing_ColorSpace](#oh_drawing_colorspace) object. |
9577
9578
9579### OH_Drawing_CreateDashPathEffect()
9580
9581```
9582OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect (float* intervals, int count, float phase )
9583```
9584
9585**Description**
9586
9587Creates an **OH_Drawing_PathEffect** object with a dashed line effect. The dashed line effect is determined by a group of "on" and "off" intervals.
9588
9589Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
9590
9591If **intervals** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
9592
9593**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9594
9595**Since**: 12
9596
9597**Parameters**
9598
9599| Name      | Description                                                  |
9600| --------- | ------------------------------------------------------------ |
9601| intervals | Pointer to the start address of the dashed line interval array. In the array, an even entry indicates an "on" interval and an odd entry indicates an "off" interval. The unit is px. |
9602| count     | Number of entries in the dashed line interval array. The value must be an even number greater than 0. |
9603| phase     | Offset in the dashed line interval array.                    |
9604
9605**Returns**
9606
9607Returns the pointer to the [OH_Drawing_PathEffect](#oh_drawing_patheffect) object created.
9608
9609
9610### OH_Drawing_CreateFontCollection()
9611
9612```
9613OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection (void )
9614```
9615
9616**Description**
9617
9618Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. The [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object created by this function can be used by only one [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. To share an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object among multiple [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) objects, use [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) to create it.
9619
9620**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9621
9622**Since**: 8
9623
9624**Returns**
9625
9626Returns the pointer to the **OH_Drawing_FontCollection** object created.
9627
9628
9629### OH_Drawing_CreateFontDescriptor()
9630
9631```
9632OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor (void )
9633```
9634
9635**Description**
9636
9637Creates an **OH_Drawing_FontDescriptor** object to describe the detailed information about a system font.
9638
9639**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9640
9641**Since**: 12
9642
9643**Returns**
9644
9645Returns the pointer to the [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object created.
9646
9647
9648### OH_Drawing_CreateFontParser()
9649
9650```
9651OH_Drawing_FontParser* OH_Drawing_CreateFontParser (void )
9652```
9653
9654**Description**
9655
9656Creates an **OH_Drawing_FontParser** object to parse a system font.
9657
9658**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9659
9660**Since**: 12
9661
9662**Returns**
9663
9664Returns the pointer to the [OH_Drawing_FontParser](#oh_drawing_fontparser) object created.
9665
9666
9667### OH_Drawing_CreateSharedFontCollection()
9668
9669```
9670OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection (void )
9671```
9672
9673**Description**
9674
9675Creates an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object.
9676
9677**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9678
9679**Since**: 12
9680
9681**Returns**
9682
9683Returns the pointer to the **OH_Drawing_FontCollection** object created.
9684
9685### OH_Drawing_ClearFontCaches()
9686
9687```
9688void OH_Drawing_ClearFontCaches (OH_Drawing_FontCollection* )
9689```
9690
9691**Description**
9692
9693Clears the font cache. (The font cache has a memory limit and a clearing mechanism. It occupies limited memory. You are not advised to clear it unless otherwise required.)
9694
9695**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9696
9697**Since**: 12
9698
9699**Parameters**
9700
9701| Name                      | Description                                                  |
9702| ------------------------- | ------------------------------------------------------------ |
9703| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. |
9704
9705### OH_Drawing_CreateTextShadow()
9706
9707```
9708OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow (void )
9709```
9710
9711**Description**
9712
9713Creates an **OH_Drawing_TextShadow** object. When [OH_Drawing_TextShadow](#oh_drawing_textshadow) is no longer required, call [OH_Drawing_DestroyTextShadow](#oh_drawing_destroytextshadow) to release the pointer to the object.
9714
9715**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9716
9717**Since**: 12
9718
9719**Returns**
9720
9721Returns the pointer to the **OH_Drawing_TextShadow** object created.
9722
9723
9724### OH_Drawing_CreateTextStyle()
9725
9726```
9727OH_Drawing_TextStyle* OH_Drawing_CreateTextStyle (void )
9728```
9729
9730**Description**
9731
9732Creates an **OH_Drawing_TextStyle** object.
9733
9734**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9735
9736**Since**: 8
9737
9738**Returns**
9739
9740Returns the pointer to the **OH_Drawing_TextStyle** object created.
9741
9742
9743### OH_Drawing_CreateTypography()
9744
9745```
9746OH_Drawing_Typography* OH_Drawing_CreateTypography (OH_Drawing_TypographyCreate* )
9747```
9748
9749**Description**
9750
9751Creates an **OH_Drawing_Typography** object. When [OH_Drawing_Typography](#oh_drawing_typography) is no longer required, call [OH_Drawing_DestroyTypography](#oh_drawing_destroytypography) to release the pointer to the object.
9752
9753**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9754
9755**Since**: 8
9756
9757**Parameters**
9758
9759| Name                        | Description                                                  |
9760| --------------------------- | ------------------------------------------------------------ |
9761| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
9762
9763**Returns**
9764
9765Returns the pointer to the **OH_Drawing_Typography** object created.
9766
9767
9768### OH_Drawing_CreateTypographyHandler()
9769
9770```
9771OH_Drawing_TypographyCreate* OH_Drawing_CreateTypographyHandler (OH_Drawing_TypographyStyle* , OH_Drawing_FontCollection*  )
9772```
9773
9774**Description**
9775
9776Creates an **OH_Drawing_TypographyCreate** object. When [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) is no longer required, call [OH_Drawing_DestroyTypographyHandler](#oh_drawing_destroytypographyhandler) to release the pointer to the object.
9777
9778**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9779
9780**Since**: 8
9781
9782**Parameters**
9783
9784| Name                       | Description                                                  |
9785| -------------------------- | ------------------------------------------------------------ |
9786| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
9787| OH_Drawing_FontCollection  | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object, which is obtained by calling [OH_Drawing_CreateFontCollection](#oh_drawing_createfontcollection) or [OH_Drawing_CreateSharedFontCollection](#oh_drawing_createsharedfontcollection) (recommended). |
9788
9789**Returns**
9790
9791Returns the pointer to the **OH_Drawing_TypographyCreate** object created.
9792
9793
9794### OH_Drawing_CreateTypographyStyle()
9795
9796```
9797OH_Drawing_TypographyStyle* OH_Drawing_CreateTypographyStyle (void )
9798```
9799
9800**Description**
9801
9802Creates an **OH_Drawing_TypographyStyle** object. When [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) is no longer required, call [OH_Drawing_DestroyTypographyStyle](#oh_drawing_destroytypographystyle) to release the pointer to the object.
9803
9804**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9805
9806**Since**: 8
9807
9808**Returns**
9809
9810Returns the pointer to the **OH_Drawing_TypographyStyle** object created.
9811
9812
9813### OH_Drawing_DestroyFontCollection()
9814
9815```
9816void OH_Drawing_DestroyFontCollection (OH_Drawing_FontCollection* )
9817```
9818
9819**Description**
9820
9821Destroys an **OH_Drawing_FontCollection** object and reclaims the memory occupied by the object.
9822
9823**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9824
9825**Since**: 8
9826
9827**Parameters**
9828
9829| Name                      | Description                                         |
9830| ------------------------- | --------------------------------------------------- |
9831| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. |
9832
9833
9834### OH_Drawing_DestroyFontDescriptor()
9835
9836```
9837void OH_Drawing_DestroyFontDescriptor (OH_Drawing_FontDescriptor* )
9838```
9839
9840**Description**
9841
9842Destroys an **OH_Drawing_FontDescriptor** object and reclaims the memory occupied by the object.
9843
9844**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9845
9846**Since**: 12
9847
9848**Parameters**
9849
9850| Name                                                         | Description                                                  |
9851| ------------------------------------------------------------ | ------------------------------------------------------------ |
9852| [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) | Pointer to a [OH_Drawing_FontDescriptor](_o_h___drawing___font_descriptor.md) object, which is obtained by calling [OH_Drawing_CreateFontDescriptor](#oh_drawing_createfontdescriptor). |
9853
9854
9855### OH_Drawing_DestroyFontParser()
9856
9857```
9858void OH_Drawing_DestroyFontParser (OH_Drawing_FontParser* )
9859```
9860
9861**Description**
9862
9863Destroys an **OH_Drawing_FontParser** object and reclaims the memory occupied by the object.
9864
9865**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9866
9867**Since**: 12
9868
9869**Parameters**
9870
9871| Name                  | Description                                                  |
9872| --------------------- | ------------------------------------------------------------ |
9873| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). |
9874
9875
9876### OH_Drawing_DestroyLineMetrics()
9877
9878```
9879void OH_Drawing_DestroyLineMetrics (OH_Drawing_LineMetrics* )
9880```
9881
9882**Description**
9883
9884Destroys an **OH_Drawing_LineMetrics** object and reclaims the memory occupied by the object.
9885
9886**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9887
9888**Since**: 12
9889
9890**Parameters**
9891
9892| Name                   | Description                                                  |
9893| ---------------------- | ------------------------------------------------------------ |
9894| OH_Drawing_LineMetrics | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). |
9895
9896
9897### OH_Drawing_DestroySystemFontConfigInfo()
9898
9899```
9900void OH_Drawing_DestroySystemFontConfigInfo (OH_Drawing_FontConfigInfo* )
9901```
9902
9903**Description**
9904
9905Reclaims the memory occupied by the system font configuration.
9906
9907**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9908
9909**Since**: 12
9910
9911**Parameters**
9912
9913| Name                      | Description                                                  |
9914| ------------------------- | ------------------------------------------------------------ |
9915| OH_Drawing_FontConfigInfo | Pointer to an [OH_Drawing_FontConfigInfo](_o_h___drawing___font_config_info.md) object, which is obtained by calling [OH_Drawing_GetSystemFontConfigInfo](#oh_drawing_getsystemfontconfiginfo). |
9916
9917
9918### OH_Drawing_DestroySystemFontList()
9919
9920```
9921void OH_Drawing_DestroySystemFontList (char** , size_t  )
9922```
9923
9924**Description**
9925
9926Reclaims the memory occupied by the system font list.
9927
9928**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9929
9930**Since**: 12
9931
9932**Parameters**
9933
9934| Name     | Description                                      |
9935| -------- | ------------------------------------------------ |
9936| char\*\* | Double pointer to the list of system font names. |
9937| size_t\* | Number of system font names.                     |
9938
9939
9940### OH_Drawing_DestroyTextShadow()
9941
9942```
9943void OH_Drawing_DestroyTextShadow (OH_Drawing_TextShadow* )
9944```
9945
9946**Description**
9947
9948Destroys an **OH_Drawing_TextShadow** object and reclaims the memory occupied by the object.
9949
9950**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9951
9952**Since**: 12
9953
9954**Parameters**
9955
9956| Name                  | Description                                                  |
9957| --------------------- | ------------------------------------------------------------ |
9958| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). |
9959
9960
9961### OH_Drawing_DestroyTextShadows()
9962
9963```
9964void OH_Drawing_DestroyTextShadows (OH_Drawing_TextShadow* )
9965```
9966
9967**Description**
9968
9969Reclaims the memory occupied by the vector consisting of the **OH_Drawing_TextShadow** objects.
9970
9971**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9972
9973**Since**: 12
9974
9975**Parameters**
9976
9977| Name                  | Description                                                  |
9978| --------------------- | ------------------------------------------------------------ |
9979| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). |
9980
9981
9982### OH_Drawing_DestroyTextStyle()
9983
9984```
9985void OH_Drawing_DestroyTextStyle (OH_Drawing_TextStyle* )
9986```
9987
9988**Description**
9989
9990Destroys an **OH_Drawing_TextStyle** object and reclaims the memory occupied by the object.
9991
9992**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
9993
9994**Since**: 8
9995
9996**Parameters**
9997
9998| Name                 | Description                                                  |
9999| -------------------- | ------------------------------------------------------------ |
10000| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
10001
10002
10003### OH_Drawing_DestroyTypography()
10004
10005```
10006void OH_Drawing_DestroyTypography (OH_Drawing_Typography* )
10007```
10008
10009**Description**
10010
10011Destroys an **OH_Drawing_Typography** object and reclaims the memory occupied by the object.
10012
10013**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10014
10015**Since**: 8
10016
10017**Parameters**
10018
10019| Name                  | Description                                                  |
10020| --------------------- | ------------------------------------------------------------ |
10021| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
10022
10023
10024### OH_Drawing_DestroyTypographyHandler()
10025
10026```
10027void OH_Drawing_DestroyTypographyHandler (OH_Drawing_TypographyCreate* )
10028```
10029
10030**Description**
10031
10032Destroys an **OH_Drawing_TypographyCreate** object and reclaims the memory occupied by the object.
10033
10034**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10035
10036**Since**: 8
10037
10038**Parameters**
10039
10040| Name                        | Description                                                  |
10041| --------------------------- | ------------------------------------------------------------ |
10042| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
10043
10044
10045### OH_Drawing_DestroyTypographyStyle()
10046
10047```
10048void OH_Drawing_DestroyTypographyStyle (OH_Drawing_TypographyStyle* )
10049```
10050
10051**Description**
10052
10053Destroys an **OH_Drawing_TypographyStyle** object and reclaims the memory occupied by the object.
10054
10055**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10056
10057**Since**: 8
10058
10059**Parameters**
10060
10061| Name                       | Description                                                  |
10062| -------------------------- | ------------------------------------------------------------ |
10063| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
10064
10065
10066### OH_Drawing_DisableFontCollectionFallback()
10067
10068```
10069void OH_Drawing_DisableFontCollectionFallback (OH_Drawing_FontCollection* fontCollection)
10070```
10071
10072**Description**
10073
10074Disables the system fonts.
10075
10076**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10077
10078**Since**: 12
10079
10080**Parameters**
10081
10082| Name                      | Description                                                  |
10083| ------------------------- | ------------------------------------------------------------ |
10084| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. |
10085
10086
10087### OH_Drawing_DisableFontCollectionSystemFont()
10088
10089```
10090void OH_Drawing_DisableFontCollectionSystemFont (OH_Drawing_FontCollection* fontCollection)
10091```
10092
10093**Description**
10094
10095Disables the system fonts.
10096
10097**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10098
10099**Since**: 12
10100
10101**Parameters**
10102
10103| Name                      | Description                                                  |
10104| ------------------------- | ------------------------------------------------------------ |
10105| OH_Drawing_FontCollection | Pointer to an [OH_Drawing_FontCollection](#oh_drawing_fontcollection) object. |
10106
10107
10108### OH_Drawing_FilterCreate()
10109
10110```
10111OH_Drawing_Filter* OH_Drawing_FilterCreate (void )
10112```
10113
10114**Description**
10115
10116Creates an **OH_Drawing_Filter** object.
10117
10118**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10119
10120**Since**: 11
10121
10122**Returns**
10123
10124Returns the pointer to the **OH_Drawing_Filter** object created.
10125
10126
10127### OH_Drawing_FilterDestroy()
10128
10129```
10130void OH_Drawing_FilterDestroy (OH_Drawing_Filter* )
10131```
10132
10133**Description**
10134
10135Destroys an **OH_Drawing_Filter** object and reclaims the memory occupied by the object.
10136
10137**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10138
10139**Since**: 11
10140
10141**Parameters**
10142
10143| Name              | Description                                 |
10144| ----------------- | ------------------------------------------- |
10145| OH_Drawing_Filter | Pointer to an **OH_Drawing_Filter** object. |
10146
10147
10148### OH_Drawing_FilterGetColorFilter()
10149
10150```
10151void OH_Drawing_FilterGetColorFilter (OH_Drawing_Filter* , OH_Drawing_ColorFilter*  )
10152```
10153
10154**Description**
10155
10156Obtains an **OH_Drawing_ColorFilter** object from an **OH_Drawing_Filter** object.
10157
10158Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10159
10160If either **OH_Drawing_Filter** or **OH_Drawing_ColorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10161
10162**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10163
10164**Since**: 12
10165
10166**Parameters**
10167
10168| Name                   | Description                                                  |
10169| ---------------------- | ------------------------------------------------------------ |
10170| OH_Drawing_Filter      | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. |
10171| OH_Drawing_ColorFilter | Pointer to an [OH_Drawing_ColorFilter](#oh_drawing_colorfilter) object. |
10172
10173
10174### OH_Drawing_FilterSetColorFilter()
10175
10176```
10177void OH_Drawing_FilterSetColorFilter (OH_Drawing_Filter* , OH_Drawing_ColorFilter*  )
10178```
10179
10180**Description**
10181
10182Sets an **OH_Drawing_ColorFilter** object for an **OH_Drawing_Filter** object.
10183
10184Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10185
10186If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10187
10188**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10189
10190**Since**: 11
10191
10192**Parameters**
10193
10194| Name                   | Description                                                  |
10195| ---------------------- | ------------------------------------------------------------ |
10196| OH_Drawing_Filter      | Pointer to an **OH_Drawing_Filter** object.                  |
10197| OH_Drawing_ColorFilter | Pointer to an **OH_Drawing_ColorFilter** object. If NULL is passed in, the color filter effect of the object will be cleared. |
10198
10199
10200### OH_Drawing_FilterSetMaskFilter()
10201
10202```
10203void OH_Drawing_FilterSetMaskFilter (OH_Drawing_Filter* , OH_Drawing_MaskFilter*  )
10204```
10205
10206**Description**
10207
10208Sets an **OH_Drawing_MaskFilter** object for an **OH_Drawing_Filter** object.
10209
10210Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10211
10212If **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10213
10214**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10215
10216**Since**: 11
10217
10218**Parameters**
10219
10220| Name                  | Description                                                  |
10221| --------------------- | ------------------------------------------------------------ |
10222| OH_Drawing_Filter     | Pointer to an **OH_Drawing_Filter** object.                  |
10223| OH_Drawing_MaskFilter | Pointer to an **OH_Drawing_MaskFilter** object. If NULL is passed in, the mask filter effect of the object will be cleared. |
10224
10225
10226### OH_Drawing_FontCountText()
10227
10228```
10229int OH_Drawing_FontCountText (OH_Drawing_Font* , const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding )
10230```
10231
10232**Description**
10233
10234Obtains the number of glyphs represented by text.
10235
10236Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10237
10238If either **OH_Drawing_Font** or **text** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10239
10240**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10241
10242**Since**: 12
10243
10244**Parameters**
10245
10246| Name            | Description                                                  |
10247| --------------- | ------------------------------------------------------------ |
10248| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.    |
10249| text            | Pointer to the start address of the storage.                 |
10250| byteLength      | Text length, in bytes.                                       |
10251| encoding        | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). |
10252
10253
10254### OH_Drawing_FontCreate()
10255
10256```
10257OH_Drawing_Font* OH_Drawing_FontCreate (void )
10258```
10259
10260**Description**
10261
10262Creates an **OH_Drawing_Font** object.
10263
10264**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10265
10266**Since**: 11
10267
10268**Returns**
10269
10270Returns the pointer to the **OH_Drawing_Font** object created.
10271
10272
10273### OH_Drawing_FontDestroy()
10274
10275```
10276void OH_Drawing_FontDestroy (OH_Drawing_Font* )
10277```
10278
10279**Description**
10280
10281Destroys an **OH_Drawing_Font** object and reclaims the memory occupied by the object.
10282
10283**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10284
10285**Since**: 11
10286
10287**Parameters**
10288
10289| Name            | Description                               |
10290| --------------- | ----------------------------------------- |
10291| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object. |
10292
10293
10294### OH_Drawing_FontGetMetrics()
10295
10296```
10297float OH_Drawing_FontGetMetrics (OH_Drawing_Font* , OH_Drawing_Font_Metrics*  )
10298```
10299
10300**Description**
10301
10302Obtains the measurement information about a font.
10303
10304Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10305
10306If either **OH_Drawing_Font** or **OH_Drawing_Font_Metrics** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10307
10308**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10309
10310**Since**: 12
10311
10312**Parameters**
10313
10314| Name                    | Description                                                  |
10315| ----------------------- | ------------------------------------------------------------ |
10316| OH_Drawing_Font         | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.    |
10317| OH_Drawing_Font_Metrics | Pointer to an [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) object. |
10318
10319**Returns**
10320
10321Returns a floating-point variable that indicates the recommended interline spacing.
10322
10323
10324### OH_Drawing_FontGetTypeface()
10325
10326```
10327OH_Drawing_Typeface* OH_Drawing_FontGetTypeface (OH_Drawing_Font* )
10328```
10329
10330**Description**
10331
10332Obtains the typeface of a font.
10333
10334Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10335
10336If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10337
10338**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10339
10340**Since**: 12
10341
10342**Parameters**
10343
10344| Name            | Description                                               |
10345| --------------- | --------------------------------------------------------- |
10346| OH_Drawing_Font | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object. |
10347
10348**Returns**
10349
10350Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object.
10351
10352
10353### OH_Drawing_FontMgrCreate()
10354
10355```
10356OH_Drawing_FontMgr* OH_Drawing_FontMgrCreate (void )
10357```
10358
10359**Description**
10360
10361Creates an **OH_Drawing_FontMgr** object, which can be used only to manage system fonts.
10362
10363**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10364
10365**Since**: 12
10366
10367**Returns**
10368
10369Returns the pointer to the [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object created.
10370
10371
10372### OH_Drawing_FontMgrCreateFontStyleSet()
10373
10374```
10375OH_Drawing_FontStyleSet* OH_Drawing_FontMgrCreateFontStyleSet (OH_Drawing_FontMgr* , int index )
10376```
10377
10378**Description**
10379
10380Creates a font style set from an **OH_Drawing_FontMgr** object.
10381
10382**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10383
10384**Since**: 12
10385
10386**Parameters**
10387
10388| Name               | Description                                                  |
10389| ------------------ | ------------------------------------------------------------ |
10390| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10391| index              | Index of the font style set.                                 |
10392
10393**Returns**
10394
10395Returns the pointer to the [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object created.
10396
10397
10398### OH_Drawing_FontMgrDestroy()
10399
10400```
10401void OH_Drawing_FontMgrDestroy (OH_Drawing_FontMgr* )
10402```
10403
10404**Description**
10405
10406Destroys an **OH_Drawing_FontMgr** object and reclaims the memory occupied by the object.
10407
10408**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10409
10410**Since**: 12
10411
10412**Parameters**
10413
10414| Name               | Description                                                  |
10415| ------------------ | ------------------------------------------------------------ |
10416| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10417
10418
10419### OH_Drawing_FontMgrDestroyFamilyName()
10420
10421```
10422void OH_Drawing_FontMgrDestroyFamilyName (char* familyName)
10423```
10424
10425**Description**
10426
10427Reclaims the memory occupied by a font family name.
10428
10429**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10430
10431**Since**: 12
10432
10433**Parameters**
10434
10435| Name       | Description                    |
10436| ---------- | ------------------------------ |
10437| familyName | Pointer to a font family name. |
10438
10439
10440### OH_Drawing_FontMgrDestroyFontStyleSet()
10441
10442```
10443void OH_Drawing_FontMgrDestroyFontStyleSet (OH_Drawing_FontStyleSet* )
10444```
10445
10446**Description**
10447
10448Reclaims the memory occupied by a font style set.
10449
10450**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10451
10452**Since**: 12
10453
10454**Parameters**
10455
10456| Name                    | Description                                                  |
10457| ----------------------- | ------------------------------------------------------------ |
10458| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. |
10459
10460
10461### OH_Drawing_FontMgrGetFamilyCount()
10462
10463```
10464int OH_Drawing_FontMgrGetFamilyCount (OH_Drawing_FontMgr* )
10465```
10466
10467**Description**
10468
10469Obtains the number of font families.
10470
10471**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10472
10473**Since**: 12
10474
10475**Parameters**
10476
10477| Name               | Description                                                  |
10478| ------------------ | ------------------------------------------------------------ |
10479| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10480
10481**Returns**
10482
10483Returns the number of font families.
10484
10485
10486### OH_Drawing_FontMgrGetFamilyName()
10487
10488```
10489char* OH_Drawing_FontMgrGetFamilyName (OH_Drawing_FontMgr* , int index )
10490```
10491
10492**Description**
10493
10494Obtains the font family name based on an index.
10495
10496**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10497
10498**Since**: 12
10499
10500**Parameters**
10501
10502| Name               | Description                                                  |
10503| ------------------ | ------------------------------------------------------------ |
10504| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10505| index              | Index of the font family name.                               |
10506
10507**Returns**
10508
10509Returns the font family name. When the font family name is no longer required, call [OH_Drawing_FontMgrDestroyFamilyName](#oh_drawing_fontmgrdestroyfamilyname) to release the pointer to the object.
10510
10511
10512### OH_Drawing_FontMgrMatchFamily()
10513
10514```
10515OH_Drawing_FontStyleSet* OH_Drawing_FontMgrMatchFamily (OH_Drawing_FontMgr* , const char* familyName )
10516```
10517
10518**Description**
10519
10520Obtains a font style set based on a font family name.
10521
10522**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10523
10524**Since**: 12
10525
10526**Parameters**
10527
10528| Name               | Description                                                  |
10529| ------------------ | ------------------------------------------------------------ |
10530| OH_Drawing_FontMgr | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10531| familyName         | Pointer to a font family name.                               |
10532
10533**Returns**
10534
10535Returns the pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. When the object is no longer required, call [OH_Drawing_FontMgrDestroyFontStyleSet](#oh_drawing_fontmgrdestroyfontstyleset) to release the pointer to the object.
10536
10537
10538### OH_Drawing_FontMgrMatchFamilyStyle()
10539
10540```
10541OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyle (OH_Drawing_FontMgr* , const char* familyName, OH_Drawing_FontStyleStruct  )
10542```
10543
10544**Description**
10545
10546Obtains a typeface based on the font style information and font family name.
10547
10548**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10549
10550**Since**: 12
10551
10552**Parameters**
10553
10554| Name                                                         | Description                                                  |
10555| ------------------------------------------------------------ | ------------------------------------------------------------ |
10556| OH_Drawing_FontMgr                                           | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10557| familyName                                                   | Pointer to a font family name.                               |
10558| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant.     |
10559
10560**Returns**
10561
10562Returns the pointer to an [OH_Drawing_Typeface](#oh_drawing_typeface) object. When the object is no longer required, call [OH_Drawing_TypefaceDestroy](#oh_drawing_typefacedestroy) to release the pointer to the object.
10563
10564
10565### OH_Drawing_FontMgrMatchFamilyStyleCharacter()
10566
10567```
10568OH_Drawing_Typeface* OH_Drawing_FontMgrMatchFamilyStyleCharacter (OH_Drawing_FontMgr* , const char* familyName, OH_Drawing_FontStyleStruct , const char* bcp47[], int bcp47Count, int32_t character )
10569```
10570
10571**Description**
10572
10573Obtains a typeface for the specified character. A null pointer is returned only when no typeface corresponding to the input UTF-8 character is found in the **OH_Drawing_FontMgr** object.
10574
10575**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10576
10577**Since**: 12
10578
10579**Parameters**
10580
10581| Name                                                         | Description                                                  |
10582| ------------------------------------------------------------ | ------------------------------------------------------------ |
10583| OH_Drawing_FontMgr                                           | Pointer to an [OH_Drawing_FontMgr](#oh_drawing_fontmgr) object, which is obtained by calling [OH_Drawing_FontMgrCreate](#oh_drawing_fontmgrcreate). |
10584| familyName                                                   | Pointer to a font family name.                               |
10585| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant.     |
10586| bcp47                                                        | Pointer to the character language code array, which is a combination of ISO 639, 15924, and 3166-1 language codes. |
10587| bcp47Count                                                   | Size of the character language code array.                   |
10588| character                                                    | UTF8 character used for matching.                            |
10589
10590**Returns**
10591
10592Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object obtained.
10593
10594
10595### OH_Drawing_FontParserGetFontByName()
10596
10597```
10598OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName (OH_Drawing_FontParser* , const char*  )
10599```
10600
10601**Description**
10602
10603Obtains the descriptor of a system font based on the font name.
10604
10605**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10606
10607**Since**: 12
10608
10609**Parameters**
10610
10611| Name                  | Description                                                  |
10612| --------------------- | ------------------------------------------------------------ |
10613| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). |
10614| char\*                | Pointer to the system font name.                             |
10615
10616**Returns**
10617
10618Returns the system font description object. When the object is no longer required, call [OH_Drawing_DestroyFontParser](#oh_drawing_destroyfontparser) to release the pointer to the object.
10619
10620
10621### OH_Drawing_FontParserGetSystemFontList()
10622
10623```
10624char** OH_Drawing_FontParserGetSystemFontList (OH_Drawing_FontParser* , size_t*  )
10625```
10626
10627**Description**
10628
10629Obtains the list of system fonts. This function can be used only on 2-in-1 devices and phones.
10630
10631**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10632
10633**Since**: 12
10634
10635**Parameters**
10636
10637| Name                  | Description                                                  |
10638| --------------------- | ------------------------------------------------------------ |
10639| OH_Drawing_FontParser | Pointer to an [OH_Drawing_FontParser](#oh_drawing_fontparser) object, which is obtained by calling [OH_Drawing_CreateFontParser](#oh_drawing_createfontparser). |
10640| size_t                | Pointer to the number of system font names.                  |
10641
10642**Returns**
10643
10644Returns the system font list.
10645
10646
10647### OH_Drawing_FontSetFakeBoldText()
10648
10649```
10650void OH_Drawing_FontSetFakeBoldText (OH_Drawing_Font* , bool isFakeBoldText )
10651```
10652
10653**Description**
10654
10655Sets fake bold for a font by increasing the stroke width.
10656
10657Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10658
10659If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10660
10661**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10662
10663**Since**: 11
10664
10665**Parameters**
10666
10667| Name            | Description                                                  |
10668| --------------- | ------------------------------------------------------------ |
10669| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object.                    |
10670| isFakeBoldText  | Whether to set fake bold. The value **true** means to set fake bold, and **false** means the opposite. |
10671
10672
10673### OH_Drawing_FontSetLinearText()
10674
10675```
10676void OH_Drawing_FontSetLinearText (OH_Drawing_Font* , bool isLinearText )
10677```
10678
10679**Description**
10680
10681Sets linear scaling for a font.
10682
10683Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10684
10685If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10686
10687**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10688
10689**Since**: 11
10690
10691**Parameters**
10692
10693| Name            | Description                                                  |
10694| --------------- | ------------------------------------------------------------ |
10695| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object.                    |
10696| isLinearText    | Whether to set linear scaling. The value **true** means to set linear scaling, and **false** means the opposite. |
10697
10698
10699### OH_Drawing_FontSetTextSize()
10700
10701```
10702void OH_Drawing_FontSetTextSize (OH_Drawing_Font* , float textSize )
10703```
10704
10705**Description**
10706
10707Sets the font size.
10708
10709Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10710
10711If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10712
10713**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10714
10715**Since**: 11
10716
10717**Parameters**
10718
10719| Name            | Description                                                  |
10720| --------------- | ------------------------------------------------------------ |
10721| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object.                    |
10722| textSize        | Text size. The value is a floating point number. If a negative number is passed in, the size is set to 0. If the size is 0, the text drawn will not be displayed. |
10723
10724
10725### OH_Drawing_FontSetTextSkewX()
10726
10727```
10728void OH_Drawing_FontSetTextSkewX (OH_Drawing_Font* , float skewX )
10729```
10730
10731**Description**
10732
10733Sets a horizontal skew factor for a font.
10734
10735Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10736
10737If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10738
10739**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10740
10741**Since**: 11
10742
10743**Parameters**
10744
10745| Name            | Description                                |
10746| --------------- | ------------------------------------------ |
10747| OH_Drawing_Font | Pointer to an **OH_Drawing_Font** object.  |
10748| skewX           | Skew of the X axis relative to the Y axis. |
10749
10750
10751### OH_Drawing_FontSetTypeface()
10752
10753```
10754void OH_Drawing_FontSetTypeface (OH_Drawing_Font* , OH_Drawing_Typeface*  )
10755```
10756
10757**Description**
10758
10759Sets a typeface for a font.
10760
10761Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
10762
10763If **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
10764
10765**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10766
10767**Since**: 11
10768
10769**Parameters**
10770
10771| Name                | Description                                                  |
10772| ------------------- | ------------------------------------------------------------ |
10773| OH_Drawing_Font     | Pointer to an **OH_Drawing_Font** object.                    |
10774| OH_Drawing_Typeface | Pointer to an **OH_Drawing_Typeface** object. If NULL is passed in, the default **OH_Drawing_Typeface** object is used. |
10775
10776
10777### OH_Drawing_FontStyleSetCount()
10778
10779```
10780int OH_Drawing_FontStyleSetCount (OH_Drawing_FontStyleSet* )
10781```
10782
10783**Description**
10784
10785Obtains the number of fonts in the font style set.
10786
10787**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10788
10789**Since**: 12
10790
10791**Parameters**
10792
10793| Name                    | Description                                                  |
10794| ----------------------- | ------------------------------------------------------------ |
10795| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. |
10796
10797**Returns**
10798
10799Returns the number of fonts.
10800
10801
10802### OH_Drawing_FontStyleSetCreateTypeface()
10803
10804```
10805OH_Drawing_Typeface* OH_Drawing_FontStyleSetCreateTypeface (OH_Drawing_FontStyleSet* , int index )
10806```
10807
10808**Description**
10809
10810Creates a typeface for the specified index.
10811
10812**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10813
10814**Since**: 12
10815
10816**Parameters**
10817
10818| Name                    | Description                                                  |
10819| ----------------------- | ------------------------------------------------------------ |
10820| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. |
10821| index                   | Index of the typeface.                                       |
10822
10823**Returns**
10824
10825Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created if the operation is successful; returns a null pointer otherwise.
10826
10827
10828### OH_Drawing_FontStyleSetFreeStyleName()
10829
10830```
10831void OH_Drawing_FontStyleSetFreeStyleName (char** styleName)
10832```
10833
10834**Description**
10835
10836Reclaims the memory occupied by a font style.
10837
10838**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10839
10840**Since**: 12
10841
10842**Parameters**
10843
10844| Name      | Description                                                  |
10845| --------- | ------------------------------------------------------------ |
10846| styleName | Double pointer to the string that specifies the font style name. |
10847
10848
10849### OH_Drawing_FontStyleSetGetStyle()
10850
10851```
10852OH_Drawing_FontStyleStruct OH_Drawing_FontStyleSetGetStyle (OH_Drawing_FontStyleSet* , int32_t index, char** styleName )
10853```
10854
10855**Description**
10856
10857Obtains the font style.
10858
10859**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10860
10861**Since**: 12
10862
10863**Parameters**
10864
10865| Name                    | Description                                                  |
10866| ----------------------- | ------------------------------------------------------------ |
10867| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. |
10868| index                   | Index of the font style.                                     |
10869| styleName               | Double pointer to the string that specifies the font style name. |
10870
10871**Returns**
10872
10873Returns the font style.
10874
10875
10876### OH_Drawing_FontStyleSetMatchStyle()
10877
10878```
10879OH_Drawing_Typeface* OH_Drawing_FontStyleSetMatchStyle (OH_Drawing_FontStyleSet* , OH_Drawing_FontStyleStruct fontStyleStruct )
10880```
10881
10882**Description**
10883
10884Obtains the typeface closest to the font style.
10885
10886**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10887
10888**Since**: 12
10889
10890**Parameters**
10891
10892| Name                    | Description                                                  |
10893| ----------------------- | ------------------------------------------------------------ |
10894| OH_Drawing_FontStyleSet | Pointer to an [OH_Drawing_FontStyleSet](#oh_drawing_fontstyleset) object. |
10895| fontStyleStruct         | Font style, including the font weight, width, and slant.     |
10896
10897**Returns**
10898
10899Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object obtained.
10900
10901
10902### OH_Drawing_GetAffinityFromPositionAndAffinity()
10903
10904```
10905int OH_Drawing_GetAffinityFromPositionAndAffinity (OH_Drawing_PositionAndAffinity* )
10906```
10907
10908**Description**
10909
10910Obtains the affinity attribute of an **OH_Drawing_PositionAndAffinity** object. The affinity determines whether the font is close to the front text or rear text.
10911
10912**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10913
10914**Since**: 11
10915
10916**Parameters**
10917
10918| Name                           | Description                                                  |
10919| ------------------------------ | ------------------------------------------------------------ |
10920| OH_Drawing_PositionAndAffinity | Pointer to an **OH_Drawing_PositionAndAffinity** object, which is obtained by calling [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) or [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster). |
10921
10922**Returns**
10923
10924Returns the affinity attribute.
10925
10926
10927### OH_Drawing_GetBottomFromTextBox()
10928
10929```
10930float OH_Drawing_GetBottomFromTextBox (OH_Drawing_TextBox* , int  )
10931```
10932
10933**Description**
10934
10935Obtains the bottom position of a text box.
10936
10937**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10938
10939**Since**: 11
10940
10941**Parameters**
10942
10943| Name               | Description                                                  |
10944| ------------------ | ------------------------------------------------------------ |
10945| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
10946| int                | Index of the text box.                                       |
10947
10948**Returns**
10949
10950Returns the bottom position.
10951
10952
10953### OH_Drawing_GetEndFromRange()
10954
10955```
10956size_t OH_Drawing_GetEndFromRange (OH_Drawing_Range* )
10957```
10958
10959**Description**
10960
10961Obtains the end position of an **OH_Drawing_Range** object.
10962
10963**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10964
10965**Since**: 11
10966
10967**Parameters**
10968
10969| Name             | Description                                                  |
10970| ---------------- | ------------------------------------------------------------ |
10971| OH_Drawing_Range | Pointer to an **OH_Drawing_Range** object, which is obtained by calling [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary). |
10972
10973**Returns**
10974
10975Returns the end position.
10976
10977
10978### OH_Drawing_GetLeftFromTextBox()
10979
10980```
10981float OH_Drawing_GetLeftFromTextBox (OH_Drawing_TextBox* , int  )
10982```
10983
10984**Description**
10985
10986Obtains the left position of a text box.
10987
10988**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
10989
10990**Since**: 11
10991
10992**Parameters**
10993
10994| Name               | Description                                                  |
10995| ------------------ | ------------------------------------------------------------ |
10996| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
10997| int                | Index of the text box.                                       |
10998
10999**Returns**
11000
11001Returns the left position.
11002
11003
11004### OH_Drawing_GetPositionFromPositionAndAffinity()
11005
11006```
11007size_t OH_Drawing_GetPositionFromPositionAndAffinity (OH_Drawing_PositionAndAffinity* )
11008```
11009
11010**Description**
11011
11012Obtains the position attribute of an **OH_Drawing_PositionAndAffinity** object.
11013
11014**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11015
11016**Since**: 11
11017
11018**Parameters**
11019
11020| Name                           | Description                                                  |
11021| ------------------------------ | ------------------------------------------------------------ |
11022| OH_Drawing_PositionAndAffinity | Pointer to an **OH_Drawing_PositionAndAffinity** object, which is obtained by calling [OH_Drawing_TypographyGetGlyphPositionAtCoordinate](#oh_drawing_typographygetglyphpositionatcoordinate) or [OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster](#oh_drawing_typographygetglyphpositionatcoordinatewithcluster). |
11023
11024**Returns**
11025
11026Returns the position attribute.
11027
11028
11029### OH_Drawing_GetRightFromTextBox()
11030
11031```
11032float OH_Drawing_GetRightFromTextBox (OH_Drawing_TextBox* , int  )
11033```
11034
11035**Description**
11036
11037Obtains the right position of a text box.
11038
11039**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11040
11041**Since**: 11
11042
11043**Parameters**
11044
11045| Name               | Description                                                  |
11046| ------------------ | ------------------------------------------------------------ |
11047| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
11048| int                | Index of the text box.                                       |
11049
11050**Returns**
11051
11052Returns the right position.
11053
11054
11055### OH_Drawing_GetSizeOfTextBox()
11056
11057```
11058size_t OH_Drawing_GetSizeOfTextBox (OH_Drawing_TextBox* )
11059```
11060
11061**Description**
11062
11063Obtains the number of text boxes.
11064
11065**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11066
11067**Since**: 11
11068
11069**Parameters**
11070
11071| Name               | Description                                                  |
11072| ------------------ | ------------------------------------------------------------ |
11073| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
11074
11075**Returns**
11076
11077Returns the number of text boxes.
11078
11079
11080### OH_Drawing_GetStartFromRange()
11081
11082```
11083size_t OH_Drawing_GetStartFromRange (OH_Drawing_Range* )
11084```
11085
11086**Description**
11087
11088Obtains the start position of an **OH_Drawing_Range** object.
11089
11090**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11091
11092**Since**: 11
11093
11094**Parameters**
11095
11096| Name             | Description                                                  |
11097| ---------------- | ------------------------------------------------------------ |
11098| OH_Drawing_Range | Pointer to an **OH_Drawing_Range** object, which is obtained by calling [OH_Drawing_TypographyGetWordBoundary](#oh_drawing_typographygetwordboundary). |
11099
11100**Returns**
11101
11102Returns the start position.
11103
11104
11105### OH_Drawing_GetSystemFontConfigInfo()
11106
11107```
11108OH_Drawing_FontConfigInfo* OH_Drawing_GetSystemFontConfigInfo (OH_Drawing_FontConfigInfoErrorCode* )
11109```
11110
11111**Description**
11112
11113Obtains the system font configuration.
11114
11115**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11116
11117**Since**: 12
11118
11119**Parameters**
11120
11121| Name                              | Description                                                  |
11122| --------------------------------- | ------------------------------------------------------------ |
11123| OH_Drawing_FontConfigJsonInfoCode | Pointer to the error code. For details about the available options, see [OH_Drawing_FontConfigInfoErrorCode](#oh_drawing_fontconfiginfoerrorcode). |
11124
11125**Returns**
11126
11127Returns the pointer to the system font configuration. When it is no longer required, call [OH_Drawing_DestroySystemFontConfigInfo](#oh_drawing_destroysystemfontconfiginfo) to release the pointer to the object.
11128
11129
11130### OH_Drawing_GetTextDirectionFromTextBox()
11131
11132```
11133int OH_Drawing_GetTextDirectionFromTextBox (OH_Drawing_TextBox* , int  )
11134```
11135
11136**Description**
11137
11138Obtains the text direction of a text box.
11139
11140**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11141
11142**Since**: 11
11143
11144**Parameters**
11145
11146| Name               | Description                                                  |
11147| ------------------ | ------------------------------------------------------------ |
11148| OH_Drawing_TextBox | Pointer to an [OH_Drawing_TextBox](#oh_drawing_textbox) object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
11149| int                | Index of the text box.                                       |
11150
11151**Returns**
11152
11153Returns the text direction.
11154
11155
11156### OH_Drawing_GetTopFromTextBox()
11157
11158```
11159float OH_Drawing_GetTopFromTextBox (OH_Drawing_TextBox* , int  )
11160```
11161
11162**Description**
11163
11164Obtains the top position of a text box.
11165
11166**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11167
11168**Since**: 11
11169
11170**Parameters**
11171
11172| Name               | Description                                                  |
11173| ------------------ | ------------------------------------------------------------ |
11174| OH_Drawing_TextBox | Pointer to an **OH_Drawing_TextBox** object, which is obtained by calling [OH_Drawing_TypographyGetRectsForRange](#oh_drawing_typographygetrectsforrange) or [OH_Drawing_TypographyGetRectsForPlaceholders](#oh_drawing_typographygetrectsforplaceholders). |
11175| int                | Index of the text box.                                       |
11176
11177**Returns**
11178
11179Returns the top position.
11180
11181
11182### OH_Drawing_GpuContextCreateFromGL()
11183
11184```
11185OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL (OH_Drawing_GpuContextOptions )
11186```
11187
11188**Description**
11189
11190Creates an **OH_Drawing_GpuContext** object that uses OpenGL as the backend interface.
11191
11192**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11193
11194**Since**: 12
11195
11196**Parameters**
11197
11198| Name                         | Description                                                  |
11199| ---------------------------- | ------------------------------------------------------------ |
11200| OH_Drawing_GpuContextOptions | GPU context option, which is an [OH_Drawing_GpuContextOptions](_o_h___drawing___gpu_context_options.md) object. |
11201
11202**Returns**
11203
11204Returns the pointer to the [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object created.
11205
11206
11207### OH_Drawing_GpuContextDestroy()
11208
11209```
11210void OH_Drawing_GpuContextDestroy (OH_Drawing_GpuContext* )
11211```
11212
11213**Description**
11214
11215Destroys an **OH_Drawing_GpuContext** object and reclaims the memory occupied by the object.
11216
11217**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11218
11219**Since**: 12
11220
11221**Parameters**
11222
11223| Name                  | Description                                                  |
11224| --------------------- | ------------------------------------------------------------ |
11225| OH_Drawing_GpuContext | Pointer to an [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object. |
11226
11227
11228### OH_Drawing_ImageBuildFromBitmap()
11229
11230```
11231bool OH_Drawing_ImageBuildFromBitmap (OH_Drawing_Image* , OH_Drawing_Bitmap*  )
11232```
11233
11234**Description**
11235
11236Builds an image from a bitmap by sharing or copying bitmap pixels. If the bitmap is marked as immutable, the pixel memory is shared, not copied.
11237
11238Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11239
11240If either **OH_Drawing_Image** or **OH_Drawing_Bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11241
11242**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11243
11244**Since**: 12
11245
11246**Parameters**
11247
11248| Name              | Description                                                  |
11249| ----------------- | ------------------------------------------------------------ |
11250| OH_Drawing_Image  | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.  |
11251| OH_Drawing_Bitmap | Pointer to an [OH_Drawing_Bitmap](#oh_drawing_bitmap) object. |
11252
11253**Returns**
11254
11255Returns **true** if the image is built; returns **false** otherwise.
11256
11257
11258### OH_Drawing_ImageCreate()
11259
11260```
11261OH_Drawing_Image* OH_Drawing_ImageCreate (void )
11262```
11263
11264**Description**
11265
11266Creates an **OH_Drawing_Image** object that describes an array of two-dimensional pixels to draw.
11267
11268**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11269
11270**Since**: 12
11271
11272**Returns**
11273
11274Returns the pointer to the [OH_Drawing_Image](#oh_drawing_image) object created.
11275
11276
11277### OH_Drawing_ImageDestroy()
11278
11279```
11280void OH_Drawing_ImageDestroy (OH_Drawing_Image* )
11281```
11282
11283**Description**
11284
11285Destroys an **OH_Drawing_Image** object and reclaims the memory occupied by the object.
11286
11287**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11288
11289**Since**: 12
11290
11291**Parameters**
11292
11293| Name             | Description                                                 |
11294| ---------------- | ----------------------------------------------------------- |
11295| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. |
11296
11297
11298### OH_Drawing_ImageGetHeight()
11299
11300```
11301int32_t OH_Drawing_ImageGetHeight (OH_Drawing_Image* )
11302```
11303
11304**Description**
11305
11306Obtains the image height, that is, the number of pixel lines.
11307
11308Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11309
11310If **OH_Drawing_Image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11311
11312**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11313
11314**Since**: 12
11315
11316**Parameters**
11317
11318| Name             | Description                                                 |
11319| ---------------- | ----------------------------------------------------------- |
11320| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. |
11321
11322**Returns**
11323
11324Returns the height.
11325
11326
11327### OH_Drawing_ImageGetImageInfo()
11328
11329```
11330void OH_Drawing_ImageGetImageInfo (OH_Drawing_Image* , OH_Drawing_Image_Info*  )
11331```
11332
11333**Description**
11334
11335Obtains the image information. After this function is called, the passed-in image information object is filled.
11336
11337Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11338
11339If either **OH_Drawing_Image** or **OH_Drawing_Image_Info** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11340
11341**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11342
11343**Since**: 12
11344
11345**Parameters**
11346
11347| Name                  | Description                                                  |
11348| --------------------- | ------------------------------------------------------------ |
11349| OH_Drawing_Image      | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.  |
11350| OH_Drawing_Image_Info | Pointer to an [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object, which is created by calling [OH_Drawing_Image_Info](_o_h___drawing___image___info.md). |
11351
11352
11353### OH_Drawing_ImageGetWidth()
11354
11355```
11356int32_t OH_Drawing_ImageGetWidth (OH_Drawing_Image* )
11357```
11358
11359**Description**
11360
11361Obtains the image width, that is, the number of pixels in each line.
11362
11363Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11364
11365If **OH_Drawing_Image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11366
11367**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11368
11369**Since**: 12
11370
11371**Parameters**
11372
11373| Name             | Description                                                 |
11374| ---------------- | ----------------------------------------------------------- |
11375| OH_Drawing_Image | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object. |
11376
11377**Returns**
11378
11379Returns the width.
11380
11381
11382### OH_Drawing_LineMetricsGetSize()
11383
11384```
11385size_t OH_Drawing_LineMetricsGetSize (OH_Drawing_LineMetrics* )
11386```
11387
11388**Description**
11389
11390Obtains the number of lines.
11391
11392**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11393
11394**Since**: 12
11395
11396**Parameters**
11397
11398| Name                                                       | Description                                                  |
11399| ---------------------------------------------------------- | ------------------------------------------------------------ |
11400| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). |
11401
11402**Returns**
11403
11404Returns the number of lines.
11405
11406
11407### OH_Drawing_MaskFilterCreateBlur()
11408
11409```
11410OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateBlur (OH_Drawing_BlurType blurType, float sigma, bool respectCTM )
11411```
11412
11413**Description**
11414
11415Creates an **OH_Drawing_MaskFilter** object with a blur type.
11416
11417**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11418
11419**Since**: 11
11420
11421**Parameters**
11422
11423| Name       | Description                                                  |
11424| ---------- | ------------------------------------------------------------ |
11425| blurType   | Blur type.                                                   |
11426| sigma      | Standard deviation of the Gaussian blur to apply. The value must be greater than 0. |
11427| respectCTM | Whether the blur's sigma is modified by the CTM. The default value is **true**. |
11428
11429**Returns**
11430
11431Returns the pointer to the **OH_Drawing_MaskFilter** object created.
11432
11433
11434### OH_Drawing_MaskFilterDestroy()
11435
11436```
11437void OH_Drawing_MaskFilterDestroy (OH_Drawing_MaskFilter* )
11438```
11439
11440**Description**
11441
11442Destroys an **OH_Drawing_MaskFilter** object and reclaims the memory occupied by the object.
11443
11444**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11445
11446**Since**: 11
11447
11448**Parameters**
11449
11450| Name                  | Description                                     |
11451| --------------------- | ----------------------------------------------- |
11452| OH_Drawing_MaskFilter | Pointer to an **OH_Drawing_MaskFilter** object. |
11453
11454
11455### OH_Drawing_MatrixConcat()
11456
11457```
11458void OH_Drawing_MatrixConcat (OH_Drawing_Matrix* total, const OH_Drawing_Matrix* a, const OH_Drawing_Matrix* b )
11459```
11460
11461**Description**
11462
11463Multiplies two matrices to produce a new matrix.
11464
11465Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11466
11467If any of **total**, **a**, and **b** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11468
11469**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11470
11471**Since**: 12
11472
11473**Parameters**
11474
11475| Name  | Description                                                  |
11476| ----- | ------------------------------------------------------------ |
11477| total | Pointer to the new matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11478| a     | Pointer to the first matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11479| b     | Pointer to the second matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11480
11481
11482### OH_Drawing_MatrixCreate()
11483
11484```
11485OH_Drawing_Matrix* OH_Drawing_MatrixCreate (void )
11486```
11487
11488**Description**
11489
11490Creates an **OH_Drawing_Matrix** object.
11491
11492**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11493
11494**Since**: 11
11495
11496**Returns**
11497
11498Returns the pointer to the **OH_Drawing_Matrix** object created.
11499
11500
11501### OH_Drawing_MatrixCreateRotation()
11502
11503```
11504OH_Drawing_Matrix* OH_Drawing_MatrixCreateRotation (float deg, float x, float y )
11505```
11506
11507**Description**
11508
11509Creates an **OH_Drawing_Matrix** with the rotation attribute. The matrix is obtained by rotating an identity matrix by a given degree around the rotation point (x, y).
11510
11511**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11512
11513**Since**: 12
11514
11515**Parameters**
11516
11517| Name | Description                                                  |
11518| ---- | ------------------------------------------------------------ |
11519| deg  | Angle to rotate, in degrees. A positive number indicates a clockwise rotation, and a negative number indicates a counterclockwise rotation. |
11520| x    | Coordinate point on the X axis.                              |
11521| y    | Coordinate point on the Y axis.                              |
11522
11523**Returns**
11524
11525Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created.
11526
11527
11528### OH_Drawing_MatrixCreateScale()
11529
11530```
11531OH_Drawing_Matrix* OH_Drawing_MatrixCreateScale (float sx, float sy, float px, float py )
11532```
11533
11534**Description**
11535
11536Creates an **OH_Drawing_Matrix** with the scale attribute. The matrix is obtained by scaling an identity matrix with the factor (sx, sy) at the rotation point (px, py).
11537
11538**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11539
11540**Since**: 12
11541
11542**Parameters**
11543
11544| Name | Description                                                  |
11545| ---- | ------------------------------------------------------------ |
11546| sx   | Scale coefficient along the X axis. If a negative number is passed in, the matrix is mirrored around y = px before being scaled. The value is a floating point number. |
11547| sy   | Scale coefficient along the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before being scaled. The value is a floating point number. |
11548| px   | Coordinate point on the X axis.                              |
11549| py   | Coordinate point on the Y axis.                              |
11550
11551**Returns**
11552
11553Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created.
11554
11555
11556### OH_Drawing_MatrixCreateTranslation()
11557
11558```
11559OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation (float dx, float dy )
11560```
11561
11562**Description**
11563
11564Creates an **OH_Drawing_Matrix** with the translation attribute. The matrix is obtained by translating the identity matrix by the distance (dx, dy).
11565
11566**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11567
11568**Since**: 12
11569
11570**Parameters**
11571
11572| Name | Description                                                  |
11573| ---- | ------------------------------------------------------------ |
11574| dx   | Distance to translate on the X axis. A positive number indicates a translation towards the positive direction of the X axis, and a negative number indicates a translation towards the negative direction of the X axis. The value is a floating point number. |
11575| dy   | Distance to translate on the Y axis. A positive number indicates a translation towards the positive direction of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis. The value is a floating point number. |
11576
11577**Returns**
11578
11579Returns the pointer to the [OH_Drawing_Matrix](#oh_drawing_matrix) object created.
11580
11581
11582### OH_Drawing_MatrixDestroy()
11583
11584```
11585void OH_Drawing_MatrixDestroy (OH_Drawing_Matrix* )
11586```
11587
11588**Description**
11589
11590Destroys an **OH_Drawing_Matrix** object and reclaims the memory occupied by the object.
11591
11592**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11593
11594**Since**: 11
11595
11596**Parameters**
11597
11598| Name              | Description                               |
11599| ----------------- | ----------------------------------------- |
11600| OH_Drawing_Matrix | Pointer to an **OH_Drawing_Font** object. |
11601
11602
11603### OH_Drawing_MatrixGetValue()
11604
11605```
11606float OH_Drawing_MatrixGetValue (OH_Drawing_Matrix* , int index )
11607```
11608
11609**Description**
11610
11611Obtains a matrix value of a given index, which ranges from 0 to 8.
11612
11613Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11614
11615If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11616
11617If **index** is less than 0 or greater than 8, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
11618
11619**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11620
11621**Since**: 12
11622
11623**Parameters**
11624
11625| Name              | Description                                                  |
11626| ----------------- | ------------------------------------------------------------ |
11627| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11628| index             | Index, which ranges from 0 to 8.                             |
11629
11630**Returns**
11631
11632Returns the matrix value.
11633
11634
11635### OH_Drawing_MatrixInvert()
11636
11637```
11638bool OH_Drawing_MatrixInvert (OH_Drawing_Matrix* , OH_Drawing_Matrix* inverse )
11639```
11640
11641**Description**
11642
11643Inverts a matrix and returns the result.
11644
11645Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11646
11647If either **OH_Drawing_Matrix** or **inverse** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11648
11649**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11650
11651**Since**: 12
11652
11653**Parameters**
11654
11655| Name              | Description                                                  |
11656| ----------------- | ------------------------------------------------------------ |
11657| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11658| inverse           | Pointer to the matrix to invert, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. The object can be created by calling [OH_Drawing_MatrixCreate](#oh_drawing_matrixcreate). |
11659
11660**Returns**
11661
11662Returns **true** if the matrix is reversible and the passed-in **inverse** is inverted; returns **false** otherwise.
11663
11664
11665### OH_Drawing_MatrixIsEqual()
11666
11667```
11668bool OH_Drawing_MatrixIsEqual (OH_Drawing_Matrix* , OH_Drawing_Matrix* other )
11669```
11670
11671**Description**
11672
11673Checks whether two **OH_Drawing_Matrix** objects are equal.
11674
11675Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11676
11677If either **OH_Drawing_Matrix** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11678
11679**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11680
11681**Since**: 12
11682
11683**Parameters**
11684
11685| Name              | Description                                                  |
11686| ----------------- | ------------------------------------------------------------ |
11687| OH_Drawing_Matrix | Pointer to a matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11688| other             | Pointer to the other matrix, which is an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11689
11690**Returns**
11691
11692Returns **true** if the two matrices are equal; returns **false** otherwise.
11693
11694
11695### OH_Drawing_MatrixIsIdentity()
11696
11697```
11698bool OH_Drawing_MatrixIsIdentity (OH_Drawing_Matrix* )
11699```
11700
11701**Description**
11702
11703Checks whether an **OH_Drawing_Matrix** object is an identity matrix.
11704
11705Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11706
11707If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11708
11709**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11710
11711**Since**: 12
11712
11713**Parameters**
11714
11715| Name              | Description                                                  |
11716| ----------------- | ------------------------------------------------------------ |
11717| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11718
11719**Returns**
11720
11721Returns **true** if the matrix is an identity matrix; returns **false** otherwise.
11722
11723
11724### OH_Drawing_MatrixPostRotate()
11725
11726```
11727void OH_Drawing_MatrixPostRotate (OH_Drawing_Matrix* , float degree, float px, float py )
11728```
11729
11730**Description**
11731
11732Post multiplies a matrix by an identity matrix that rotates a given degree around the rotation point (px, py).
11733
11734Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11735
11736If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11737
11738**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11739
11740**Since**: 12
11741
11742**Parameters**
11743
11744| Name              | Description                                                  |
11745| ----------------- | ------------------------------------------------------------ |
11746| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11747| degree            | Angle to rotate, in degrees. A positive number indicates a clockwise rotation, and a negative number indicates a counterclockwise rotation. |
11748| px                | X coordinate of the rotation point.                          |
11749| py                | Y coordinate of the rotation point.                          |
11750
11751
11752### OH_Drawing_MatrixPostScale()
11753
11754```
11755void OH_Drawing_MatrixPostScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py )
11756```
11757
11758**Description**
11759
11760Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py).
11761
11762Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11763
11764If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11765
11766
11767**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11768
11769**Since**: 12
11770
11771**Parameters**
11772
11773| Name              | Description                                                  |
11774| ----------------- | ------------------------------------------------------------ |
11775| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11776| sx                | Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before being scaled. The value is a floating point number. |
11777| sy                | Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before being scaled. The value is a floating point number. |
11778| px                | X coordinate of the scale point.                             |
11779| py                | Y coordinate of the scale point.                             |
11780
11781
11782### OH_Drawing_MatrixPostTranslate()
11783
11784```
11785void OH_Drawing_MatrixPostTranslate (OH_Drawing_Matrix* , float dx, float dy )
11786```
11787
11788**Description**
11789
11790Post multiplies a matrix by an identity matrix that translates by a given distance (dx, dy).
11791
11792Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11793
11794If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11795
11796
11797**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11798
11799**Since**: 12
11800
11801**Parameters**
11802
11803| Name              | Description                                                  |
11804| ----------------- | ------------------------------------------------------------ |
11805| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11806| dx                | Distance to translate on the X axis.                         |
11807| dy                | Distance to translate on the Y axis.                         |
11808
11809
11810### OH_Drawing_MatrixPreRotate()
11811
11812```
11813void OH_Drawing_MatrixPreRotate (OH_Drawing_Matrix* , float degree, float px, float py )
11814```
11815
11816**Description**
11817
11818Premultiplies a matrix by an identity matrix that rotates by a given degree around the rotation point (px, py).
11819
11820Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11821
11822If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11823
11824
11825**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11826
11827**Since**: 12
11828
11829**Parameters**
11830
11831| Name              | Description                                                  |
11832| ----------------- | ------------------------------------------------------------ |
11833| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11834| degree            | Angle to rotate, in degrees. A positive number indicates a clockwise rotation, and a negative number indicates a counterclockwise rotation. |
11835| px                | X coordinate of the rotation point.                          |
11836| py                | Y coordinate of the rotation point.                          |
11837
11838
11839### OH_Drawing_MatrixPreScale()
11840
11841```
11842void OH_Drawing_MatrixPreScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py )
11843```
11844
11845**Description**
11846
11847Premultiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py).
11848
11849Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11850
11851If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11852
11853
11854**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11855
11856**Since**: 12
11857
11858**Parameters**
11859
11860| Name              | Description                                                  |
11861| ----------------- | ------------------------------------------------------------ |
11862| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11863| sx                | Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before being scaled. The value is a floating point number. |
11864| sy                | Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before being scaled. The value is a floating point number. |
11865| px                | X coordinate of the scale point.                             |
11866| py                | Y coordinate of the scale point.                             |
11867
11868
11869### OH_Drawing_MatrixPreTranslate()
11870
11871```
11872void OH_Drawing_MatrixPreTranslate (OH_Drawing_Matrix* , float dx, float dy )
11873```
11874
11875**Description**
11876
11877Premultiplies a matrix by an identity matrix that translates by a given distance (dx, dy).
11878
11879Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11880
11881If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11882
11883**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11884
11885**Since**: 12
11886
11887**Parameters**
11888
11889| Name              | Description                                                  |
11890| ----------------- | ------------------------------------------------------------ |
11891| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11892| dx                | Distance to translate on the X axis.                         |
11893| dy                | Distance to translate on the Y axis.                         |
11894
11895
11896### OH_Drawing_MatrixReset()
11897
11898```
11899void OH_Drawing_MatrixReset (OH_Drawing_Matrix* )
11900```
11901
11902**Description**
11903
11904Resets a matrix to an identity matrix: | 1 0 0 | | 0 1 0 | | 0 0 0 1 |.
11905
11906Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11907
11908If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11909
11910**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11911
11912**Since**: 12
11913
11914**Parameters**
11915
11916| Name              | Description                                                  |
11917| ----------------- | ------------------------------------------------------------ |
11918| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11919
11920
11921### OH_Drawing_MatrixRotate()
11922
11923```
11924void OH_Drawing_MatrixRotate (OH_Drawing_Matrix* , float degree, float px, float py )
11925```
11926
11927**Description**
11928
11929Sets a matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py).
11930
11931Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11932
11933If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11934
11935**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11936
11937**Since**: 12
11938
11939**Parameters**
11940
11941| Name              | Description                                                  |
11942| ----------------- | ------------------------------------------------------------ |
11943| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11944| degree            | Angle to rotate, in degrees. A positive number indicates a clockwise rotation, and a negative number indicates a counterclockwise rotation. |
11945| px                | Coordinate point on the X axis.                              |
11946| py                | Coordinate point on the Y axis.                              |
11947
11948
11949### OH_Drawing_MatrixScale()
11950
11951```
11952void OH_Drawing_MatrixScale (OH_Drawing_Matrix* , float sx, float sy, float px, float py )
11953```
11954
11955**Description**
11956
11957Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py).
11958
11959Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11960
11961If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11962
11963**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11964
11965**Since**: 12
11966
11967**Parameters**
11968
11969| Name              | Description                                                  |
11970| ----------------- | ------------------------------------------------------------ |
11971| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
11972| sx                | Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before being scaled. The value is a floating point number. |
11973| sy                | Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before being scaled. The value is a floating point number. |
11974| px                | Coordinate point on the X axis.                              |
11975| py                | Coordinate point on the Y axis.                              |
11976
11977
11978### OH_Drawing_MatrixSetMatrix()
11979
11980```
11981void OH_Drawing_MatrixSetMatrix (OH_Drawing_Matrix* , float scaleX, float skewX, float transX, float skewY, float scaleY, float transY, float persp0, float persp1, float persp2 )
11982```
11983
11984**Description**
11985
11986Sets matrix parameters for an **OH_Drawing_Matrix** object.
11987
11988Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
11989
11990If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
11991
11992**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
11993
11994**Since**: 11
11995
11996**Parameters**
11997
11998| Name              | Description                                 |
11999| ----------------- | ------------------------------------------- |
12000| OH_Drawing_Matrix | Pointer to an **OH_Drawing_Matrix** object. |
12001| scaleX            | Scale factor on the X axis.                 |
12002| skewX             | Skew factor on the X axis.                  |
12003| transX            | Translation coefficient on the X axis.      |
12004| skewY             | Skew factor on the Y axis.                  |
12005| scaleY            | Scale factor on the Y axis.                 |
12006| transY            | Translation coefficient on the Y axis.      |
12007| persp0            | Perspective coefficient of the X axis.      |
12008| persp1            | Perspective coefficient of the Y axis.      |
12009| persp2            | Perspective scale coefficient.              |
12010
12011
12012### OH_Drawing_MatrixSetPolyToPoly()
12013
12014```
12015bool OH_Drawing_MatrixSetPolyToPoly (OH_Drawing_Matrix* , const OH_Drawing_Point2D* src, const OH_Drawing_Point2D* dst, uint32_t count )
12016```
12017
12018**Description**
12019
12020Generates a transformation matrix by setting source points and destination points. Both the number of source points and that of destination points must be in the range [0, 4].
12021
12022Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12023
12024If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12025
12026If **count** is less than 0 or greater than 4, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12027
12028**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12029
12030**Since**: 12
12031
12032**Parameters**
12033
12034| Name              | Description                                                  |
12035| ----------------- | ------------------------------------------------------------ |
12036| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
12037| src               | Array of source points. If NULL is passed in, **count** must be 0. |
12038| dst               | Array of destination points. The number of destination points must be the same as that of source points. If NULL is passed in, **count** must be 0. |
12039| count             | Number of source points or destination points. If 0 is passed in, the matrix is set to an identity matrix. |
12040
12041**Returns**
12042
12043Returns **true** if the matrix is generated; returns **false** otherwise.
12044
12045
12046### OH_Drawing_MatrixSetRectToRect()
12047
12048```
12049bool OH_Drawing_MatrixSetRectToRect (OH_Drawing_Matrix* , const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, OH_Drawing_ScaleToFit stf )
12050```
12051
12052**Description**
12053
12054Scales a matrix to map a source rectangle to a destination rectangle.
12055
12056Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12057
12058If any of **OH_Drawing_Matrix**, **src**, and **dst** is NULL, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.
12059
12060**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12061
12062**Since**: 12
12063
12064**Parameters**
12065
12066| Name              | Description                                                  |
12067| ----------------- | ------------------------------------------------------------ |
12068| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
12069| src               | Pointer to a source rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. |
12070| dst               | Pointer to a destination rectangle, which is an [OH_Drawing_Rect](#oh_drawing_rect) object. |
12071| stf               | Scaling mode. For details about the available options, see [OH_Drawing_ScaleToFit](#oh_drawing_scaletofit). |
12072
12073**Returns**
12074
12075Returns **true** if the operation is successful; returns **false** if the operation fails. In particular, if either the width or the height of the source rectangle is less than or equal to 0, the function returns **false** and sets the matrix to an identity matrix. If either the width or height of the destination rectangle is less than or equal to 0, the function returns **true** and sets the matrix to a matrix with all values 0, except for a perspective scaling coefficient of 1.
12076
12077### OH_Drawing_MatrixTranslate()
12078
12079```
12080void OH_Drawing_MatrixTranslate (OH_Drawing_Matrix* , float dx, float dy )
12081```
12082
12083**Description**
12084
12085Sets a matrix as an identity matrix and translates it by a given distance (dx, dy).
12086
12087Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12088
12089If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12090
12091**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12092
12093**Since**: 12
12094
12095**Parameters**
12096
12097| Name              | Description                                                  |
12098| ----------------- | ------------------------------------------------------------ |
12099| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
12100| dx                | Distance to translate on the X axis. A positive number indicates a translation towards the positive direction of the X axis, and a negative number indicates a translation towards the negative direction of the X axis. The value is a floating point number. |
12101| dy                | Distance to translate on the Y axis. A positive number indicates a translation towards the positive direction of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis. The value is a floating point number. |
12102
12103
12104### OH_Drawing_MemoryStreamCreate()
12105
12106```
12107OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate (const void* data, size_t length, bool copyData )
12108```
12109
12110**Description**
12111
12112Creates an **OH_Drawing_MemoryStream** object.
12113
12114Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12115
12116If **data** is NULL or **length** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12117
12118**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12119
12120**Since**: 12
12121
12122**Parameters**
12123
12124| Name     | Description                                                  |
12125| -------- | ------------------------------------------------------------ |
12126| data     | Pointer to the data.                                         |
12127| length   | Length of the data.                                          |
12128| copyData | Whether to copy data. The value **true** means that the **OH_Drawing_MemoryStream** object copies the data, and **false** means that the **OH_Drawing_MemoryStream** object directly uses the data without copying. |
12129
12130**Returns**
12131
12132Returns the pointer to the [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object created.
12133
12134
12135### OH_Drawing_MemoryStreamDestroy()
12136
12137```
12138void OH_Drawing_MemoryStreamDestroy (OH_Drawing_MemoryStream* )
12139```
12140
12141**Description**
12142
12143Destroys an **OH_Drawing_MemoryStream** object and reclaims the memory occupied by the object.
12144
12145**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12146
12147**Since**: 12
12148
12149**Parameters**
12150
12151| Name                    | Description                                                  |
12152| ----------------------- | ------------------------------------------------------------ |
12153| OH_Drawing_MemoryStream | Pointer to an [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object. |
12154
12155
12156### OH_Drawing_PathAddArc()
12157
12158```
12159void OH_Drawing_PathAddArc (OH_Drawing_Path* , const OH_Drawing_Rect* , float startAngle, float sweepAngle )
12160```
12161
12162**Description**
12163
12164Adds an arc to a path as the start of a new contour. The arc added is part of the ellipse bounded by oval, from the start angle through the sweep angle, measured in degrees. A positive angle indicates a clockwise sweep, and a negative angle indicates a counterclockwise sweep. If the sweep angle is less than or equal to -360°, or if the sweep angle is greater than or equal to 360° and start angle modulo 90 is nearly zero, an oval instead of an ellipse is added.
12165
12166Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12167
12168If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12169
12170**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12171
12172**Since**: 12
12173
12174**Parameters**
12175
12176| Name            | Description                                                  |
12177| --------------- | ------------------------------------------------------------ |
12178| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12179| OH_Drawing_Rect | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.    |
12180| startAngle      | Start angle of the arc, in degrees.                          |
12181| sweepAngle      | Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by 360. |
12182
12183### OH_Drawing_PathAddOval()
12184
12185```
12186void OH_Drawing_PathAddOval (OH_Drawing_Path* , const OH_Drawing_Rect* , OH_Drawing_PathDirection  )
12187```
12188
12189**Description**
12190
12191Adds an oval to a path in the specified direction.
12192
12193Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12194
12195If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12196
12197If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12198
12199**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12200
12201**Since**: 12
12202
12203**Parameters**
12204
12205| Name                     | Description                                                  |
12206| ------------------------ | ------------------------------------------------------------ |
12207| OH_Drawing_Path          | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12208| OH_Drawing_Rect          | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.    |
12209| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). |
12210
12211### OH_Drawing_PathAddOvalWithInitialPoint()
12212
12213```
12214void OH_Drawing_PathAddOvalWithInitialPoint (OH_Drawing_Path* , const OH_Drawing_Rect* , uint32_t start, OH_Drawing_PathDirection  )
12215```
12216
12217**Description**
12218
12219Adds an oval to a path. **OH_Drawing_Rect** specifies the outer tangent rectangle of the oval, and **OH_Drawing_PathDirection** specifies whether the drawing is clockwise or anticlockwise.
12220
12221Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12222
12223If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12224
12225If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12226
12227**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12228
12229**Since**: 12
12230
12231**Parameters**
12232
12233| Name                     | Description                                                  |
12234| ------------------------ | ------------------------------------------------------------ |
12235| OH_Drawing_Path          | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12236| OH_Drawing_Rect          | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.    |
12237| start                    | Start point of the oval.                                     |
12238| OH_Drawing_PathDirection | Direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). |
12239
12240
12241### OH_Drawing_PathAddPath()
12242
12243```
12244void OH_Drawing_PathAddPath (OH_Drawing_Path* , const OH_Drawing_Path* src, const OH_Drawing_Matrix*  )
12245```
12246
12247**Description**
12248
12249Transforms the points in a **src** path by a matrix and adds the new one to the current path.
12250
12251Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12252
12253If either **OH_Drawing_Path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12254
12255**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12256
12257**Since**: 12
12258
12259**Parameters**
12260
12261| Name              | Description                                                  |
12262| ----------------- | ------------------------------------------------------------ |
12263| OH_Drawing_Path   | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12264| src               | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12265| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If NULL is passed in, it is the identity matrix. |
12266
12267
12268### OH_Drawing_PathAddPathWithMatrixAndMode()
12269
12270```
12271void OH_Drawing_PathAddPathWithMatrixAndMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, const OH_Drawing_Matrix* , OH_Drawing_PathAddMode  )
12272```
12273
12274**Description**
12275
12276Transforms the points in a **src** path by a matrix and adds the new one to the current path with the specified adding mode.
12277
12278Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12279
12280If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12281
12282If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12283
12284**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12285
12286**Since**: 12
12287
12288**Parameters**
12289
12290| Name                   | Description                                                  |
12291| ---------------------- | ------------------------------------------------------------ |
12292| path                   | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12293| src                    | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12294| OH_Drawing_Matrix      | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If NULL is passed in, it is the identity matrix. |
12295| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). |
12296
12297
12298### OH_Drawing_PathAddPathWithMode()
12299
12300```
12301void OH_Drawing_PathAddPathWithMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, OH_Drawing_PathAddMode  )
12302```
12303
12304**Description**
12305
12306Adds a **src** path to the current path with the specified adding mode.
12307
12308Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12309
12310If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12311
12312If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12313
12314**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12315
12316**Since**: 12
12317
12318**Parameters**
12319
12320| Name                   | Description                                                  |
12321| ---------------------- | ------------------------------------------------------------ |
12322| path                   | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12323| src                    | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12324| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). |
12325
12326
12327### OH_Drawing_PathAddPathWithOffsetAndMode()
12328
12329```
12330void OH_Drawing_PathAddPathWithOffsetAndMode (OH_Drawing_Path* path, const OH_Drawing_Path* src, float dx, float dy, OH_Drawing_PathAddMode  )
12331```
12332
12333**Description**
12334
12335Translates a **src** path by an offset and adds the new one to the current path with the specified adding mode.
12336
12337Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12338
12339If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12340
12341If **OH_Drawing_PathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12342
12343**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12344
12345**Since**: 12
12346
12347**Parameters**
12348
12349| Name                   | Description                                                  |
12350| ---------------------- | ------------------------------------------------------------ |
12351| path                   | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12352| src                    | Pointer to a source path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12353| dx                     | X offset.                                                    |
12354| dy                     | Y offset.                                                    |
12355| OH_Drawing_PathAddMode | Path adding mode. For details about the available options, see [OH_Drawing_PathAddMode](#oh_drawing_pathaddmode). |
12356
12357
12358### OH_Drawing_PathAddRect()
12359
12360```
12361void OH_Drawing_PathAddRect (OH_Drawing_Path* , float left, float top, float right, float bottom, OH_Drawing_PathDirection  )
12362```
12363
12364**Description**
12365
12366Adds a rectangle to a path in the specified direction. The start point is the upper left corner of the rectangle.
12367
12368Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12369
12370If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12371
12372If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12373
12374**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12375
12376**Since**: 12
12377
12378**Parameters**
12379
12380| Name                     | Description                                                  |
12381| ------------------------ | ------------------------------------------------------------ |
12382| OH_Drawing_Path          | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12383| left                     | X coordinate of the upper left corner of the rectangle.      |
12384| top                      | Y coordinate of the upper left corner of the rectangle.      |
12385| right                    | X coordinate of the lower right corner of the rectangle.     |
12386| bottom                   | Y coordinate of the lower right corner of the rectangle.     |
12387| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). |
12388
12389
12390### OH_Drawing_PathAddRectWithInitialCorner()
12391
12392```
12393void OH_Drawing_PathAddRectWithInitialCorner (OH_Drawing_Path* , const OH_Drawing_Rect* , OH_Drawing_PathDirection , uint32_t start )
12394```
12395
12396**Description**
12397
12398Adds a rectangle contour to a path in the specified direction.
12399
12400Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12401
12402If either **OH_Drawing_Path** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12403
12404If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12405
12406**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12407
12408**Since**: 12
12409
12410**Parameters**
12411
12412| Name                     | Description                                                  |
12413| ------------------------ | ------------------------------------------------------------ |
12414| OH_Drawing_Path          | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12415| OH_Drawing_Rect          | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object.    |
12416| OH_Drawing_PathDirection | Direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). |
12417| start                    | Start point, indicating the corner of the rectangle from which the path is drawn. The value **0** means the upper left corner, **1** means the upper right corner, **2** means the lower right corner, and **3** means the lower left corner. |
12418
12419
12420### OH_Drawing_PathAddRoundRect()
12421
12422```
12423void OH_Drawing_PathAddRoundRect (OH_Drawing_Path* , const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection  )
12424```
12425
12426**Description**
12427
12428Adds a rounded rectangle contour to a path in the specified direction. When the path direction is clockwise, the start point is at the intersection of the rounded rectangle's left boundary and its lower left corner. When the path direction is counterclockwise, the start point is at the intersection point between the left boundary and the upper left corner.
12429
12430Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12431
12432If either **OH_Drawing_Path** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12433
12434If **OH_Drawing_PathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
12435
12436**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12437
12438**Since**: 12
12439
12440**Parameters**
12441
12442| Name                     | Description                                                  |
12443| ------------------------ | ------------------------------------------------------------ |
12444| OH_Drawing_Path          | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12445| roundRect                | Pointer to an [OH_Drawing_RoundRect](#oh_drawing_roundrect) object. |
12446| OH_Drawing_PathDirection | Path direction. For details about the available options, see [OH_Drawing_PathDirection](#oh_drawing_pathdirection). |
12447
12448
12449### OH_Drawing_PathArcTo()
12450
12451```
12452void OH_Drawing_PathArcTo (OH_Drawing_Path* , float x1, float y1, float x2, float y2, float startDeg, float sweepDeg )
12453```
12454
12455**Description**
12456
12457Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle that encloses an ellipse is specified first, and then a start angle and a sweep angle are specified. The arc is a portion of the ellipse defined by the start angle and the sweep angle. By default, a line segment from the last point of the path to the start point of the arc is also added.
12458
12459Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12460
12461If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12462
12463**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12464
12465**Since**: 8
12466
12467**Parameters**
12468
12469| Name            | Description                                                  |
12470| --------------- | ------------------------------------------------------------ |
12471| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object.                    |
12472| x1              | X coordinate of the upper left corner of the rectangle.      |
12473| y1              | Y coordinate of the upper left corner of the rectangle.      |
12474| x2              | X coordinate of the lower right corner of the rectangle.     |
12475| y2              | Y coordinate of the lower right corner of the rectangle.     |
12476| startDeg        | Start angle. The start direction (0°) of the angle is the positive direction of the X axis. |
12477| sweepDeg        | Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by 360. |
12478
12479
12480### OH_Drawing_PathClose()
12481
12482```
12483void OH_Drawing_PathClose (OH_Drawing_Path* )
12484```
12485
12486**Description**
12487
12488Closes a path by drawing a line segment from the current point to the start point of the path.
12489
12490Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12491
12492If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12493
12494**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12495
12496**Since**: 8
12497
12498**Parameters**
12499
12500| Name            | Description                               |
12501| --------------- | ----------------------------------------- |
12502| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12503
12504
12505### OH_Drawing_PathConicTo()
12506
12507```
12508void OH_Drawing_PathConicTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY, float weight )
12509```
12510
12511**Description**
12512
12513Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.
12514
12515Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12516
12517If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12518
12519**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12520
12521**Since**: 12
12522
12523**Parameters**
12524
12525| Name            | Description                                                  |
12526| --------------- | ------------------------------------------------------------ |
12527| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12528| ctrlX           | X coordinate of the control point.                           |
12529| ctrlY           | Y coordinate of the control point.                           |
12530| endX            | X coordinate of the target point.                            |
12531| endY            | Y coordinate of the target point.                            |
12532| weight          | Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the control point. If the value is less than or equal to 0, this function is equivalent to [OH_Drawing_PathLineTo](#oh_drawing_pathlineto), that is, adding a line segment from the last point of the path to the target point. If the value is 1, this function is equivalent to [OH_Drawing_PathQuadTo](#oh_drawing_pathquadto). |
12533
12534
12535### OH_Drawing_PathContains()
12536
12537```
12538bool OH_Drawing_PathContains (OH_Drawing_Path* , float x, float y )
12539```
12540
12541**Description**
12542
12543Checks whether a coordinate point is included in this path. For details, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype-1).
12544
12545Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12546
12547If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12548
12549**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12550
12551**Since**: 12
12552
12553**Parameters**
12554
12555| Name            | Description                                               |
12556| --------------- | --------------------------------------------------------- |
12557| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. |
12558| x               | Coordinate point on the X axis.                           |
12559| y               | Coordinate point on the Y axis.                           |
12560
12561**Returns**
12562
12563Returns **true** if the coordinate point is included in the path; returns **false** otherwise.
12564
12565
12566### OH_Drawing_PathCopy()
12567
12568```
12569OH_Drawing_Path* OH_Drawing_PathCopy (OH_Drawing_Path* )
12570```
12571
12572**Description**
12573
12574Copies an existing [OH_Drawing_Path](#oh_drawing_path) object to create a new one.
12575
12576Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12577
12578If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12579
12580**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12581
12582**Since**: 12
12583
12584**Parameters**
12585
12586| Name            | Description                                               |
12587| --------------- | --------------------------------------------------------- |
12588| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object. |
12589
12590**Returns**
12591
12592Returns the pointer to the [OH_Drawing_Path](#oh_drawing_path) object created.
12593
12594
12595### OH_Drawing_PathCreate()
12596
12597```
12598OH_Drawing_Path* OH_Drawing_PathCreate (void )
12599```
12600
12601**Description**
12602
12603Creates an **OH_Drawing_Path** object.
12604
12605**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12606
12607**Since**: 8
12608
12609**Returns**
12610
12611Returns the pointer to the **OH_Drawing_Path** object created.
12612
12613
12614### OH_Drawing_PathCubicTo()
12615
12616```
12617void OH_Drawing_PathCubicTo (OH_Drawing_Path* , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY )
12618```
12619
12620**Description**
12621
12622Draws a cubic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.
12623
12624Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12625
12626If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12627
12628**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12629
12630**Since**: 8
12631
12632**Parameters**
12633
12634| Name            | Description                               |
12635| --------------- | ----------------------------------------- |
12636| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12637| ctrlX1          | X coordinate of the first control point.  |
12638| ctrlY1          | Y coordinate of the first control point.  |
12639| ctrlX2          | X coordinate of the second control point. |
12640| ctrlY2          | Y coordinate of the second control point. |
12641| endX            | X coordinate of the target point.         |
12642| endY            | Y coordinate of the target point.         |
12643
12644
12645### OH_Drawing_PathDestroy()
12646
12647```
12648void OH_Drawing_PathDestroy (OH_Drawing_Path* )
12649```
12650
12651**Description**
12652
12653Destroys an **OH_Drawing_Path** object and reclaims the memory occupied by the object.
12654
12655**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12656
12657**Since**: 8
12658
12659**Parameters**
12660
12661| Name            | Description                               |
12662| --------------- | ----------------------------------------- |
12663| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12664
12665
12666### OH_Drawing_PathEffectDestroy()
12667
12668```
12669void OH_Drawing_PathEffectDestroy (OH_Drawing_PathEffect* )
12670```
12671
12672**Description**
12673
12674Destroys an **OH_Drawing_PathEffect** object and reclaims the memory occupied by the object.
12675
12676**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12677
12678**Since**: 12
12679
12680**Parameters**
12681
12682| Name                  | Description                                                  |
12683| --------------------- | ------------------------------------------------------------ |
12684| OH_Drawing_PathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. |
12685
12686
12687### OH_Drawing_PathGetLength()
12688
12689```
12690float OH_Drawing_PathGetLength (OH_Drawing_Path* , bool forceClosed )
12691```
12692
12693**Description**
12694
12695Obtains the length of a path.
12696
12697Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12698
12699If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12700
12701**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12702
12703**Since**: 12
12704
12705**Parameters**
12706
12707| Name            | Description                                                  |
12708| --------------- | ------------------------------------------------------------ |
12709| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12710| forceClosed     | Whether the path is measured as a closed path. The value **true** means that the path is considered closed during measurement, and **false** means that the path is measured based on the actual closed status. |
12711
12712**Returns**
12713
12714Returns the length of the path.
12715
12716
12717### OH_Drawing_PathLineTo()
12718
12719```
12720void OH_Drawing_PathLineTo (OH_Drawing_Path* , float x, float y )
12721```
12722
12723**Description**
12724
12725Draws a line segment from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.
12726
12727Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12728
12729If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12730
12731**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12732
12733**Since**: 8
12734
12735**Parameters**
12736
12737| Name            | Description                               |
12738| --------------- | ----------------------------------------- |
12739| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12740| x               | X coordinate of the target point.         |
12741| y               | Y coordinate of the target point.         |
12742
12743
12744### OH_Drawing_PathMoveTo()
12745
12746```
12747void OH_Drawing_PathMoveTo (OH_Drawing_Path* , float x, float y )
12748```
12749
12750**Description**
12751
12752Sets the start point of a path.
12753
12754Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12755
12756If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12757
12758**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12759
12760**Since**: 8
12761
12762**Parameters**
12763
12764| Name            | Description                               |
12765| --------------- | ----------------------------------------- |
12766| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12767| x               | X coordinate of the start point.          |
12768| y               | Y coordinate of the start point.          |
12769
12770
12771### OH_Drawing_PathOffset()
12772
12773```
12774void OH_Drawing_PathOffset (OH_Drawing_Path* path, OH_Drawing_Path* dst, float dx, float dy )
12775```
12776
12777**Description**
12778
12779Translates a path by an offset along the X axis and Y axis and adds the new one to the **dst** path.
12780
12781Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12782
12783If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12784
12785**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12786
12787**Since**: 12
12788
12789**Parameters**
12790
12791| Name | Description                                                  |
12792| ---- | ------------------------------------------------------------ |
12793| path | Pointer to the current path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
12794| dst  | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object. If NULL is passed in, the result is stored in the current path. |
12795| dx   | X offset.                                                    |
12796| dy   | Y offset.                                                    |
12797
12798
12799### OH_Drawing_PathQuadTo()
12800
12801```
12802void OH_Drawing_PathQuadTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY )
12803```
12804
12805**Description**
12806
12807Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the start point (0, 0) is used.
12808
12809Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12810
12811If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12812
12813**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12814
12815**Since**: 8
12816
12817**Parameters**
12818
12819| Name            | Description                               |
12820| --------------- | ----------------------------------------- |
12821| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12822| ctrlX           | X coordinate of the control point.        |
12823| ctrlY           | Y coordinate of the control point.        |
12824| endX            | X coordinate of the target point.         |
12825| endY            | Y coordinate of the target point.         |
12826
12827
12828### OH_Drawing_PathRConicTo()
12829
12830```
12831void OH_Drawing_PathRConicTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY, float weight )
12832```
12833
12834**Description**
12835
12836Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.
12837
12838Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12839
12840If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12841
12842**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12843
12844**Since**: 12
12845
12846**Parameters**
12847
12848| Name            | Description                                                  |
12849| --------------- | ------------------------------------------------------------ |
12850| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12851| ctrlX           | X offset relative to the last point, which is used to specify the X coordinate of the control point. |
12852| ctrlY           | Y offset relative to the last point, which is used to specify the Y coordinate of the control point. |
12853| endX            | X offset relative to the last point, which is used to specify the X coordinate of the target point. |
12854| endY            | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. |
12855| weight          | Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the control point. If the value is less than or equal to 0, this function is equivalent to [OH_Drawing_PathRLineTo](#oh_drawing_pathrlineto), that is, adding a line segment from the last point of the path to the target point. If the value is 1, this function is equivalent to [OH_Drawing_PathRQuadTo](#oh_drawing_pathrquadto). |
12856
12857
12858### OH_Drawing_PathRCubicTo()
12859
12860```
12861void OH_Drawing_PathRCubicTo (OH_Drawing_Path* , float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY )
12862```
12863
12864**Description**
12865
12866Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.
12867
12868Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12869
12870If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12871
12872**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12873
12874**Since**: 12
12875
12876**Parameters**
12877
12878| Name            | Description                                                  |
12879| --------------- | ------------------------------------------------------------ |
12880| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12881| ctrlX1          | X offset relative to the last point, which is used to specify the X coordinate of the first control point. |
12882| ctrlY1          | Y offset relative to the last point, which is used to specify the Y coordinate of the first control point. |
12883| ctrlX2          | X offset relative to the last point, which is used to specify the X coordinate of the second control point. |
12884| ctrlY2          | Y offset relative to the last point, which is used to specify the Y coordinate of the second control point. |
12885| endX            | X offset relative to the last point, which is used to specify the X coordinate of the target point. |
12886| endY            | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. |
12887
12888
12889### OH_Drawing_PathReset()
12890
12891```
12892void OH_Drawing_PathReset (OH_Drawing_Path* )
12893```
12894
12895**Description**
12896
12897Resets path data.
12898
12899Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12900
12901If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12902
12903**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12904
12905**Since**: 8
12906
12907**Parameters**
12908
12909| Name            | Description                               |
12910| --------------- | ----------------------------------------- |
12911| OH_Drawing_Path | Pointer to an **OH_Drawing_Path** object. |
12912
12913
12914### OH_Drawing_PathRLineTo()
12915
12916```
12917void OH_Drawing_PathRLineTo (OH_Drawing_Path* , float x, float y )
12918```
12919
12920**Description**
12921
12922Draws a line segment from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.
12923
12924Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12925
12926If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12927
12928**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12929
12930**Since**: 12
12931
12932**Parameters**
12933
12934| Name            | Description                                                  |
12935| --------------- | ------------------------------------------------------------ |
12936| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12937| x               | X offset relative to the last point, which is used to specify the X coordinate of the target point. |
12938| y               | Y offset relative to the last point, which is used to specify the X coordinate of the target point. |
12939
12940
12941### OH_Drawing_PathRMoveTo()
12942
12943```
12944void OH_Drawing_PathRMoveTo (OH_Drawing_Path* , float x, float y )
12945```
12946
12947**Description**
12948
12949Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is used.
12950
12951Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12952
12953If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12954
12955**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12956
12957**Since**: 12
12958
12959**Parameters**
12960
12961| Name            | Description                                                  |
12962| --------------- | ------------------------------------------------------------ |
12963| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12964| x               | X offset of the target point relative to the last point. A positive number indicates a rightward shift from the last point, and a negative number indicates a leftward shift from the last point. The value is a floating point number. |
12965| y               | Y offset of the target point relative to the last point. A positive number indicates an upward shift from the last point, and a negative number indicates a downward shift from the last point. The value is a floating point number. |
12966
12967
12968### OH_Drawing_PathRQuadTo()
12969
12970```
12971void OH_Drawing_PathRQuadTo (OH_Drawing_Path* , float ctrlX, float ctrlY, float endX, float endY )
12972```
12973
12974**Description**
12975
12976Draws a quadratic Bezier curve from the last point of a path to a point relative to the last point. If the path is empty, the start point (0, 0) is used.
12977
12978Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
12979
12980If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
12981
12982**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
12983
12984**Since**: 12
12985
12986**Parameters**
12987
12988| Name            | Description                                                  |
12989| --------------- | ------------------------------------------------------------ |
12990| OH_Drawing_Path | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
12991| ctrlX           | X offset relative to the last point, which is used to specify the X coordinate of the control point. |
12992| ctrlY           | Y offset relative to the last point, which is used to specify the Y coordinate of the control point. |
12993| endX            | X offset relative to the last point, which is used to specify the X coordinate of the target point. |
12994| endY            | Y offset relative to the last point, which is used to specify the Y coordinate of the target point. |
12995
12996
12997### OH_Drawing_PathSetFillType()
12998
12999```
13000void OH_Drawing_PathSetFillType (OH_Drawing_Path* , OH_Drawing_PathFillType  )
13001```
13002
13003**Description**
13004
13005Sets the fill type of a path. The fill type determines how "inside" of the path is drawn. For example, when the fill type **Winding** is used, "inside" of the path is determined by a non-zero sum of signed edge crossings. When **EvenOdd** is used, "inside" of the path is determined by an odd number of edge crossings.
13006
13007Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13008
13009If **OH_Drawing_Path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13010
13011If **OH_Drawing_PathFillType** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
13012
13013**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13014
13015**Since**: 12
13016
13017**Parameters**
13018
13019| Name                    | Description                                                  |
13020| ----------------------- | ------------------------------------------------------------ |
13021| OH_Drawing_Path         | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
13022| OH_Drawing_PathFillType | Fill type of the path. For details about the available options, see [OH_Drawing_PathFillType](#oh_drawing_pathfilltype). |
13023
13024
13025### OH_Drawing_PathTransform()
13026
13027```
13028void OH_Drawing_PathTransform (OH_Drawing_Path* , const OH_Drawing_Matrix*  )
13029```
13030
13031**Description**
13032
13033Transforms the points in a path by matrix.
13034
13035Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13036
13037If either **OH_Drawing_Path** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13038
13039**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13040
13041**Since**: 12
13042
13043**Parameters**
13044
13045| Name              | Description                                                  |
13046| ----------------- | ------------------------------------------------------------ |
13047| OH_Drawing_Path   | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
13048| OH_Drawing_Matrix | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
13049
13050
13051### OH_Drawing_PathTransformWithPerspectiveClip()
13052
13053```
13054void OH_Drawing_PathTransformWithPerspectiveClip (OH_Drawing_Path* src, const OH_Drawing_Matrix* , OH_Drawing_Path* dst, bool applyPerspectiveClip )
13055```
13056
13057**Description**
13058
13059Transforms the points in a **src** path by a matrix and uses the new one to replace the **dst** path. If the **dst** path does not exist, the **src** path is replaced.
13060
13061Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13062
13063If either **src** or **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13064
13065**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13066
13067**Since**: 12
13068
13069**Parameters**
13070
13071| Name                 | Description                                                  |
13072| -------------------- | ------------------------------------------------------------ |
13073| src                  | Pointer to an [OH_Drawing_Path](#oh_drawing_path) object.    |
13074| OH_Drawing_Matrix    | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. |
13075| dst                  | Pointer to a destination path, which is an [OH_Drawing_Path](#oh_drawing_path) object. |
13076| applyPerspectiveClip | Whether to apply perspective cropping to the new path. The value **true** means to apply perspective cropping, and **false** means the opposite. |
13077
13078
13079### OH_Drawing_PenCreate()
13080
13081```
13082OH_Drawing_Pen* OH_Drawing_PenCreate (void )
13083```
13084
13085**Description**
13086
13087Creates an **OH_Drawing_Pen** object.
13088
13089**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13090
13091**Since**: 8
13092
13093**Returns**
13094
13095Returns the pointer to the **OH_Drawing_Pen** object created.
13096
13097
13098### OH_Drawing_PenDestroy()
13099
13100```
13101void OH_Drawing_PenDestroy (OH_Drawing_Pen* )
13102```
13103
13104**Description**
13105
13106Destroys an **OH_Drawing_Pen** object and reclaims the memory occupied by the object.
13107
13108**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13109
13110**Since**: 8
13111
13112**Parameters**
13113
13114| Name           | Description                              |
13115| -------------- | ---------------------------------------- |
13116| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13117
13118
13119### OH_Drawing_PenGetAlpha()
13120
13121```
13122uint8_t OH_Drawing_PenGetAlpha (const OH_Drawing_Pen* )
13123```
13124
13125**Description**
13126
13127Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape.
13128
13129Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13130
13131If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13132
13133**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13134
13135**Since**: 11
13136
13137**Parameters**
13138
13139| Name           | Description                              |
13140| -------------- | ---------------------------------------- |
13141| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13142
13143**Returns**
13144
13145Returns an 8-bit variable that describes the alpha value.
13146
13147
13148### OH_Drawing_PenGetCap()
13149
13150```
13151OH_Drawing_PenLineCapStyle OH_Drawing_PenGetCap (const OH_Drawing_Pen* )
13152```
13153
13154**Description**
13155
13156Obtains the line cap style of a pen.
13157
13158Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13159
13160If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13161
13162**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13163
13164**Since**: 8
13165
13166**Parameters**
13167
13168| Name           | Description                              |
13169| -------------- | ---------------------------------------- |
13170| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13171
13172**Returns**
13173
13174Returns the line cap style.
13175
13176
13177### OH_Drawing_PenGetColor()
13178
13179```
13180uint32_t OH_Drawing_PenGetColor (const OH_Drawing_Pen* )
13181```
13182
13183**Description**
13184
13185Obtains the color of a pen. The color is used by the pen to outline a shape.
13186
13187Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13188
13189If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13190
13191**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13192
13193**Since**: 8
13194
13195**Parameters**
13196
13197| Name           | Description                              |
13198| -------------- | ---------------------------------------- |
13199| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13200
13201**Returns**
13202
13203Returns a 32-bit (ARGB) variable that describes the color.
13204
13205
13206### OH_Drawing_PenGetFilter()
13207
13208```
13209void OH_Drawing_PenGetFilter (OH_Drawing_Pen* , OH_Drawing_Filter*  )
13210```
13211
13212**Description**
13213
13214Obtains the filter of a pen. The filter is a container that holds a mask filter and color filter.
13215
13216Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13217
13218If either **OH_Drawing_Pen** or **OH_Drawing_Filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13219
13220**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13221
13222**Since**: 12
13223
13224**Parameters**
13225
13226| Name              | Description                                                  |
13227| ----------------- | ------------------------------------------------------------ |
13228| OH_Drawing_Pen    | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.      |
13229| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. |
13230
13231
13232### OH_Drawing_PenGetJoin()
13233
13234```
13235OH_Drawing_PenLineJoinStyle OH_Drawing_PenGetJoin (const OH_Drawing_Pen* )
13236```
13237
13238**Description**
13239
13240Obtains the line join style of a pen.
13241
13242Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13243
13244If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13245
13246**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13247
13248**Since**: 8
13249
13250**Parameters**
13251
13252| Name           | Description                              |
13253| -------------- | ---------------------------------------- |
13254| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13255
13256**Returns**
13257
13258Returns the line join style.
13259
13260### OH_Drawing_PenGetMiterLimit()
13261
13262```
13263float OH_Drawing_PenGetMiterLimit (const OH_Drawing_Pen* )
13264```
13265
13266**Description**
13267
13268Obtains the stroke miter limit of a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.
13269
13270Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13271
13272If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13273
13274**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13275
13276**Since**: 8
13277
13278**Parameters**
13279
13280| Name           | Description                              |
13281| -------------- | ---------------------------------------- |
13282| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13283
13284**Returns**
13285
13286Returns the miter limit.
13287
13288
13289### OH_Drawing_PenGetWidth()
13290
13291```
13292float OH_Drawing_PenGetWidth (const OH_Drawing_Pen* )
13293```
13294
13295**Description**
13296
13297Obtains the width of a pen. The width describes the thickness of the outline of a shape.
13298
13299Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13300
13301If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13302
13303**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13304
13305**Since**: 8
13306
13307**Parameters**
13308
13309| Name           | Description                              |
13310| -------------- | ---------------------------------------- |
13311| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13312
13313**Returns**
13314
13315Returns the width of the pen.
13316
13317
13318### OH_Drawing_PenIsAntiAlias()
13319
13320```
13321bool OH_Drawing_PenIsAntiAlias (const OH_Drawing_Pen* )
13322```
13323
13324**Description**
13325
13326Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.
13327
13328Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13329
13330If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13331
13332**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13333
13334**Since**: 8
13335
13336**Parameters**
13337
13338| Name           | Description                              |
13339| -------------- | ---------------------------------------- |
13340| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13341
13342**Returns**
13343
13344Returns **true** if anti-aliasing is enabled; returns **false** otherwise.
13345
13346
13347### OH_Drawing_PenReset()
13348
13349```
13350void OH_Drawing_PenReset (OH_Drawing_Pen* )
13351```
13352
13353**Description**
13354
13355Resets a pen to the initial state.
13356
13357Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13358
13359If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13360
13361**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13362
13363**Since**: 12
13364
13365**Parameters**
13366
13367| Name           | Description                                             |
13368| -------------- | ------------------------------------------------------- |
13369| OH_Drawing_Pen | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object. |
13370
13371
13372### OH_Drawing_PenSetAlpha()
13373
13374```
13375void OH_Drawing_PenSetAlpha (OH_Drawing_Pen* , uint8_t alpha )
13376```
13377
13378**Description**
13379
13380Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape.
13381
13382Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13383
13384If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13385
13386**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13387
13388**Since**: 11
13389
13390**Parameters**
13391
13392| Name           | Description                              |
13393| -------------- | ---------------------------------------- |
13394| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13395| alpha          | Alpha value, which is an 8-bit variable. |
13396
13397
13398### OH_Drawing_PenSetAntiAlias()
13399
13400```
13401void OH_Drawing_PenSetAntiAlias (OH_Drawing_Pen* , bool  )
13402```
13403
13404**Description**
13405
13406Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-transparent.
13407
13408Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13409
13410If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13411
13412**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13413
13414**Since**: 8
13415
13416**Parameters**
13417
13418| Name           | Description                                                  |
13419| -------------- | ------------------------------------------------------------ |
13420| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object.                     |
13421| bool           | Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** means the opposite. |
13422
13423
13424### OH_Drawing_PenSetBlendMode()
13425
13426```
13427void OH_Drawing_PenSetBlendMode (OH_Drawing_Pen* , OH_Drawing_BlendMode  )
13428```
13429
13430**Description**
13431
13432Sets a blender for a pen. The blender implements the specified blend mode.
13433
13434Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13435
13436If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13437
13438If **OH_Drawing_BlendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
13439
13440**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13441
13442**Since**: 12
13443
13444**Parameters**
13445
13446| Name                 | Description                                                  |
13447| -------------------- | ------------------------------------------------------------ |
13448| OH_Drawing_Pen       | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.      |
13449| OH_Drawing_BlendMode | Blend mode. For details about the available options, see [OH_Drawing_BlendMode](#oh_drawing_blendmode). |
13450
13451
13452### OH_Drawing_PenSetCap()
13453
13454```
13455void OH_Drawing_PenSetCap (OH_Drawing_Pen* , OH_Drawing_PenLineCapStyle  )
13456```
13457
13458**Description**
13459
13460Sets the line cap style for a pen.
13461
13462Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13463
13464If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13465
13466If **OH_Drawing_PenLineCapStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
13467
13468**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13469
13470**Since**: 8
13471
13472**Parameters**
13473
13474| Name                       | Description                              |
13475| -------------------------- | ---------------------------------------- |
13476| OH_Drawing_Pen             | Pointer to an **OH_Drawing_Pen** object. |
13477| OH_Drawing_PenLineCapStyle | Line cap style, which is a variable.     |
13478
13479
13480### OH_Drawing_PenSetColor()
13481
13482```
13483void OH_Drawing_PenSetColor (OH_Drawing_Pen* , uint32_t color )
13484```
13485
13486**Description**
13487
13488Sets the color for a pen. The color is used by the pen to outline a shape.
13489
13490Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13491
13492If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13493
13494**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13495
13496**Since**: 8
13497
13498**Parameters**
13499
13500| Name           | Description                               |
13501| -------------- | ----------------------------------------- |
13502| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object.  |
13503| color          | Color, which is a 32-bit (ARGB) variable. |
13504
13505
13506### OH_Drawing_PenSetFilter()
13507
13508```
13509void OH_Drawing_PenSetFilter (OH_Drawing_Pen* , OH_Drawing_Filter*  )
13510```
13511
13512**Description**
13513
13514Sets a filter for a pen.
13515
13516Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13517
13518If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13519
13520**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13521
13522**Since**: 11
13523
13524**Parameters**
13525
13526| Name              | Description                                                  |
13527| ----------------- | ------------------------------------------------------------ |
13528| OH_Drawing_Pen    | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.      |
13529| OH_Drawing_Filter | Pointer to an [OH_Drawing_Filter](#oh_drawing_filter) object. If NULL is passed in, the filter will be cleared. |
13530
13531
13532### OH_Drawing_PenSetJoin()
13533
13534```
13535void OH_Drawing_PenSetJoin (OH_Drawing_Pen* , OH_Drawing_PenLineJoinStyle  )
13536```
13537
13538**Description**
13539
13540Sets the line join style for a pen.
13541
13542Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13543
13544If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13545
13546If **OH_Drawing_PenLineJoinStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
13547
13548**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13549
13550**Since**: 8
13551
13552**Parameters**
13553
13554| Name                        | Description                              |
13555| --------------------------- | ---------------------------------------- |
13556| OH_Drawing_Pen              | Pointer to an **OH_Drawing_Pen** object. |
13557| OH_Drawing_PenLineJoinStyle | Line join style.                         |
13558
13559
13560### OH_Drawing_PenSetMiterLimit()
13561
13562```
13563void OH_Drawing_PenSetMiterLimit (OH_Drawing_Pen* , float miter )
13564```
13565
13566**Description**
13567
13568Sets the stroke miter limit for a polyline drawn by a pen. When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.
13569
13570Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13571
13572If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13573
13574**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13575
13576**Since**: 8
13577
13578**Parameters**
13579
13580| Name           | Description                              |
13581| -------------- | ---------------------------------------- |
13582| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13583| miter          | Stroke miter limit, which is a variable. |
13584
13585
13586### OH_Drawing_PenSetPathEffect()
13587
13588```
13589void OH_Drawing_PenSetPathEffect (OH_Drawing_Pen* , OH_Drawing_PathEffect*  )
13590```
13591
13592**Description**
13593
13594Sets the path effect for a pen.
13595
13596Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13597
13598If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13599
13600**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13601
13602**Since**: 12
13603
13604**Parameters**
13605
13606| Name                  | Description                                                  |
13607| --------------------- | ------------------------------------------------------------ |
13608| OH_Drawing_Pen        | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.      |
13609| OH_Drawing_PathEffect | Pointer to an [OH_Drawing_PathEffect](#oh_drawing_patheffect) object. If NULL is passed in, the path effect will be cleared. |
13610
13611
13612### OH_Drawing_PenSetShaderEffect()
13613
13614```
13615void OH_Drawing_PenSetShaderEffect (OH_Drawing_Pen* , OH_Drawing_ShaderEffect*  )
13616```
13617
13618**Description**
13619
13620Sets the shader effect for a pen.
13621
13622Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13623
13624If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13625
13626**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13627
13628**Since**: 11
13629
13630**Parameters**
13631
13632| Name                    | Description                                                  |
13633| ----------------------- | ------------------------------------------------------------ |
13634| OH_Drawing_Pen          | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object.      |
13635| OH_Drawing_ShaderEffect | Pointer to an [OH_Drawing_ShaderEffect](#oh_drawing_shadereffect) object. If NULL is passed in, the shader effect will be cleared. |
13636
13637
13638### OH_Drawing_PenSetWidth()
13639
13640```
13641void OH_Drawing_PenSetWidth (OH_Drawing_Pen* , float width )
13642```
13643
13644**Description**
13645
13646Sets the width for a pen. The value **0** is treated as an unusually thin width. During drawing, the width of 0 is always drawn as 1 pixel wide, regardless of any scaling applied to the canvas. Negative values are also regarded as the value **0** during the drawing process.
13647
13648Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13649
13650If **OH_Drawing_Pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13651
13652**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13653
13654**Since**: 8
13655
13656**Parameters**
13657
13658| Name           | Description                              |
13659| -------------- | ---------------------------------------- |
13660| OH_Drawing_Pen | Pointer to an **OH_Drawing_Pen** object. |
13661| width          | Width, which is a variable.              |
13662
13663
13664### OH_Drawing_PointCreate()
13665
13666```
13667OH_Drawing_Point* OH_Drawing_PointCreate (float x, float y )
13668```
13669
13670**Description**
13671
13672Creates an **OH_Drawing_Point** object.
13673
13674**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13675
13676**Since**: 11
13677
13678**Parameters**
13679
13680| Name | Description                |
13681| ---- | -------------------------- |
13682| x    | X coordinate of the point. |
13683| y    | Y coordinate of the point. |
13684
13685**Returns**
13686
13687Returns the pointer to the **OH_Drawing_Point** object created.
13688
13689
13690### OH_Drawing_PointDestroy()
13691
13692```
13693void OH_Drawing_PointDestroy (OH_Drawing_Point* )
13694```
13695
13696**Description**
13697
13698Destroys an **OH_Drawing_Point** object and reclaims the memory occupied by the object.
13699
13700**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13701
13702**Since**: 11
13703
13704**Parameters**
13705
13706| Name             | Description                                |
13707| ---------------- | ------------------------------------------ |
13708| OH_Drawing_Point | Pointer to an **OH_Drawing_Point** object. |
13709
13710
13711### OH_Drawing_RectCopy()
13712
13713```
13714void OH_Drawing_RectCopy (OH_Drawing_Rect* sRect, OH_Drawing_Rect* dRect )
13715```
13716
13717**Description**
13718
13719Copies a source rectangle to create a new one.
13720
13721Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13722
13723If either **sRect** or **dRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13724
13725**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13726
13727**Since**: 12
13728
13729**Parameters**
13730
13731| Name  | Description                                                  |
13732| ----- | ------------------------------------------------------------ |
13733| sRect | Pointer to a source rectangle, which is an **OH_Drawing_Rect** object. |
13734| dRect | Pointer to a destination rectangle, which is an **OH_Drawing_Rect** object. |
13735
13736
13737### OH_Drawing_RectCreate()
13738
13739```
13740OH_Drawing_Rect* OH_Drawing_RectCreate (float left, float top, float right, float bottom )
13741```
13742
13743**Description**
13744
13745Creates an **OH_Drawing_Rect** object, without sorting the coordinates passed in. This means that the coordinates of the upper left corner of the rectangle can be greater than those of the lower right corner.
13746
13747**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13748
13749**Since**: 11
13750
13751**Parameters**
13752
13753| Name   | Description                                              |
13754| ------ | -------------------------------------------------------- |
13755| left   | X coordinate of the upper left corner of the rectangle.  |
13756| top    | Y coordinate of the upper left corner of the rectangle.  |
13757| right  | X coordinate of the lower right corner of the rectangle. |
13758| bottom | Y coordinate of the lower right corner of the rectangle. |
13759
13760**Returns**
13761
13762Returns the pointer to the **OH_Drawing_Rect** object created.
13763
13764
13765### OH_Drawing_RectDestroy()
13766
13767```
13768void OH_Drawing_RectDestroy (OH_Drawing_Rect* )
13769```
13770
13771**Description**
13772
13773Destroys an **OH_Drawing_Rect** object and reclaims the memory occupied by the object.
13774
13775**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13776
13777**Since**: 11
13778
13779**Parameters**
13780
13781| Name            | Description                               |
13782| --------------- | ----------------------------------------- |
13783| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13784
13785
13786### OH_Drawing_RectGetBottom()
13787
13788```
13789float OH_Drawing_RectGetBottom (OH_Drawing_Rect* )
13790```
13791
13792**Description**
13793
13794Obtains the Y coordinate of the lower right corner of a rectangle.
13795
13796Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13797
13798If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13799
13800**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13801
13802**Since**: 12
13803
13804**Parameters**
13805
13806| Name            | Description                               |
13807| --------------- | ----------------------------------------- |
13808| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13809
13810**Returns**
13811
13812Returns the Y coordinate of the lower right corner of the rectangle.
13813
13814
13815### OH_Drawing_RectGetHeight()
13816
13817```
13818float OH_Drawing_RectGetHeight (OH_Drawing_Rect* )
13819```
13820
13821**Description**
13822
13823Obtains the height of a rectangle. The height is calculated by using the Y coordinate of the lower right corner of the rectangle minus the Y coordinate of the upper left corner.
13824
13825Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13826
13827If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13828
13829**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13830
13831**Since**: 12
13832
13833**Parameters**
13834
13835| Name            | Description                               |
13836| --------------- | ----------------------------------------- |
13837| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13838
13839**Returns**
13840
13841Returns the height of the rectangle, in pixels.
13842
13843
13844### OH_Drawing_RectGetLeft()
13845
13846```
13847float OH_Drawing_RectGetLeft (OH_Drawing_Rect* )
13848```
13849
13850**Description**
13851
13852Obtains the X coordinate of the upper left corner of a rectangle.
13853
13854Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13855
13856If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13857
13858**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13859
13860**Since**: 12
13861
13862**Parameters**
13863
13864| Name            | Description                               |
13865| --------------- | ----------------------------------------- |
13866| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13867
13868**Returns**
13869
13870Returns the X coordinate of the upper left corner of the rectangle.
13871
13872
13873### OH_Drawing_RectGetRight()
13874
13875```
13876float OH_Drawing_RectGetRight (OH_Drawing_Rect* )
13877```
13878
13879**Description**
13880
13881Obtains the X coordinate of the lower right corner of a rectangle.
13882
13883Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13884
13885If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13886
13887**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13888
13889**Since**: 12
13890
13891**Parameters**
13892
13893| Name            | Description                               |
13894| --------------- | ----------------------------------------- |
13895| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13896
13897**Returns**
13898
13899Returns the X coordinate of the lower right corner of the rectangle.
13900
13901
13902### OH_Drawing_RectGetTop()
13903
13904```
13905float OH_Drawing_RectGetTop (OH_Drawing_Rect* )
13906```
13907
13908**Description**
13909
13910Obtains the Y coordinate of the upper left corner of a rectangle.
13911
13912Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13913
13914If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13915
13916**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13917
13918**Since**: 12
13919
13920**Parameters**
13921
13922| Name            | Description                               |
13923| --------------- | ----------------------------------------- |
13924| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13925
13926**Returns**
13927
13928Returns the Y coordinate of the upper left corner of the rectangle.
13929
13930
13931### OH_Drawing_RectGetWidth()
13932
13933```
13934float OH_Drawing_RectGetWidth (OH_Drawing_Rect* )
13935```
13936
13937**Description**
13938
13939Obtains the width of a rectangle. The width is calculated by using the X coordinate of the lower right corner of the rectangle minus the X coordinate of the upper left corner.
13940
13941Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13942
13943If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13944
13945**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13946
13947**Since**: 12
13948
13949**Parameters**
13950
13951| Name            | Description                               |
13952| --------------- | ----------------------------------------- |
13953| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object. |
13954
13955**Returns**
13956
13957Returns the weight of the rectangle, in pixels.
13958
13959
13960### OH_Drawing_RectIntersect()
13961
13962```
13963bool OH_Drawing_RectIntersect (OH_Drawing_Rect* rect, const OH_Drawing_Rect* other )
13964```
13965
13966**Description**
13967
13968Checks whether two rectangles intersect and if yes, sets **rect** to the area of intersection.
13969
13970Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
13971
13972If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
13973
13974**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
13975
13976**Since**: 12
13977
13978**Parameters**
13979
13980| Name  | Description                                                  |
13981| ----- | ------------------------------------------------------------ |
13982| rect  | Pointer to the first rectangle, which is an **OH_Drawing_Rect** object. |
13983| other | Pointer to the second rectangle, which is an **OH_Drawing_Rect** object. |
13984
13985**Returns**
13986
13987Returns **true** if they intersect (**rect** is set to the intersection area); returns **false** otherwise (**rect** remains unchanged).
13988
13989
13990### OH_Drawing_RectSetBottom()
13991
13992```
13993void OH_Drawing_RectSetBottom (OH_Drawing_Rect* rect, float bottom )
13994```
13995
13996**Description**
13997
13998Sets the vertical coordinate of the lower right corner of a rectangle.
13999
14000Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14001
14002If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14003
14004**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14005
14006**Since**: 12
14007
14008**Parameters**
14009
14010| Name   | Description                                              |
14011| ------ | -------------------------------------------------------- |
14012| rect   | Pointer to an **OH_Drawing_Rect** object.                |
14013| bottom | Y coordinate of the lower right corner of the rectangle. |
14014
14015
14016### OH_Drawing_RectSetLeft()
14017
14018```
14019void OH_Drawing_RectSetLeft (OH_Drawing_Rect* rect, float left )
14020```
14021
14022**Description**
14023
14024Sets the horizontal coordinate of the upper left corner of a rectangle.
14025
14026Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14027
14028If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14029
14030**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14031
14032**Since**: 12
14033
14034**Parameters**
14035
14036| Name | Description                                             |
14037| ---- | ------------------------------------------------------- |
14038| rect | Pointer to an **OH_Drawing_Rect** object.               |
14039| left | X coordinate of the upper left corner of the rectangle. |
14040
14041
14042### OH_Drawing_RectSetRight()
14043
14044```
14045void OH_Drawing_RectSetRight (OH_Drawing_Rect* rect, float right )
14046```
14047
14048**Description**
14049
14050Sets the horizontal coordinate of the lower right corner of a rectangle.
14051
14052Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14053
14054If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14055
14056**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14057
14058**Since**: 12
14059
14060**Parameters**
14061
14062| Name  | Description                                              |
14063| ----- | -------------------------------------------------------- |
14064| rect  | Pointer to an **OH_Drawing_Rect** object.                |
14065| right | X coordinate of the lower right corner of the rectangle. |
14066
14067
14068### OH_Drawing_RectSetTop()
14069
14070```
14071void OH_Drawing_RectSetTop (OH_Drawing_Rect* rect, float top )
14072```
14073
14074**Description**
14075
14076Sets the vertical coordinate of the upper left corner of a rectangle.
14077
14078Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14079
14080If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14081
14082**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14083
14084**Since**: 12
14085
14086**Parameters**
14087
14088| Name | Description                                             |
14089| ---- | ------------------------------------------------------- |
14090| rect | Pointer to an **OH_Drawing_Rect** object.               |
14091| top  | Y coordinate of the upper left corner of the rectangle. |
14092
14093
14094### OH_Drawing_RegionCreate()
14095
14096```
14097OH_Drawing_Region* OH_Drawing_RegionCreate (void )
14098```
14099
14100**Description**
14101
14102Creates an **OH_Drawing_Region** object for more accurate graphical control.
14103
14104**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14105
14106**Since**: 12
14107
14108**Returns**
14109
14110Returns the pointer to the **OH_Drawing_Region** object created.
14111
14112
14113### OH_Drawing_RegionDestroy()
14114
14115```
14116void OH_Drawing_RegionDestroy (OH_Drawing_Region* )
14117```
14118
14119**Description**
14120
14121Destroys an **OH_Drawing_Region** object and reclaims the memory occupied by the object.
14122
14123**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14124
14125**Since**: 12
14126
14127**Parameters**
14128
14129| Name              | Description                                 |
14130| ----------------- | ------------------------------------------- |
14131| OH_Drawing_Region | Pointer to an **OH_Drawing_Region** object. |
14132
14133
14134### OH_Drawing_RegionSetRect()
14135
14136```
14137bool OH_Drawing_RegionSetRect (OH_Drawing_Region* region, const OH_Drawing_Rect* rect )
14138```
14139
14140**Description**
14141
14142Sets the boundary for an **OH_Drawing_Region** object.
14143
14144Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14145
14146If either **region** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14147
14148**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14149
14150**Since**: 12
14151
14152**Parameters**
14153
14154| Name   | Description                                 |
14155| ------ | ------------------------------------------- |
14156| region | Pointer to an **OH_Drawing_Region** object. |
14157| rect   | Pointer to an **OH_Drawing_Rect** object.   |
14158
14159**Returns**
14160
14161Returns **true** if the setting is successful; returns **false** otherwise.
14162
14163
14164### OH_Drawing_RegisterFont()
14165
14166```
14167uint32_t OH_Drawing_RegisterFont (OH_Drawing_FontCollection* , const char* fontFamily, const char* familySrc )
14168```
14169
14170**Description**
14171
14172Registers a custom font with the font manager. The supported font file formats are .ttf and .otf.
14173
14174**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14175
14176**Since**: 11
14177
14178**Parameters**
14179
14180| Name                      | Description                                         |
14181| ------------------------- | --------------------------------------------------- |
14182| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. |
14183| fontFamily                | Pointer to the family name of the font to register. |
14184| familySrc                 | Pointer to the path of the font file.               |
14185
14186**Returns**
14187
14188Returns **0** if the font is registered; returns **1** if the file does not exist; returns **2** if opening the file fails; returns **3** if reading the file fails; returns **4** if the file is not found; returns **5** if the file size is not obtained; returns **9** if the file is damaged.
14189
14190
14191### OH_Drawing_RegisterFontBuffer()
14192
14193```
14194uint32_t OH_Drawing_RegisterFontBuffer (OH_Drawing_FontCollection* , const char* fontFamily, uint8_t* fontBuffer, size_t length )
14195```
14196
14197**Description**
14198
14199Registers a font buffer with the font manager.
14200
14201**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14202
14203**Since**: 11
14204
14205**Parameters**
14206
14207| Name                      | Description                                         |
14208| ------------------------- | --------------------------------------------------- |
14209| OH_Drawing_FontCollection | Pointer to an **OH_Drawing_FontCollection** object. |
14210| fontFamily                | Pointer to the family name of the font to register. |
14211| fontBuffer                | Pointer to the buffer of the font file.             |
14212| length                    | Length of the font file.                            |
14213
14214**Returns**
14215
14216Returns **0** if the font is registered; returns **6** if the buffer size is zero; returns **7** if the font set is empty; returns **9** if the file is damaged.
14217
14218
14219### OH_Drawing_RoundRectCreate()
14220
14221```
14222OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate (const OH_Drawing_Rect* , float xRad, float yRad )
14223```
14224
14225**Description**
14226
14227Creates an **OH_Drawing_RoundRect** object.
14228
14229Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14230
14231If **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14232
14233**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14234
14235**Since**: 11
14236
14237**Parameters**
14238
14239| Name            | Description                                                  |
14240| --------------- | ------------------------------------------------------------ |
14241| OH_Drawing_Rect | Pointer to an **OH_Drawing_Rect** object.                    |
14242| xRad            | Radius of the rounded corner on the X axis. A negative number is invalid. |
14243| yRad            | Radius of the rounded corner on the Y axis. A negative number is invalid. |
14244
14245**Returns**
14246
14247Returns the pointer to the **OH_Drawing_RoundRect** object created.
14248
14249
14250### OH_Drawing_RoundRectDestroy()
14251
14252```
14253void OH_Drawing_RoundRectDestroy (OH_Drawing_RoundRect* )
14254```
14255
14256**Description**
14257
14258Destroys an **OH_Drawing_RoundRect** object and reclaims the memory occupied by the object.
14259
14260**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14261
14262**Since**: 11
14263
14264**Parameters**
14265
14266| Name                 | Description                                    |
14267| -------------------- | ---------------------------------------------- |
14268| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object. |
14269
14270
14271### OH_Drawing_RoundRectGetCorner()
14272
14273```
14274OH_Drawing_Corner_Radii OH_Drawing_RoundRectGetCorner (OH_Drawing_RoundRect* , OH_Drawing_CornerPos pos )
14275```
14276
14277**Description**
14278
14279Obtains the radii of the specified rounded corner in a rounded rectangle.
14280
14281Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14282
14283If **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14284
14285**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14286
14287**Since**: 12
14288
14289**Parameters**
14290
14291| Name                 | Description                                                  |
14292| -------------------- | ------------------------------------------------------------ |
14293| OH_Drawing_RoundRect | Pointer to an **OH_Drawing_RoundRect** object.               |
14294| pos                  | Position of the rounded corner. For details about the available options, see [OH_Drawing_CornerPos](#oh_drawing_cornerpos). |
14295
14296**Returns**
14297
14298Returns an [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) struct, including the radii on the X axis and Y axis.
14299
14300
14301### OH_Drawing_RoundRectSetCorner()
14302
14303```
14304void OH_Drawing_RoundRectSetCorner (OH_Drawing_RoundRect* , OH_Drawing_CornerPos pos, OH_Drawing_Corner_Radii  )
14305```
14306
14307**Description**
14308
14309Sets the radii of the specified rounded corner in a rounded rectangle.
14310
14311Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14312
14313If **OH_Drawing_RoundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
14314
14315**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14316
14317**Since**: 12
14318
14319**Parameters**
14320
14321| Name                    | Description                                                  |
14322| ----------------------- | ------------------------------------------------------------ |
14323| OH_Drawing_RoundRect    | Pointer to an **OH_Drawing_RoundRect** object.               |
14324| pos                     | Position of the rounded corner. For details about the available options, see [OH_Drawing_CornerPos](#oh_drawing_cornerpos). |
14325| OH_Drawing_Corner_Radii | [OH_Drawing_Corner_Radii](#oh_drawing_corner_radii) struct, including the radii on the X axis and Y axis. The value must be greater than or equal to 0. |
14326
14327
14328### OH_Drawing_SamplingOptionsCreate()
14329
14330```
14331OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate (OH_Drawing_FilterMode , OH_Drawing_MipmapMode  )
14332```
14333
14334**Description**
14335
14336Creates an **OH_Drawing_SamplingOptions** object.
14337
14338Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
14339
14340If **OH_Drawing_MipmapMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
14341
14342**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14343
14344**Since**: 12
14345
14346**Parameters**
14347
14348| Name                  | Description                                                  |
14349| --------------------- | ------------------------------------------------------------ |
14350| OH_Drawing_FilterMode | Filter mode. For details about the available options, see [OH_Drawing_FilterMode](#oh_drawing_filtermode). |
14351| OH_Drawing_MipmapMode | Mipmap mode. For details about the available options, see [OH_Drawing_MipmapMode](#oh_drawing_mipmapmode). |
14352
14353**Returns**
14354
14355Returns the pointer to the [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object created.
14356
14357
14358### OH_Drawing_SamplingOptionsDestroy()
14359
14360```
14361void OH_Drawing_SamplingOptionsDestroy (OH_Drawing_SamplingOptions* )
14362```
14363
14364**Description**
14365
14366Destroys an **OH_Drawing_SamplingOptions** object and reclaims the memory occupied by the object.
14367
14368**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14369
14370**Since**: 12
14371
14372**Parameters**
14373
14374| Name                       | Description                                                  |
14375| -------------------------- | ------------------------------------------------------------ |
14376| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. |
14377
14378
14379### OH_Drawing_SetTextStyleBackgroundBrush()
14380
14381```
14382void OH_Drawing_SetTextStyleBackgroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush*  )
14383```
14384
14385**Description**
14386
14387Sets the background brush for a text style.
14388
14389**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14390
14391**Since**: 12
14392
14393**Parameters**
14394
14395| Name                 | Description                                                  |
14396| -------------------- | ------------------------------------------------------------ |
14397| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14398| OH_Drawing_Brush     | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). |
14399
14400
14401### OH_Drawing_SetTextStyleBackgroundPen()
14402
14403```
14404void OH_Drawing_SetTextStyleBackgroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen*  )
14405```
14406
14407**Description**
14408
14409Sets the background pen for a text style.
14410
14411**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14412
14413**Since**: 12
14414
14415**Parameters**
14416
14417| Name                 | Description                                                  |
14418| -------------------- | ------------------------------------------------------------ |
14419| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14420| OH_Drawing_Pen       | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). |
14421
14422
14423### OH_Drawing_SetTextStyleBaseLine()
14424
14425```
14426void OH_Drawing_SetTextStyleBaseLine (OH_Drawing_TextStyle* , int  )
14427```
14428
14429**Description**
14430
14431Sets the baseline for a text style.
14432
14433**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14434
14435**Since**: 8
14436
14437**Parameters**
14438
14439| Name                 | Description                                                  |
14440| -------------------- | ------------------------------------------------------------ |
14441| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14442| int                  | Text baseline. For details about the available options, see [OH_Drawing_TextBaseline](#oh_drawing_textbaseline). |
14443
14444
14445### OH_Drawing_SetTextStyleColor()
14446
14447```
14448void OH_Drawing_SetTextStyleColor (OH_Drawing_TextStyle* , uint32_t  )
14449```
14450
14451**Description**
14452
14453Sets the color for a text style.
14454
14455**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14456
14457**Since**: 8
14458
14459**Parameters**
14460
14461| Name                 | Description                                                  |
14462| -------------------- | ------------------------------------------------------------ |
14463| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14464| uint32_t             | Color.                                                       |
14465
14466
14467### OH_Drawing_SetTextStyleDecoration()
14468
14469```
14470void OH_Drawing_SetTextStyleDecoration (OH_Drawing_TextStyle* , int  )
14471```
14472
14473**Description**
14474
14475Sets the decoration for a text style. Only one decoration can be set. To add multiple decorations, use [OH_Drawing_AddTextStyleDecoration](#oh_drawing_addtextstyledecoration).
14476
14477**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14478
14479**Since**: 8
14480
14481**Parameters**
14482
14483| Name                 | Description                                                  |
14484| -------------------- | ------------------------------------------------------------ |
14485| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14486| int                  | Text decoration. For details about the available options, see [OH_Drawing_TextDecoration](#oh_drawing_textdecoration). |
14487
14488
14489### OH_Drawing_SetTextStyleDecorationColor()
14490
14491```
14492void OH_Drawing_SetTextStyleDecorationColor (OH_Drawing_TextStyle* , uint32_t  )
14493```
14494
14495**Description**
14496
14497Sets the decoration color for a text style.
14498
14499**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14500
14501**Since**: 8
14502
14503**Parameters**
14504
14505| Name                 | Description                                                  |
14506| -------------------- | ------------------------------------------------------------ |
14507| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14508| uint32_t             | Color.                                                       |
14509
14510
14511### OH_Drawing_SetTextStyleDecorationStyle()
14512
14513```
14514void OH_Drawing_SetTextStyleDecorationStyle (OH_Drawing_TextStyle* , int  )
14515```
14516
14517**Description**
14518
14519Sets the decoration style for a text style.
14520
14521**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14522
14523**Since**: 11
14524
14525**Parameters**
14526
14527| Name                 | Description                                                  |
14528| -------------------- | ------------------------------------------------------------ |
14529| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14530| int                  | Text decoration style. For details about the available options, see [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle). |
14531
14532
14533### OH_Drawing_SetTextStyleDecorationThicknessScale()
14534
14535```
14536void OH_Drawing_SetTextStyleDecorationThicknessScale (OH_Drawing_TextStyle* , double  )
14537```
14538
14539**Description**
14540
14541Sets the thickness scale factor for the decoration style of a text style.
14542
14543**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14544
14545**Since**: 11
14546
14547**Parameters**
14548
14549| Name                 | Description                                                  |
14550| -------------------- | ------------------------------------------------------------ |
14551| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14552| double               | Scale factor.                                                |
14553
14554
14555### OH_Drawing_SetTextStyleEllipsis()
14556
14557```
14558void OH_Drawing_SetTextStyleEllipsis (OH_Drawing_TextStyle* , const char*  )
14559```
14560
14561**Description**
14562
14563Sets the ellipsis content for a text style.
14564
14565**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14566
14567**Since**: 11
14568
14569**Parameters**
14570
14571| Name                 | Description                                                  |
14572| -------------------- | ------------------------------------------------------------ |
14573| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14574| char\*               | Pointer to the ellipsis content. The data type is a pointer pointing to char. |
14575
14576
14577### OH_Drawing_SetTextStyleEllipsisModal()
14578
14579```
14580void OH_Drawing_SetTextStyleEllipsisModal (OH_Drawing_TextStyle* , int  )
14581```
14582
14583**Description**
14584
14585Sets the ellipsis style for a text style.
14586
14587**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14588
14589**Since**: 11
14590
14591**Parameters**
14592
14593| Name                 | Description                                                  |
14594| -------------------- | ------------------------------------------------------------ |
14595| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14596| int                  | Ellipsis style. For details about the available options, see [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal). |
14597
14598
14599### OH_Drawing_SetTextStyleFontFamilies()
14600
14601```
14602void OH_Drawing_SetTextStyleFontFamilies (OH_Drawing_TextStyle* , int , const char* fontFamilies[] )
14603```
14604
14605**Description**
14606
14607Sets the font families for a text style.
14608
14609**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14610
14611**Since**: 8
14612
14613**Parameters**
14614
14615| Name                 | Description                                                  |
14616| -------------------- | ------------------------------------------------------------ |
14617| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14618| int                  | Number of font families. A negative number is not allowed.   |
14619| char*                | Pointer to the font families.                                |
14620
14621
14622### OH_Drawing_SetTextStyleFontHeight()
14623
14624```
14625void OH_Drawing_SetTextStyleFontHeight (OH_Drawing_TextStyle* , double  )
14626```
14627
14628**Description**
14629
14630Sets the line height based on the multiple of the font size.
14631
14632**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14633
14634**Since**: 8
14635
14636**Parameters**
14637
14638| Name                 | Description                                                  |
14639| -------------------- | ------------------------------------------------------------ |
14640| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14641| double               | Multiple of the font size.                                   |
14642
14643
14644### OH_Drawing_SetTextStyleFontSize()
14645
14646```
14647void OH_Drawing_SetTextStyleFontSize (OH_Drawing_TextStyle* , double  )
14648```
14649
14650**Description**
14651
14652Sets the font size for a text style.
14653
14654**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14655
14656**Since**: 8
14657
14658**Parameters**
14659
14660| Name                 | Description                                                  |
14661| -------------------- | ------------------------------------------------------------ |
14662| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14663| double               | Font size.                                                   |
14664
14665
14666### OH_Drawing_SetTextStyleFontStyle()
14667
14668```
14669void OH_Drawing_SetTextStyleFontStyle (OH_Drawing_TextStyle* , int)
14670```
14671
14672**Description**
14673
14674Sets the font style for a text style.
14675
14676**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14677
14678**Since**: 8
14679
14680**Parameters**
14681
14682| Name                 | Description                                                  |
14683| -------------------- | ------------------------------------------------------------ |
14684| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14685| int                  | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). |
14686
14687
14688### OH_Drawing_SetTextStyleFontStyleStruct()
14689
14690```
14691void OH_Drawing_SetTextStyleFontStyleStruct (OH_Drawing_TextStyle* drawingTextStyle, OH_Drawing_FontStyleStruct fontStyle )
14692```
14693
14694**Description**
14695
14696Sets the font style, including the font weight, width, and slant, for a text style.
14697
14698**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14699
14700**Since**: 12
14701
14702**Parameters**
14703
14704| Name                                                         | Description                                                  |
14705| ------------------------------------------------------------ | ------------------------------------------------------------ |
14706| OH_Drawing_TextStyle                                         | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14707| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant.     |
14708
14709
14710### OH_Drawing_SetTextStyleFontWeight()
14711
14712```
14713void OH_Drawing_SetTextStyleFontWeight (OH_Drawing_TextStyle* , int)
14714```
14715
14716**Description**
14717
14718Sets the font weight for a text style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.
14719
14720**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14721
14722**Since**: 8
14723
14724**Parameters**
14725
14726| Name                 | Description                                                  |
14727| -------------------- | ------------------------------------------------------------ |
14728| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14729| int                  | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). |
14730
14731
14732### OH_Drawing_SetTextStyleForegroundBrush()
14733
14734```
14735void OH_Drawing_SetTextStyleForegroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush*  )
14736```
14737
14738**Description**
14739
14740Sets the foreground brush for a text style.
14741
14742**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14743
14744**Since**: 12
14745
14746**Parameters**
14747
14748| Name                 | Description                                                  |
14749| -------------------- | ------------------------------------------------------------ |
14750| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14751| OH_Drawing_Brush     | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). |
14752
14753
14754### OH_Drawing_SetTextStyleForegroundPen()
14755
14756```
14757void OH_Drawing_SetTextStyleForegroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen*  )
14758```
14759
14760**Description**
14761
14762Sets the foreground pen for a text style.
14763
14764**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14765
14766**Since**: 12
14767
14768**Parameters**
14769
14770| Name                 | Description                                                  |
14771| -------------------- | ------------------------------------------------------------ |
14772| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14773| OH_Drawing_Pen       | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). |
14774
14775
14776### OH_Drawing_SetTextStyleHalfLeading()
14777
14778```
14779void OH_Drawing_SetTextStyleHalfLeading (OH_Drawing_TextStyle* , bool  )
14780```
14781
14782**Description**
14783
14784Sets whether to enable half leading for a text style.
14785
14786**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14787
14788**Since**: 11
14789
14790**Parameters**
14791
14792| Name                 | Description                                                  |
14793| -------------------- | ------------------------------------------------------------ |
14794| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14795| bool                 | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. |
14796
14797
14798### OH_Drawing_SetTextStyleLetterSpacing()
14799
14800```
14801void OH_Drawing_SetTextStyleLetterSpacing (OH_Drawing_TextStyle* , double  )
14802```
14803
14804**Description**
14805
14806Sets the letter spacing for a text style.
14807
14808**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14809
14810**Since**: 11
14811
14812**Parameters**
14813
14814| Name                 | Description                                                  |
14815| -------------------- | ------------------------------------------------------------ |
14816| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14817| double               | Letter spacing.                                              |
14818
14819
14820### OH_Drawing_SetTextStyleLocale()
14821
14822```
14823void OH_Drawing_SetTextStyleLocale (OH_Drawing_TextStyle* , const char*  )
14824```
14825
14826**Description**
14827
14828Sets the locale for a text style.
14829
14830**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14831
14832**Since**: 8
14833
14834**Parameters**
14835
14836| Name                 | Description                                                  |
14837| -------------------- | ------------------------------------------------------------ |
14838| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14839| char                 | Pointer to the locale. For example, **'en'** indicates English, **'zh-Hans'** indicates Simplified Chinese, and **'zh-Hant'** indicates Traditional Chinese. |
14840
14841
14842### OH_Drawing_SetTextStyleWordSpacing()
14843
14844```
14845void OH_Drawing_SetTextStyleWordSpacing (OH_Drawing_TextStyle* , double  )
14846```
14847
14848**Description**
14849
14850Sets the word spacing for a text style.
14851
14852**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14853
14854**Since**: 11
14855
14856**Parameters**
14857
14858| Name                 | Description                                                  |
14859| -------------------- | ------------------------------------------------------------ |
14860| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
14861| double               | Letter spacing.                                              |
14862
14863
14864### OH_Drawing_SetTypographyStyleFontStyleStruct()
14865
14866```
14867void OH_Drawing_SetTypographyStyleFontStyleStruct (OH_Drawing_TypographyStyle* drawingStyle, OH_Drawing_FontStyleStruct fontStyle )
14868```
14869
14870**Description**
14871
14872Sets the font style, including the font weight, width, and slant, for the default text style of a typography style.
14873
14874**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14875
14876**Since**: 12
14877
14878**Parameters**
14879
14880| Name                                                         | Description                                                  |
14881| ------------------------------------------------------------ | ------------------------------------------------------------ |
14882| OH_Drawing_TypographyStyle                                   | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14883| [OH_Drawing_FontStyleStruct](_o_h___drawing___font_style_struct.md) | Font style, including the font weight, width, and slant.     |
14884
14885
14886### OH_Drawing_SetTypographyStyleTextStrutStyle()
14887
14888```
14889void OH_Drawing_SetTypographyStyleTextStrutStyle (OH_Drawing_TypographyStyle* , OH_Drawing_StrutStyle*  )
14890```
14891
14892**Description**
14893
14894Sets the strut style for a typography style.
14895
14896**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14897
14898**Since**: 12
14899
14900**Parameters**
14901
14902| Name                                                     | Description                                                  |
14903| -------------------------------------------------------- | ------------------------------------------------------------ |
14904| OH_Drawing_TypographyStyle                               | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14905| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Pointer to an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object, which is obtained by calling [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle). |
14906
14907
14908### OH_Drawing_SetTypographyTextAlign()
14909
14910```
14911void OH_Drawing_SetTypographyTextAlign (OH_Drawing_TypographyStyle* , int  )
14912```
14913
14914**Description**
14915
14916Sets the text alignment mode.
14917
14918**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14919
14920**Since**: 8
14921
14922**Parameters**
14923
14924| Name                       | Description                                                  |
14925| -------------------------- | ------------------------------------------------------------ |
14926| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14927| int                        | Text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign). |
14928
14929
14930### OH_Drawing_SetTypographyTextBreakStrategy()
14931
14932```
14933void OH_Drawing_SetTypographyTextBreakStrategy (OH_Drawing_TypographyStyle* , int  )
14934```
14935
14936**Description**
14937
14938Sets the text break strategy.
14939
14940**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14941
14942**Since**: 11
14943
14944**Parameters**
14945
14946| Name                       | Description                                                  |
14947| -------------------------- | ------------------------------------------------------------ |
14948| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14949| int                        | Text break strategy. For details about the available options, see [OH_Drawing_BreakStrategy](#oh_drawing_breakstrategy). |
14950
14951
14952### OH_Drawing_SetTypographyTextDirection()
14953
14954```
14955void OH_Drawing_SetTypographyTextDirection (OH_Drawing_TypographyStyle* , int  )
14956```
14957
14958**Description**
14959
14960Sets the text direction in a typography style.
14961
14962**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14963
14964**Since**: 8
14965
14966**Parameters**
14967
14968| Name                       | Description                                                  |
14969| -------------------------- | ------------------------------------------------------------ |
14970| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14971| int                        | Text direction. For details about the available options, see [OH_Drawing_TextDirection](#oh_drawing_textdirection). |
14972
14973
14974### OH_Drawing_SetTypographyTextEllipsis()
14975
14976```
14977void OH_Drawing_SetTypographyTextEllipsis (OH_Drawing_TypographyStyle* style, const char* ellipsis )
14978```
14979
14980**Description**
14981
14982Sets the ellipsis text for a typography style.
14983
14984**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
14985
14986**Since**: 12
14987
14988**Parameters**
14989
14990| Name                       | Description                                                  |
14991| -------------------------- | ------------------------------------------------------------ |
14992| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
14993| char                       | Pinter to an ellipsis style.                                 |
14994
14995
14996### OH_Drawing_SetTypographyTextEllipsisModal()
14997
14998```
14999void OH_Drawing_SetTypographyTextEllipsisModal (OH_Drawing_TypographyStyle* , int)
15000```
15001
15002**Description**
15003
15004Sets the text ellipsis style for a typography style.
15005
15006**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15007
15008**Since**: 11
15009
15010**Parameters**
15011
15012| Name                       | Description                                                  |
15013| -------------------------- | ------------------------------------------------------------ |
15014| OH_Drawing_TypographyStyle | Pointer to an **OH_Drawing_TypographyStyle** object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15015| int                        | Ellipsis style. For details about the available options, see [OH_Drawing_EllipsisModal](#oh_drawing_ellipsismodal). |
15016
15017
15018### OH_Drawing_SetTypographyTextFontFamily()
15019
15020```
15021void OH_Drawing_SetTypographyTextFontFamily (OH_Drawing_TypographyStyle* , const char*  )
15022```
15023
15024**Description**
15025
15026Sets the font family name for text.
15027
15028**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15029
15030**Since**: 12
15031
15032**Parameters**
15033
15034| Name                       | Description                                                  |
15035| -------------------------- | ------------------------------------------------------------ |
15036| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15037| char                       | Pointer to the name of the font family.                      |
15038
15039
15040### OH_Drawing_SetTypographyTextFontHeight()
15041
15042```
15043void OH_Drawing_SetTypographyTextFontHeight (OH_Drawing_TypographyStyle* , double  )
15044```
15045
15046**Description**
15047
15048Sets the font height for text.
15049
15050**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15051
15052**Since**: 12
15053
15054**Parameters**
15055
15056| Name                       | Description                                                  |
15057| -------------------------- | ------------------------------------------------------------ |
15058| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15059| double                     | Font height.                                                 |
15060
15061
15062### OH_Drawing_SetTypographyTextFontSize()
15063
15064```
15065void OH_Drawing_SetTypographyTextFontSize (OH_Drawing_TypographyStyle* , double  )
15066```
15067
15068**Description**
15069
15070Sets the font size for text.
15071
15072**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15073
15074**Since**: 12
15075
15076**Parameters**
15077
15078| Name                       | Description                                                  |
15079| -------------------------- | ------------------------------------------------------------ |
15080| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15081| double                     | Font size, which must be greater than 0.                     |
15082
15083
15084### OH_Drawing_SetTypographyTextFontStyle()
15085
15086```
15087void OH_Drawing_SetTypographyTextFontStyle (OH_Drawing_TypographyStyle* , int)
15088```
15089
15090**Description**
15091
15092Sets the default font style for a typography style.
15093
15094**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15095
15096**Since**: 12
15097
15098**Parameters**
15099
15100| Name                       | Description                                                  |
15101| -------------------------- | ------------------------------------------------------------ |
15102| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15103| int                        | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). |
15104
15105
15106### OH_Drawing_SetTypographyTextFontWeight()
15107
15108```
15109void OH_Drawing_SetTypographyTextFontWeight (OH_Drawing_TypographyStyle* , int)
15110```
15111
15112**Description**
15113
15114Sets the default font weight for a typography style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.
15115
15116**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15117
15118**Since**: 12
15119
15120**Parameters**
15121
15122| Name                       | Description                                                  |
15123| -------------------------- | ------------------------------------------------------------ |
15124| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15125| int                        | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). |
15126
15127
15128### OH_Drawing_SetTypographyTextHalfLeading()
15129
15130```
15131void OH_Drawing_SetTypographyTextHalfLeading (OH_Drawing_TypographyStyle* , bool  )
15132```
15133
15134**Description**
15135
15136Sets whether to enable half leading for text.
15137
15138**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15139
15140**Since**: 12
15141
15142**Parameters**
15143
15144| Name                       | Description                                                  |
15145| -------------------------- | ------------------------------------------------------------ |
15146| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15147| bool                       | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. |
15148
15149
15150### OH_Drawing_SetTypographyTextLineStyleFontFamilies()
15151
15152```
15153void OH_Drawing_SetTypographyTextLineStyleFontFamilies (OH_Drawing_TypographyStyle* , int , const char* fontFamilies[] )
15154```
15155
15156**Description**
15157
15158Sets the font families for a text line style.
15159
15160**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15161
15162**Since**: 12
15163
15164**Parameters**
15165
15166| Name                       | Description                                                  |
15167| -------------------------- | ------------------------------------------------------------ |
15168| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15169| int                        | Number of font families.                                     |
15170| char                       | Pointer to the font families.                                |
15171
15172
15173### OH_Drawing_SetTypographyTextLineStyleFontHeight()
15174
15175```
15176void OH_Drawing_SetTypographyTextLineStyleFontHeight (OH_Drawing_TypographyStyle* , double  )
15177```
15178
15179**Description**
15180
15181Sets the font height for a text line style.
15182
15183**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15184
15185**Since**: 12
15186
15187**Parameters**
15188
15189| Name                       | Description                                                  |
15190| -------------------------- | ------------------------------------------------------------ |
15191| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15192| double                     | Font height.                                                 |
15193
15194
15195### OH_Drawing_SetTypographyTextLineStyleFontSize()
15196
15197```
15198void OH_Drawing_SetTypographyTextLineStyleFontSize (OH_Drawing_TypographyStyle* , double  )
15199```
15200
15201**Description**
15202
15203Sets the font size for a text line style.
15204
15205**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15206
15207**Since**: 12
15208
15209**Parameters**
15210
15211| Name                       | Description                                                  |
15212| -------------------------- | ------------------------------------------------------------ |
15213| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15214| double                     | Font size, which must be greater than 0.                     |
15215
15216
15217### OH_Drawing_SetTypographyTextLineStyleFontStyle()
15218
15219```
15220void OH_Drawing_SetTypographyTextLineStyleFontStyle (OH_Drawing_TypographyStyle* , int  )
15221```
15222
15223**Description**
15224
15225Sets the font style of the strut style in a typography style.
15226
15227**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15228
15229**Since**: 12
15230
15231**Parameters**
15232
15233| Name                       | Description                                                  |
15234| -------------------------- | ------------------------------------------------------------ |
15235| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15236| int                        | Font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle). |
15237
15238
15239### OH_Drawing_SetTypographyTextLineStyleFontWeight()
15240
15241```
15242void OH_Drawing_SetTypographyTextLineStyleFontWeight (OH_Drawing_TypographyStyle* , int)
15243```
15244
15245**Description**
15246
15247Sets the text font weight of the strut style in a typography style. Currently, only the default system font supports font weight adjustment. For other fonts, if the weight is less than semi-bold, there is no variation in stroke thickness. If the weight is greater than or equal to semi-bold, it might result in a fake bold effect.
15248
15249**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15250
15251**Since**: 12
15252
15253**Parameters**
15254
15255| Name                       | Description                                                  |
15256| -------------------------- | ------------------------------------------------------------ |
15257| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15258| int                        | Font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight). |
15259
15260
15261### OH_Drawing_SetTypographyTextLineStyleHalfLeading()
15262
15263```
15264void OH_Drawing_SetTypographyTextLineStyleHalfLeading (OH_Drawing_TypographyStyle* , bool  )
15265```
15266
15267**Description**
15268
15269Sets whether to enable half leading for the strut style in a typography style.
15270
15271**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15272
15273**Since**: 12
15274
15275**Parameters**
15276
15277| Name                       | Description                                                  |
15278| -------------------------- | ------------------------------------------------------------ |
15279| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15280| bool                       | Whether to enable half leading. The value **true** means to enable half lading, and **false** means the opposite. |
15281
15282
15283### OH_Drawing_SetTypographyTextLineStyleOnly()
15284
15285```
15286void OH_Drawing_SetTypographyTextLineStyleOnly (OH_Drawing_TypographyStyle* , bool  )
15287```
15288
15289**Description**
15290
15291Sets whether to enable the text line style only.
15292
15293**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15294
15295**Since**: 12
15296
15297**Parameters**
15298
15299| Name                       | Description                                                  |
15300| -------------------------- | ------------------------------------------------------------ |
15301| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15302| bool                       | Whether to enable the text line style only. The value **true** means to enable the text line style only, and **false** means the opposite. |
15303
15304
15305### OH_Drawing_SetTypographyTextLineStyleSpacingScale()
15306
15307```
15308void OH_Drawing_SetTypographyTextLineStyleSpacingScale (OH_Drawing_TypographyStyle* , double  )
15309```
15310
15311**Description**
15312
15313Sets the spacing ratio of the text line style.
15314
15315**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15316
15317**Since**: 12
15318
15319**Parameters**
15320
15321| Name                       | Description                                                  |
15322| -------------------------- | ------------------------------------------------------------ |
15323| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15324| double                     | Spacing ratio.                                               |
15325
15326
15327### OH_Drawing_SetTypographyTextLocale()
15328
15329```
15330void OH_Drawing_SetTypographyTextLocale (OH_Drawing_TypographyStyle* style, const char* locale )
15331```
15332
15333**Description**
15334
15335Sets the locale for a typography style.
15336
15337**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15338
15339**Since**: 12
15340
15341**Parameters**
15342
15343| Name                       | Description                                                  |
15344| -------------------------- | ------------------------------------------------------------ |
15345| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15346| char                       | Pointer to the locale. For example, **'en'** indicates English, **'zh-Hans'** indicates Simplified Chinese, and **'zh-Hant'** indicates Traditional Chinese. |
15347
15348
15349### OH_Drawing_SetTypographyTextMaxLines()
15350
15351```
15352void OH_Drawing_SetTypographyTextMaxLines (OH_Drawing_TypographyStyle* , int  )
15353```
15354
15355**Description**
15356
15357Sets the maximum number of lines in the text.
15358
15359**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15360
15361**Since**: 8
15362
15363**Parameters**
15364
15365| Name                       | Description                                                  |
15366| -------------------------- | ------------------------------------------------------------ |
15367| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15368| int                        | Maximum number of lines.                                     |
15369
15370### OH_Drawing_SetTypographyTextSplitRatio()
15371
15372```
15373void OH_Drawing_SetTypographyTextSplitRatio (OH_Drawing_TypographyStyle* style, float textSplitRatio )
15374```
15375
15376**Description**
15377
15378Sets the text split ratio.
15379
15380**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15381
15382**Since**: 12
15383
15384**Parameters**
15385
15386| Name                       | Description                                                  |
15387| -------------------------- | ------------------------------------------------------------ |
15388| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15389| float                      | Text split ratio.                                            |
15390
15391
15392### OH_Drawing_SetTypographyTextStyle()
15393
15394```
15395void OH_Drawing_SetTypographyTextStyle (OH_Drawing_TypographyStyle* , OH_Drawing_TextStyle*  )
15396```
15397
15398**Description**
15399
15400Sets a text style.
15401
15402**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15403
15404**Since**: 12
15405
15406**Parameters**
15407
15408| Name                       | Description                                                  |
15409| -------------------------- | ------------------------------------------------------------ |
15410| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15411| OH_Drawing_TextStyle       | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
15412
15413
15414### OH_Drawing_SetTypographyTextUseLineStyle()
15415
15416```
15417void OH_Drawing_SetTypographyTextUseLineStyle (OH_Drawing_TypographyStyle* , bool  )
15418```
15419
15420**Description**
15421
15422Sets whether to enable the text line style.
15423
15424**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15425
15426**Since**: 12
15427
15428**Parameters**
15429
15430| Name                       | Description                                                  |
15431| -------------------------- | ------------------------------------------------------------ |
15432| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15433| bool                       | Whether to enable the line style. The value **true** means to enable the line style, and **false** means the opposite. |
15434
15435
15436### OH_Drawing_SetTypographyTextWordBreakType()
15437
15438```
15439void OH_Drawing_SetTypographyTextWordBreakType (OH_Drawing_TypographyStyle* , int  )
15440```
15441
15442**Description**
15443
15444Sets the word break type.
15445
15446**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15447
15448**Since**: 11
15449
15450**Parameters**
15451
15452| Name                       | Description                                                  |
15453| -------------------------- | ------------------------------------------------------------ |
15454| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
15455| int                        | Word break type. For details about the available options, see [OH_Drawing_WordBreakType](#oh_drawing_wordbreaktype). |
15456
15457
15458### OH_Drawing_ShaderEffectCreateImageShader()
15459
15460```
15461OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateImageShader (OH_Drawing_Image* , OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions* , const OH_Drawing_Matrix*  )
15462```
15463
15464**Description**
15465
15466Creates an **OH_Drawing_ShaderEffect** object for an image shader. You are advised not to use the API for the canvas of the capture type because it affects the performance.
15467
15468Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15469
15470If either **OH_Drawing_Image** or **OH_Drawing_SamplingOptions** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15471
15472If either **tileX** or **tileY** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15473
15474**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15475
15476**Since**: 12
15477
15478**Parameters**
15479
15480| Name                       | Description                                                  |
15481| -------------------------- | ------------------------------------------------------------ |
15482| OH_Drawing_Image           | Pointer to an [OH_Drawing_Image](#oh_drawing_image) object.  |
15483| tileX                      | Tile mode of the shader effect in the horizontal direction. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). |
15484| tileY                      | Tile mode of the shader effect in the vertical direction. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). |
15485| OH_Drawing_SamplingOptions | Pointer to an [OH_Drawing_SamplingOptions](#oh_drawing_samplingoptions) object. |
15486| OH_Drawing_Matrix          | Pointer to an [OH_Drawing_Matrix](#oh_drawing_matrix) object. If the pointer array is empty, the identity matrix is passed in. |
15487
15488**Returns**
15489
15490Returns the pointer to the **OH_Drawing_ShaderEffect** object created.
15491
15492
15493### OH_Drawing_ShaderEffectCreateLinearGradient()
15494
15495```
15496OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateLinearGradient (const OH_Drawing_Point* startPt, const OH_Drawing_Point* endPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode  )
15497```
15498
15499**Description**
15500
15501Creates an **OH_Drawing_ShaderEffect** object that generates a linear gradient between two points.
15502
15503Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15504
15505If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15506
15507If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15508
15509**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15510
15511**Since**: 11
15512
15513**Parameters**
15514
15515| Name                | Description                                                  |
15516| ------------------- | ------------------------------------------------------------ |
15517| startPt             | Start point.                                                 |
15518| endPt               | End point.                                                   |
15519| colors              | Colors to distribute.                                        |
15520| pos                 | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start point and end point. |
15521| size                | Number of colors and positions (if **pos** is not NULL).     |
15522| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). |
15523
15524**Returns**
15525
15526Returns the pointer to the **OH_Drawing_ShaderEffect** object created.
15527
15528
15529### OH_Drawing_ShaderEffectCreateRadialGradient()
15530
15531```
15532OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateRadialGradient (const OH_Drawing_Point* centerPt, float radius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode  )
15533```
15534
15535**Description**
15536
15537Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius of a circle. The radial gradient transitions colors from the center to the ending shape in a radial manner.
15538
15539Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15540
15541If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15542
15543If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15544
15545**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15546
15547**Since**: 11
15548
15549**Parameters**
15550
15551| Name                | Description                                                  |
15552| ------------------- | ------------------------------------------------------------ |
15553| centerPt            | Center of the circle.                                        |
15554| radius              | Circle radius of the gradient. The value should be a non-negative number. |
15555| colors              | Colors to distribute in the radial direction.                |
15556| pos                 | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed in the radial direction. |
15557| size                | Number of colors and positions (if **pos** is not NULL).     |
15558| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). |
15559
15560**Returns**
15561
15562Returns the pointer to the **OH_Drawing_ShaderEffect** object created.
15563
15564
15565### OH_Drawing_ShaderEffectCreateSweepGradient()
15566
15567```
15568OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateSweepGradient (const OH_Drawing_Point* centerPt, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode  )
15569```
15570
15571**Description**
15572
15573Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the center. A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°.
15574
15575Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15576
15577If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15578
15579If **OH_Drawing_TileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15580
15581**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15582
15583**Since**: 11
15584
15585**Parameters**
15586
15587| Name                | Description                                                  |
15588| ------------------- | ------------------------------------------------------------ |
15589| centerPt            | Center of the circle.                                        |
15590| colors              | Colors to distribute.                                        |
15591| pos                 | Relative position of each color in the color array. If **pos** is NULL, colors are evenly distributed between the start angle (0°) and end angle (360°). |
15592| size                | Number of colors and positions (if **pos** is not NULL).     |
15593| OH_Drawing_TileMode | Tile mode of the shader effect. For details about the available options, see [OH_Drawing_TileMode](#oh_drawing_tilemode-1). |
15594
15595**Returns**
15596
15597Returns the pointer to the **OH_Drawing_ShaderEffect** object created.
15598
15599
15600### OH_Drawing_ShaderEffectDestroy()
15601
15602```
15603void OH_Drawing_ShaderEffectDestroy (OH_Drawing_ShaderEffect* )
15604```
15605
15606**Description**
15607
15608Destroys an **OH_Drawing_ShaderEffect** object and reclaims the memory occupied by the object.
15609
15610**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15611
15612**Since**: 11
15613
15614**Parameters**
15615
15616| Name                    | Description                                       |
15617| ----------------------- | ------------------------------------------------- |
15618| OH_Drawing_ShaderEffect | Pointer to an **OH_Drawing_ShaderEffect** object. |
15619
15620
15621### OH_Drawing_SurfaceCreateFromGpuContext()
15622
15623```
15624OH_Drawing_Surface* OH_Drawing_SurfaceCreateFromGpuContext (OH_Drawing_GpuContext* , bool budgeted, OH_Drawing_Image_Info  )
15625```
15626
15627**Description**
15628
15629Creates an **OH_Drawing_Surface** object using the GPU context to manage the content drawn on the canvas.
15630
15631Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15632
15633If **OH_Drawing_GpuContext** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15634
15635**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15636
15637**Since**: 12
15638
15639**Parameters**
15640
15641| Name                                                      | Description                                                  |
15642| --------------------------------------------------------- | ------------------------------------------------------------ |
15643| OH_Drawing_GpuContext                                     | Pointer to an [OH_Drawing_GpuContext](#oh_drawing_gpucontext) object. |
15644| budgeted                                                  | Whether memory allocation is included in the cache budget. The value **true** means that memory allocation is included in the cache budget, and **false** means the opposite. |
15645| [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) | [OH_Drawing_Image_Info](_o_h___drawing___image___info.md) object. |
15646
15647**Returns**
15648
15649Returns the pointer to the [OH_Drawing_Surface](#oh_drawing_surface) object created.
15650
15651
15652### OH_Drawing_SurfaceDestroy()
15653
15654```
15655void OH_Drawing_SurfaceDestroy (OH_Drawing_Surface* )
15656```
15657
15658**Description**
15659
15660Destroys an **OH_Drawing_Surface** object and reclaims the memory occupied.
15661
15662**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15663
15664**Since**: 12
15665
15666**Parameters**
15667
15668| Name               | Description                                  |
15669| ------------------ | -------------------------------------------- |
15670| OH_Drawing_Surface | Pointer to an **OH_Drawing_Surface** object. |
15671
15672
15673### OH_Drawing_SurfaceGetCanvas()
15674
15675```
15676OH_Drawing_Canvas* OH_Drawing_SurfaceGetCanvas (OH_Drawing_Surface* )
15677```
15678
15679**Description**
15680
15681Obtains a canvas from an **OH_Drawing_Surface** object.
15682
15683Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15684
15685If **OH_Drawing_Surface** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15686
15687**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15688
15689**Since**: 12
15690
15691**Parameters**
15692
15693| Name               | Description                                  |
15694| ------------------ | -------------------------------------------- |
15695| OH_Drawing_Surface | Pointer to an **OH_Drawing_Surface** object. |
15696
15697**Returns**
15698
15699Returns the pointer to the [OH_Drawing_Canvas](#oh_drawing_canvas) object created. The pointer returned does not need to be managed by the caller.
15700
15701
15702### OH_Drawing_TextBlobBuilderAllocRunPos()
15703
15704```
15705const OH_Drawing_RunBuffer* OH_Drawing_TextBlobBuilderAllocRunPos (OH_Drawing_TextBlobBuilder* , const OH_Drawing_Font* , int32_t count, const OH_Drawing_Rect*  )
15706```
15707
15708**Description**
15709
15710Allocates a run to store glyphs and positions. The pointer returned does not need to be managed by the caller. It can no longer be used after [OH_Drawing_TextBlobBuilderMake](#oh_drawing_textblobbuildermake) is called.
15711
15712Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15713
15714If either **OH_Drawing_TextBlobBuilder** or **OH_Drawing_Font** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15715
15716**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15717
15718**Since**: 11
15719
15720**Parameters**
15721
15722| Name                       | Description                                                  |
15723| -------------------------- | ------------------------------------------------------------ |
15724| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object.         |
15725| OH_Drawing_Font            | Pointer to an **OH_Drawing_Font** object.                    |
15726| count                      | Number of text blobs.                                        |
15727| OH_Drawing_Rect            | Rectangle of the text blob. The value NULL means that no rectangle is set. |
15728
15729
15730### OH_Drawing_TextBlobBuilderCreate()
15731
15732```
15733OH_Drawing_TextBlobBuilder* OH_Drawing_TextBlobBuilderCreate (void )
15734```
15735
15736**Description**
15737
15738Creates an **OH_Drawing_TextBlobBuilder** object.
15739
15740**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15741
15742**Since**: 11
15743
15744**Returns**
15745
15746Returns the pointer to the **OH_Drawing_TextBlobBuilder** object created.
15747
15748
15749### OH_Drawing_TextBlobBuilderDestroy()
15750
15751```
15752void OH_Drawing_TextBlobBuilderDestroy (OH_Drawing_TextBlobBuilder* )
15753```
15754
15755**Description**
15756
15757Destroys an **OH_Drawing_TextBlobBuilder** object and reclaims the memory occupied by the object.
15758
15759**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15760
15761**Since**: 11
15762
15763**Parameters**
15764
15765| Name                       | Description                                          |
15766| -------------------------- | ---------------------------------------------------- |
15767| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object. |
15768
15769
15770### OH_Drawing_TextBlobBuilderMake()
15771
15772```
15773OH_Drawing_TextBlob* OH_Drawing_TextBlobBuilderMake (OH_Drawing_TextBlobBuilder* )
15774```
15775
15776**Description**
15777
15778Makes an **OH_Drawing_TextBlob** object from an **OH_Drawing_TextBlobBuilder**.
15779
15780Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15781
15782If **OH_Drawing_TextBlobBuilder** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15783
15784**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15785
15786**Since**: 11
15787
15788**Parameters**
15789
15790| Name                       | Description                                          |
15791| -------------------------- | ---------------------------------------------------- |
15792| OH_Drawing_TextBlobBuilder | Pointer to an **OH_Drawing_TextBlobBuilder** object. |
15793
15794**Returns**
15795
15796Returns the pointer to the **OH_Drawing_TextBlob** object created.
15797
15798
15799### OH_Drawing_TextBlobCreateFromPosText()
15800
15801```
15802OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromPosText (const void * text, size_t byteLength, OH_Drawing_Point2D* , const OH_Drawing_Font* , OH_Drawing_TextEncoding  )
15803```
15804
15805**Description**
15806
15807Creates an **OH_Drawing_TextBlob** object from the text. The coordinates of each character in the **OH_Drawing_TextBlob** object are determined by the coordinate information in the **OH_Drawing_Point2D** array.
15808
15809Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15810
15811If any of **text**, **OH_Drawing_Point2D**, and **OH_Drawing_Font** is NULL or **byteLength** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15812
15813If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15814
15815**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15816
15817**Since**: 12
15818
15819**Parameters**
15820
15821| Name                                               | Description                                                  |
15822| -------------------------------------------------- | ------------------------------------------------------------ |
15823| text                                               | Pointer to the text.                                         |
15824| byteLength                                         | Length of the text, in bytes.                                |
15825| [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) | Pointer to the start address of an [OH_Drawing_Point2D](_o_h___drawing___point2_d.md) array. The number of entries in the array is the value obtained by calling [OH_Drawing_FontCountText](#oh_drawing_fontcounttext). |
15826| OH_Drawing_Font                                    | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.    |
15827| OH_Drawing_TextEncoding                            | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). |
15828
15829**Returns**
15830
15831Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created.
15832
15833
15834### OH_Drawing_TextBlobCreateFromString()
15835
15836```
15837OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromString (const char* str, const OH_Drawing_Font* , OH_Drawing_TextEncoding  )
15838```
15839
15840**Description**
15841
15842Creates an **OH_Drawing_TextBlob** object from a string.
15843
15844Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15845
15846If either **str** or **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15847
15848If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15849
15850**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15851
15852**Since**: 12
15853
15854**Parameters**
15855
15856| Name                    | Description                                                  |
15857| ----------------------- | ------------------------------------------------------------ |
15858| str                     | Pointer to a string.                                         |
15859| OH_Drawing_Font         | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.    |
15860| OH_Drawing_TextEncoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). Currently, only **TEXT_ENCODING_UTF8** takes effect, and other encoding types are treated as **TEXT_ENCODING_UTF8**. |
15861
15862**Returns**
15863
15864Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created.
15865
15866
15867### OH_Drawing_TextBlobCreateFromText()
15868
15869```
15870OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText (const void * text, size_t byteLength, const OH_Drawing_Font* , OH_Drawing_TextEncoding  )
15871```
15872
15873**Description**
15874
15875Creates an **OH_Drawing_TextBlob** object from the text.
15876
15877Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15878
15879If either **text** or **OH_Drawing_Font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15880
15881If **OH_Drawing_TextEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.
15882
15883**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15884
15885**Since**: 12
15886
15887**Parameters**
15888
15889| Name                    | Description                                                  |
15890| ----------------------- | ------------------------------------------------------------ |
15891| text                    | Pointer to the text.                                         |
15892| byteLength              | Length of the text, in bytes.                                |
15893| OH_Drawing_Font         | Pointer to an [OH_Drawing_Font](#oh_drawing_font) object.    |
15894| OH_Drawing_TextEncoding | Encoding type of the text. For details about the available options, see [OH_Drawing_TextEncoding](#oh_drawing_textencoding). |
15895
15896**Returns**
15897
15898Returns the pointer to the [OH_Drawing_TextBlob](#oh_drawing_textblob) object created.
15899
15900
15901### OH_Drawing_TextBlobDestroy()
15902
15903```
15904void OH_Drawing_TextBlobDestroy (OH_Drawing_TextBlob* )
15905```
15906
15907**Description**
15908
15909Destroys an **OH_Drawing_TextBlob** object and reclaims the memory occupied by the object.
15910
15911**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15912
15913**Since**: 11
15914
15915**Parameters**
15916
15917| Name                | Description                                   |
15918| ------------------- | --------------------------------------------- |
15919| OH_Drawing_TextBlob | Pointer to an **OH_Drawing_TextBlob** object. |
15920
15921
15922### OH_Drawing_TextBlobGetBounds()
15923
15924```
15925void OH_Drawing_TextBlobGetBounds (OH_Drawing_TextBlob* , OH_Drawing_Rect*  )
15926```
15927
15928**Description**
15929
15930Obtains the bounds of an **OH_Drawing_TextBlob** object.
15931
15932Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
15933
15934If either **OH_Drawing_TextBlob** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
15935
15936**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15937
15938**Since**: 12
15939
15940**Parameters**
15941
15942| Name                | Description                                                  |
15943| ------------------- | ------------------------------------------------------------ |
15944| OH_Drawing_TextBlob | Pointer to an [OH_Drawing_TextBlob](#oh_drawing_textblob) object. |
15945| OH_Drawing_Rect     | Pointer to an [OH_Drawing_Rect](#oh_drawing_rect) object, which is obtained by calling [OH_Drawing_RectCreate](#oh_drawing_rectcreate). |
15946
15947
15948### OH_Drawing_TextStyleAddFontFeature()
15949
15950```
15951void OH_Drawing_TextStyleAddFontFeature (OH_Drawing_TextStyle* , const char* tag, int value )
15952```
15953
15954**Description**
15955
15956Adds a font feature for a text style.
15957
15958**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15959
15960**Since**: 12
15961
15962**Parameters**
15963
15964| Name                 | Description                                                  |
15965| -------------------- | ------------------------------------------------------------ |
15966| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
15967| char                 | Pointer to the string identified by the keyword in the font feature key-value pair. |
15968| int                  | Value of the font feature key-value pair.                    |
15969
15970
15971### OH_Drawing_TextStyleAddFontVariation()
15972
15973```
15974void OH_Drawing_TextStyleAddFontVariation (OH_Drawing_TextStyle* , const char* , const float  )
15975```
15976
15977**Description**
15978
15979Adds a font variation. This function takes effect only when the corresponding font file (.ttf file) supports variable adjustment. Otherwise, calling this function does not take effect.
15980
15981**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
15982
15983**Since**: 12
15984
15985**Parameters**
15986
15987| Name                 | Description                                                  |
15988| -------------------- | ------------------------------------------------------------ |
15989| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
15990| char\*               | Pointer to the key in the font variation key-value pair. Currently, only **'wght'** is supported, indicating the font weight. |
15991| float                | Value of the font variation key-value pair. Currently, the value range of **'wght'** for the default font is \[0,900\]. |
15992
15993
15994### OH_Drawing_TextStyleAddShadow()
15995
15996```
15997void OH_Drawing_TextStyleAddShadow (OH_Drawing_TextStyle* , const OH_Drawing_TextShadow*  )
15998```
15999
16000**Description**
16001
16002Adds a shadow to a text shadow container.
16003
16004**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16005
16006**Since**: 12
16007
16008**Parameters**
16009
16010| Name                  | Description                                                  |
16011| --------------------- | ------------------------------------------------------------ |
16012| OH_Drawing_TextStyle  | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16013| OH_Drawing_TextShadow | Pointer to an [OH_Drawing_TextShadow](#oh_drawing_textshadow) object, which is obtained by calling [OH_Drawing_CreateTextShadow](#oh_drawing_createtextshadow). |
16014
16015
16016### OH_Drawing_TextStyleClearFontFeature()
16017
16018```
16019void OH_Drawing_TextStyleClearFontFeature (OH_Drawing_TextStyle* )
16020```
16021
16022**Description**
16023
16024Clears all the contents in a font feature map container of a text style.
16025
16026**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16027
16028**Since**: 12
16029
16030**Parameters**
16031
16032| Name                 | Description                                                  |
16033| -------------------- | ------------------------------------------------------------ |
16034| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16035
16036
16037### OH_Drawing_TextStyleClearShadows()
16038
16039```
16040void OH_Drawing_TextStyleClearShadows (OH_Drawing_TextStyle* )
16041```
16042
16043**Description**
16044
16045Clears all shadows in a text shadow container.
16046
16047**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16048
16049**Since**: 12
16050
16051**Parameters**
16052
16053| Name                 | Description                                                  |
16054| -------------------- | ------------------------------------------------------------ |
16055| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16056
16057
16058### OH_Drawing_TextStyleDestroyFontFamilies()
16059
16060```
16061void OH_Drawing_TextStyleDestroyFontFamilies (char** fontFamilies, size_t num)
16062```
16063
16064**Description**
16065
16066Reclaims the memory occupied by the font families, where **num** specifies the number of font families.
16067
16068**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16069
16070**Since**: 12
16071
16072**Parameters**
16073
16074| Name         | Description                          |
16075| ------------ | ------------------------------------ |
16076| fontFamilies | Double pointer to the font families. |
16077| num          | Number of font families.             |
16078
16079
16080### OH_Drawing_TextStyleDestroyFontFeatures()
16081
16082```
16083void OH_Drawing_TextStyleDestroyFontFeatures (OH_Drawing_FontFeature* , size_t fontFeatureSize )
16084```
16085
16086**Description**
16087
16088Reclaims the memory occupied by the struct array that holds all the font features.
16089
16090**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16091
16092**Since**: 12
16093
16094**Parameters**
16095
16096| Name                                                       | Description                                                  |
16097| ---------------------------------------------------------- | ------------------------------------------------------------ |
16098| [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) | Pointer to the struct array that holds all the font features. The pointer is obtained by calling [OH_Drawing_TextStyleGetFontFeatures](#oh_drawing_textstylegetfontfeatures). |
16099| fontFeatureSize                                            | Size of the struct array that holds all the font features.   |
16100
16101
16102### OH_Drawing_TextStyleGetBackgroundBrush()
16103
16104```
16105void OH_Drawing_TextStyleGetBackgroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush*  )
16106```
16107
16108**Description**
16109
16110Obtains the background brush.
16111
16112**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16113
16114**Since**: 12
16115
16116**Parameters**
16117
16118| Name                 | Description                                                  |
16119| -------------------- | ------------------------------------------------------------ |
16120| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16121| OH_Drawing_Brush     | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). |
16122
16123
16124### OH_Drawing_TextStyleGetBackgroundPen()
16125
16126```
16127void OH_Drawing_TextStyleGetBackgroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen*  )
16128```
16129
16130**Description**
16131
16132Obtains the background pen.
16133
16134**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16135
16136**Since**: 12
16137
16138**Parameters**
16139
16140| Name                 | Description                                                  |
16141| -------------------- | ------------------------------------------------------------ |
16142| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16143| OH_Drawing_Pen       | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). |
16144
16145
16146### OH_Drawing_TextStyleGetBaseline()
16147
16148```
16149OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline (OH_Drawing_TextStyle* )
16150```
16151
16152**Description**
16153
16154Obtains the baseline of a text style.
16155
16156**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16157
16158**Since**: 12
16159
16160**Parameters**
16161
16162| Name                 | Description                                                  |
16163| -------------------- | ------------------------------------------------------------ |
16164| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16165
16166**Returns**
16167
16168Returns the text baseline. For details about the available options, see [OH_Drawing_TextBaseline](#oh_drawing_textbaseline).
16169
16170
16171### OH_Drawing_TextStyleGetBaselineShift()
16172
16173```
16174double OH_Drawing_TextStyleGetBaselineShift (OH_Drawing_TextStyle*)
16175```
16176
16177**Description**
16178
16179Obtains the baseline drift of a text style.
16180
16181**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16182
16183**Since**: 12
16184
16185**Parameters**
16186
16187| Name                 | Description                                                  |
16188| -------------------- | ------------------------------------------------------------ |
16189| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16190
16191**Returns**
16192
16193Returns the baseline drift.
16194
16195
16196### OH_Drawing_TextStyleGetColor()
16197
16198```
16199uint32_t OH_Drawing_TextStyleGetColor (OH_Drawing_TextStyle* )
16200```
16201
16202**Description**
16203
16204Obtains the color of a text style.
16205
16206**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16207
16208**Since**: 12
16209
16210**Parameters**
16211
16212| Name                 | Description                                                  |
16213| -------------------- | ------------------------------------------------------------ |
16214| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16215
16216**Returns**
16217
16218Returns the text color.
16219
16220
16221### OH_Drawing_TextStyleGetDecorationStyle()
16222
16223```
16224OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle (OH_Drawing_TextStyle* )
16225```
16226
16227**Description**
16228
16229Obtains the decoration style of a text style.
16230
16231**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16232
16233**Since**: 12
16234
16235**Parameters**
16236
16237| Name                 | Description                                                  |
16238| -------------------- | ------------------------------------------------------------ |
16239| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16240
16241**Returns**
16242
16243Returns the text decoration style. For details about the available options, see [OH_Drawing_TextDecorationStyle](#oh_drawing_textdecorationstyle).
16244
16245
16246### OH_Drawing_TextStyleGetFontFamilies()
16247
16248```
16249char** OH_Drawing_TextStyleGetFontFamilies (OH_Drawing_TextStyle* , size_t* num )
16250```
16251
16252**Description**
16253
16254Obtains the font families of a text style.
16255
16256**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16257
16258**Since**: 12
16259
16260**Parameters**
16261
16262| Name                 | Description                                                  |
16263| -------------------- | ------------------------------------------------------------ |
16264| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16265| num                  | Pointer to the number of font families.                      |
16266
16267**Returns**
16268
16269Returns the font families.
16270
16271
16272### OH_Drawing_TextStyleGetFontFeatures()
16273
16274```
16275OH_Drawing_FontFeature* OH_Drawing_TextStyleGetFontFeatures (OH_Drawing_TextStyle* )
16276```
16277
16278**Description**
16279
16280Obtains all the contents in a font feature map container of a text style.
16281
16282**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16283
16284**Since**: 12
16285
16286**Parameters**
16287
16288| Name                 | Description                                                  |
16289| -------------------- | ------------------------------------------------------------ |
16290| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16291
16292**Returns**
16293
16294Returns the pointer to the [OH_Drawing_FontFeature](_o_h___drawing___font_feature.md) struct, which stores all the contents obtained.
16295
16296
16297### OH_Drawing_TextStyleGetFontFeatureSize()
16298
16299```
16300size_t OH_Drawing_TextStyleGetFontFeatureSize (OH_Drawing_TextStyle* )
16301```
16302
16303**Description**
16304
16305Obtains the size of a font feature map container in a text style.
16306
16307**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16308
16309**Since**: 12
16310
16311**Parameters**
16312
16313| Name                 | Description                                                  |
16314| -------------------- | ------------------------------------------------------------ |
16315| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16316
16317**Returns**
16318
16319Returns the size.
16320
16321
16322### OH_Drawing_TextStyleGetFontHeight()
16323
16324```
16325double OH_Drawing_TextStyleGetFontHeight (OH_Drawing_TextStyle* )
16326```
16327
16328**Description**
16329
16330Obtains the font height of a text style.
16331
16332**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16333
16334**Since**: 12
16335
16336**Parameters**
16337
16338| Name                 | Description                                                  |
16339| -------------------- | ------------------------------------------------------------ |
16340| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16341
16342**Returns**
16343
16344Returns the font height.
16345
16346
16347### OH_Drawing_TextStyleGetFontMetrics()
16348
16349```
16350bool OH_Drawing_TextStyleGetFontMetrics (OH_Drawing_Typography* , OH_Drawing_TextStyle* , OH_Drawing_Font_Metrics*  )
16351```
16352
16353**Description**
16354
16355Obtains the font metrics.
16356
16357**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16358
16359**Since**: 12
16360
16361**Parameters**
16362
16363| Name                    | Description                                                  |
16364| ----------------------- | ------------------------------------------------------------ |
16365| OH_Drawing_Typography   | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
16366| OH_Drawing_TextStyle    | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16367| OH_Drawing_Font_Metrics | Pointer to an [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) object, which is obtained by calling [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md). |
16368
16369**Returns**
16370
16371Returns **true** if the font metrics are obtained; returns **false** otherwise.
16372
16373
16374### OH_Drawing_TextStyleGetFontSize()
16375
16376```
16377double OH_Drawing_TextStyleGetFontSize (OH_Drawing_TextStyle*)
16378```
16379
16380**Description**
16381
16382Obtains the font size of a text style.
16383
16384**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16385
16386**Since**: 12
16387
16388**Parameters**
16389
16390| Name                 | Description                                                  |
16391| -------------------- | ------------------------------------------------------------ |
16392| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16393
16394**Returns**
16395
16396Returns the font size.
16397
16398
16399### OH_Drawing_TextStyleGetFontStyle()
16400
16401```
16402OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle (OH_Drawing_TextStyle* )
16403```
16404
16405**Description**
16406
16407Obtains the font style of a text style.
16408
16409**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16410
16411**Since**: 12
16412
16413**Parameters**
16414
16415| Name                 | Description                                                  |
16416| -------------------- | ------------------------------------------------------------ |
16417| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16418
16419**Returns**
16420
16421Returns the font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle).
16422
16423
16424### OH_Drawing_TextStyleGetFontStyleStruct()
16425
16426```
16427OH_Drawing_FontStyleStruct OH_Drawing_TextStyleGetFontStyleStruct (OH_Drawing_TextStyle* drawingTextStyle)
16428```
16429
16430**Description**
16431
16432Obtains the font style, including the font weight, width, and slant, of a text style.
16433
16434**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16435
16436**Since**: 12
16437
16438**Parameters**
16439
16440| Name                 | Description                                                  |
16441| -------------------- | ------------------------------------------------------------ |
16442| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16443
16444**Returns**
16445
16446Returns the font style, including the font weight, width, and slant.
16447
16448
16449### OH_Drawing_TextStyleGetFontWeight()
16450
16451```
16452OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight (OH_Drawing_TextStyle*)
16453```
16454
16455**Description**
16456
16457Obtains the font weight of a text style.
16458
16459**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16460
16461**Since**: 12
16462
16463**Parameters**
16464
16465| Name                 | Description                                                  |
16466| -------------------- | ------------------------------------------------------------ |
16467| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16468
16469**Returns**
16470
16471Returns the font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight).
16472
16473
16474### OH_Drawing_TextStyleGetForegroundBrush()
16475
16476```
16477void OH_Drawing_TextStyleGetForegroundBrush (OH_Drawing_TextStyle* , OH_Drawing_Brush*  )
16478```
16479
16480**Description**
16481
16482Obtains the foreground brush of a text style.
16483
16484**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16485
16486**Since**: 12
16487
16488**Parameters**
16489
16490| Name                 | Description                                                  |
16491| -------------------- | ------------------------------------------------------------ |
16492| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16493| OH_Drawing_Brush     | Pointer to an [OH_Drawing_Brush](#oh_drawing_brush) object, which is obtained by calling [OH_Drawing_BrushCreate](#oh_drawing_brushcreate). |
16494
16495
16496### OH_Drawing_TextStyleGetForegroundPen()
16497
16498```
16499void OH_Drawing_TextStyleGetForegroundPen (OH_Drawing_TextStyle* , OH_Drawing_Pen*  )
16500```
16501
16502**Description**
16503
16504Obtains the foreground pen of a text style.
16505
16506**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16507
16508**Since**: 12
16509
16510**Parameters**
16511
16512| Name                 | Description                                                  |
16513| -------------------- | ------------------------------------------------------------ |
16514| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16515| OH_Drawing_Pen       | Pointer to an [OH_Drawing_Pen](#oh_drawing_pen) object, which is obtained by calling [OH_Drawing_PenCreate](#oh_drawing_pencreate). |
16516
16517
16518### OH_Drawing_TextStyleGetHalfLeading()
16519
16520```
16521bool OH_Drawing_TextStyleGetHalfLeading (OH_Drawing_TextStyle*)
16522```
16523
16524**Description**
16525
16526Checks whether half leading is enabled for a text style.
16527
16528**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16529
16530**Since**: 12
16531
16532**Parameters**
16533
16534| Name                 | Description                                                  |
16535| -------------------- | ------------------------------------------------------------ |
16536| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16537
16538**Returns**
16539
16540Returns **true** if half leading is enabled; returns **false** otherwise.
16541
16542
16543### OH_Drawing_TextStyleGetLetterSpacing()
16544
16545```
16546double OH_Drawing_TextStyleGetLetterSpacing (OH_Drawing_TextStyle*)
16547```
16548
16549**Description**
16550
16551Obtains the letter spacing of a text style.
16552
16553**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16554
16555**Since**: 12
16556
16557**Parameters**
16558
16559| Name                 | Description                                                  |
16560| -------------------- | ------------------------------------------------------------ |
16561| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16562
16563**Returns**
16564
16565Returns the letter spacing.
16566
16567
16568### OH_Drawing_TextStyleGetLocale()
16569
16570```
16571const char* OH_Drawing_TextStyleGetLocale (OH_Drawing_TextStyle*)
16572```
16573
16574**Description**
16575
16576Obtains the locale of a text style.
16577
16578**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16579
16580**Since**: 12
16581
16582**Parameters**
16583
16584| Name                 | Description                                                  |
16585| -------------------- | ------------------------------------------------------------ |
16586| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16587
16588**Returns**
16589
16590Returns the pointer to the locale, in the format of language-country. For example, zh-CN indicates Chinese (China), and en-US indicates English (United States). For details, see BCP 47.
16591
16592
16593### OH_Drawing_TextStyleGetShadowCount()
16594
16595```
16596int OH_Drawing_TextStyleGetShadowCount (OH_Drawing_TextStyle* )
16597```
16598
16599**Description**
16600
16601Obtains the size of a text shadow container.
16602
16603**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16604
16605**Since**: 12
16606
16607**Parameters**
16608
16609| Name                 | Description                                                  |
16610| -------------------- | ------------------------------------------------------------ |
16611| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16612
16613**Returns**
16614
16615Returns the size.
16616
16617
16618### OH_Drawing_TextStyleGetShadows()
16619
16620```
16621OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows (OH_Drawing_TextStyle* )
16622```
16623
16624**Description**
16625
16626Obtains a text shadow container. When [OH_Drawing_TextShadow](#oh_drawing_textshadow) is no longer required, call [OH_Drawing_DestroyTextShadows](#oh_drawing_destroytextshadows) to release the pointer to the object.
16627
16628**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16629
16630**Since**: 12
16631
16632**Parameters**
16633
16634| Name                 | Description                                                  |
16635| -------------------- | ------------------------------------------------------------ |
16636| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16637
16638**Returns**
16639
16640Returns the pointer to the [OH_Drawing_TextShadow](#oh_drawing_textshadow) object.
16641
16642
16643### OH_Drawing_TextStyleGetShadowWithIndex()
16644
16645```
16646OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex (OH_Drawing_TextStyle* , int  )
16647```
16648
16649**Description**
16650
16651Obtains a shadow with a given index in a text shadow container.
16652
16653**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16654
16655**Since**: 12
16656
16657**Parameters**
16658
16659| Name                 | Description                                                  |
16660| -------------------- | ------------------------------------------------------------ |
16661| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16662| int                  | Index.                                                       |
16663
16664**Returns**
16665
16666Returns the pointer to the [OH_Drawing_TextShadow](#oh_drawing_textshadow) object.
16667
16668
16669### OH_Drawing_TextStyleGetWordSpacing()
16670
16671```
16672double OH_Drawing_TextStyleGetWordSpacing (OH_Drawing_TextStyle*)
16673```
16674
16675**Description**
16676
16677Obtains the word spacing of a text style.
16678
16679**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16680
16681**Since**: 12
16682
16683**Parameters**
16684
16685| Name                 | Description                                                  |
16686| -------------------- | ------------------------------------------------------------ |
16687| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16688
16689**Returns**
16690
16691Returns the word spacing.
16692
16693
16694### OH_Drawing_TextStyleIsAttributeMatched()
16695
16696```
16697bool OH_Drawing_TextStyleIsAttributeMatched (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle, OH_Drawing_TextStyleType textStyleType )
16698```
16699
16700**Description**
16701
16702Checks whether two text styles have the same text style type.
16703
16704**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16705
16706**Since**: 12
16707
16708**Parameters**
16709
16710| Name          | Description                                                  |
16711| ------------- | ------------------------------------------------------------ |
16712| style         | Pointer to the first text style.                             |
16713| comparedStyle | Pointer to the second text style.                            |
16714| textStyleType | Text style type. For details about the available options, see [OH_Drawing_TextStyleType](#oh_drawing_textstyletype). |
16715
16716**Returns**
16717
16718Returns **true** if the two are the same; returns **false** otherwise.
16719
16720
16721### OH_Drawing_TextStyleIsEqual()
16722
16723```
16724bool OH_Drawing_TextStyleIsEqual (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle )
16725```
16726
16727**Description**
16728
16729Checks whether two text styles are equal. The word width property is not involved in the comparison.
16730
16731**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16732
16733**Since**: 12
16734
16735**Parameters**
16736
16737| Name          | Description                       |
16738| ------------- | --------------------------------- |
16739| style         | Pointer to the first text style.  |
16740| comparedStyle | Pointer to the second text style. |
16741
16742**Returns**
16743
16744Returns **true** if the two are equal; returns **false** otherwise.
16745
16746
16747### OH_Drawing_TextStyleIsEqualByFont()
16748
16749```
16750bool OH_Drawing_TextStyleIsEqualByFont (const OH_Drawing_TextStyle* style, const OH_Drawing_TextStyle* comparedStyle )
16751```
16752
16753**Description**
16754
16755Checks whether the font style properties of two text styles are equal.
16756
16757**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16758
16759**Since**: 12
16760
16761**Parameters**
16762
16763| Name          | Description                        |
16764| ------------- | ---------------------------------- |
16765| style         | Pointer to the first text style.   |
16766| comparedStyle | Pointer to the first second style. |
16767
16768**Returns**
16769
16770Returns **true** if the two are equal; returns **false** otherwise.
16771
16772
16773### OH_Drawing_TextStyleIsPlaceholder()
16774
16775```
16776bool OH_Drawing_TextStyleIsPlaceholder (OH_Drawing_TextStyle* style)
16777```
16778
16779**Description**
16780
16781Checks whether a placeholder is set for a text style.
16782
16783**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16784
16785**Since**: 12
16786
16787**Parameters**
16788
16789| Name                 | Description                                                  |
16790| -------------------- | ------------------------------------------------------------ |
16791| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16792
16793**Returns**
16794
16795Returns **true** if a placeholder is set; returns **false** otherwise.
16796
16797
16798### OH_Drawing_TextStyleSetBackgroundRect()
16799
16800```
16801void OH_Drawing_TextStyleSetBackgroundRect (OH_Drawing_TextStyle* , const OH_Drawing_RectStyle_Info* , int styleId )
16802```
16803
16804**Description**
16805
16806Sets a background rectangle and style ID for a text style. The style ID is valid only when the background box is a rounded rectangle.
16807
16808**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16809
16810**Since**: 12
16811
16812**Parameters**
16813
16814| Name                                                         | Description                                                  |
16815| ------------------------------------------------------------ | ------------------------------------------------------------ |
16816| OH_Drawing_TextStyle                                         | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16817| [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) | Pointer to an [OH_Drawing_RectStyle_Info](_o_h___drawing___rect_style___info.md) object. |
16818| int                                                          | Style ID. The style ID is valid only when the background box is a rounded rectangle. Text processing is divided into multiple segments. Each segment has its own text style. **id** indicates the sequence number of the background box in which the segment is drawn. If the ID of each segment in a row is 0, all segments are drawn in the same background box. If the IDs in a row are 0 and 1, the segment whose ID is 0 is drawn in a background box, the segment whose ID is 1 is drawn in another background box. Other cases can be deduced in the same way. |
16819
16820
16821### OH_Drawing_TextStyleSetBaselineShift()
16822
16823```
16824void OH_Drawing_TextStyleSetBaselineShift (OH_Drawing_TextStyle*, double lineShift)
16825```
16826
16827**Description**
16828
16829Sets a baseline drift for a text style.
16830
16831**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16832
16833**Since**: 12
16834
16835**Parameters**
16836
16837| Name                 | Description                                                  |
16838| -------------------- | ------------------------------------------------------------ |
16839| OH_Drawing_TextStyle | Pointer to an **OH_Drawing_TextStyle** object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16840| double               | Baseline drift of the text style.                            |
16841
16842
16843### OH_Drawing_TextStyleSetPlaceholder()
16844
16845```
16846void OH_Drawing_TextStyleSetPlaceholder (OH_Drawing_TextStyle* style)
16847```
16848
16849**Description**
16850
16851Sets a placeholder for a text style.
16852
16853**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16854
16855**Since**: 12
16856
16857**Parameters**
16858
16859| Name                 | Description                                                  |
16860| -------------------- | ------------------------------------------------------------ |
16861| OH_Drawing_TextStyle | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
16862
16863
16864### OH_Drawing_TypefaceCreateDefault()
16865
16866```
16867OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault (void )
16868```
16869
16870**Description**
16871
16872Creates a default **OH_Drawing_Typeface** object.
16873
16874**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16875
16876**Since**: 11
16877
16878**Returns**
16879
16880Returns the pointer to the **OH_Drawing_Typeface** object created.
16881
16882
16883### OH_Drawing_TypefaceCreateFromFile()
16884
16885```
16886OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFile (const char* path, int index )
16887```
16888
16889**Description**
16890
16891Creates an **OH_Drawing_Typeface** object through a file.
16892
16893Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
16894
16895If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
16896
16897**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16898
16899**Since**: 12
16900
16901**Parameters**
16902
16903| Name  | Description               |
16904| ----- | ------------------------- |
16905| path  | Pointer to the file path. |
16906| index | File index.               |
16907
16908**Returns**
16909
16910Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created.
16911
16912
16913### OH_Drawing_TypefaceCreateFromStream()
16914
16915```
16916OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream (OH_Drawing_MemoryStream* , int32_t index )
16917```
16918
16919**Description**
16920
16921Creates an **OH_Drawing_Typeface** object through a memory stream. If the memory stream is an invalid font file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot release it.
16922
16923Error codes may be generated in the call. You can view the error code by calling [OH_Drawing_ErrorCodeGet](#oh_drawing_errorcodeget).
16924
16925If **OH_Drawing_MemoryStream** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.
16926
16927**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16928
16929**Since**: 12
16930
16931**Parameters**
16932
16933| Name                    | Description                                                  |
16934| ----------------------- | ------------------------------------------------------------ |
16935| OH_Drawing_MemoryStream | Pointer to an [OH_Drawing_MemoryStream](#oh_drawing_memorystream) object. |
16936| index                   | Index of the memory stream.                                  |
16937
16938**Returns**
16939
16940Returns the pointer to the [OH_Drawing_Typeface](#oh_drawing_typeface) object created.
16941
16942
16943### OH_Drawing_TypefaceDestroy()
16944
16945```
16946void OH_Drawing_TypefaceDestroy (OH_Drawing_Typeface* )
16947```
16948
16949**Description**
16950
16951Destroys an **OH_Drawing_Typeface** object and reclaims the memory occupied by the object.
16952
16953**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16954
16955**Since**: 11
16956
16957**Parameters**
16958
16959| Name                | Description                                   |
16960| ------------------- | --------------------------------------------- |
16961| OH_Drawing_Typeface | Pointer to an **OH_Drawing_Typeface** object. |
16962
16963
16964### OH_Drawing_TypographyDestroyEllipsis()
16965
16966```
16967void OH_Drawing_TypographyDestroyEllipsis (char* ellipsis)
16968```
16969
16970**Description**
16971
16972Reclaims the memory occupied by the text ellipsis names.
16973
16974**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16975
16976**Since**: 12
16977
16978**Parameters**
16979
16980| Name     | Description                         |
16981| -------- | ----------------------------------- |
16982| ellipsis | Pointer to the text ellipsis names. |
16983
16984
16985### OH_Drawing_TypographyDestroyLineFontMetrics()
16986
16987```
16988void OH_Drawing_TypographyDestroyLineFontMetrics (OH_Drawing_Font_Metrics* )
16989```
16990
16991**Description**
16992
16993Reclaims the memory occupied by the struct array that holds all the font metrics of a given line.
16994
16995**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
16996
16997**Since**: 12
16998
16999**Parameters**
17000
17001| Name                                                         | Description                                       |
17002| ------------------------------------------------------------ | ------------------------------------------------- |
17003| [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) | Pointer to the first address of the struct array. |
17004
17005
17006### OH_Drawing_TypographyDidExceedMaxLines()
17007
17008```
17009bool OH_Drawing_TypographyDidExceedMaxLines (OH_Drawing_Typography* )
17010```
17011
17012**Description**
17013
17014Checks whether the maximum number of lines of a typography object is exceeded. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. If the maximum number of lines is not set by calling [OH_Drawing_SetTypographyTextMaxLines](#oh_drawing_settypographytextmaxlines), **false** is returned.
17015
17016**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17017
17018**Since**: 11
17019
17020**Parameters**
17021
17022| Name                  | Description                                                  |
17023| --------------------- | ------------------------------------------------------------ |
17024| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17025
17026**Returns**
17027
17028Returns **true** if the maximum number of lines is exceeded; returns **false** otherwise.
17029
17030
17031### OH_Drawing_TypographyGetAlphabeticBaseline()
17032
17033```
17034double OH_Drawing_TypographyGetAlphabeticBaseline (OH_Drawing_Typography* )
17035```
17036
17037**Description**
17038
17039Obtains the alphabetic baseline in a typography object.
17040
17041**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17042
17043**Since**: 9
17044
17045**Parameters**
17046
17047| Name                  | Description                                                  |
17048| --------------------- | ------------------------------------------------------------ |
17049| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17050
17051**Returns**
17052
17053Returns the alphabetic baseline.
17054
17055
17056### OH_Drawing_TypographyGetEffectiveAlignment()
17057
17058```
17059int OH_Drawing_TypographyGetEffectiveAlignment (OH_Drawing_TypographyStyle* style)
17060```
17061
17062**Description**
17063
17064Obtains the text alignment mode.
17065
17066**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17067
17068**Since**: 12
17069
17070**Parameters**
17071
17072| Name                       | Description                                                  |
17073| -------------------------- | ------------------------------------------------------------ |
17074| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17075
17076**Returns**
17077
17078Returns the text alignment mode.
17079
17080
17081### OH_Drawing_TypographyGetGlyphPositionAtCoordinate()
17082
17083```
17084OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinate (OH_Drawing_Typography* , double , double  )
17085```
17086
17087**Description**
17088
17089Obtains the position and affinity of the glyph at the given coordinates.
17090
17091**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17092
17093**Since**: 11
17094
17095**Parameters**
17096
17097| Name                  | Description                                                  |
17098| --------------------- | ------------------------------------------------------------ |
17099| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17100| double                | X coordinate.                                                |
17101| double                | Y coordinate.                                                |
17102
17103**Returns**
17104
17105Returns the [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) struct that holds the position and affinity of the glyph.
17106
17107
17108### OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster()
17109
17110```
17111OH_Drawing_PositionAndAffinity* OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster (OH_Drawing_Typography* , double , double  )
17112```
17113
17114**Description**
17115
17116Obtains the position and affinity of the glyph cluster to which the glyph at the given coordinates belongs. The glyph cluster is a container that holds one or more glyphs.
17117
17118**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17119
17120**Since**: 11
17121
17122**Parameters**
17123
17124| Name                  | Description                                                  |
17125| --------------------- | ------------------------------------------------------------ |
17126| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17127| double                | X coordinate.                                                |
17128| double                | Y coordinate.                                                |
17129
17130**Returns**
17131
17132Returns the [OH_Drawing_PositionAndAffinity](#oh_drawing_positionandaffinity) struct that holds the position and affinity of the glyph cluster.
17133
17134
17135### OH_Drawing_TypographyGetHeight()
17136
17137```
17138double OH_Drawing_TypographyGetHeight (OH_Drawing_Typography* )
17139```
17140
17141**Description**
17142
17143Obtains the overall height of a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17144
17145**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17146
17147**Since**: 9
17148
17149**Parameters**
17150
17151| Name                  | Description                                                  |
17152| --------------------- | ------------------------------------------------------------ |
17153| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17154
17155**Returns**
17156
17157Returns the height.
17158
17159
17160### OH_Drawing_TypographyGetIdeographicBaseline()
17161
17162```
17163double OH_Drawing_TypographyGetIdeographicBaseline (OH_Drawing_Typography* )
17164```
17165
17166**Description**
17167
17168Obtains the ideographic baseline in a typography object.
17169
17170**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17171
17172**Since**: 9
17173
17174**Parameters**
17175
17176| Name                  | Description                                                  |
17177| --------------------- | ------------------------------------------------------------ |
17178| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17179
17180**Returns**
17181
17182Returns the ideographic baseline.
17183
17184
17185### OH_Drawing_TypographyGetIndentsWithIndex()
17186
17187```
17188float OH_Drawing_TypographyGetIndentsWithIndex (OH_Drawing_Typography* , int  )
17189```
17190
17191**Description**
17192
17193Obtains indents with a given index in a typography object. The line index starts from 0.
17194
17195**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17196
17197**Since**: 12
17198
17199**Parameters**
17200
17201| Name                  | Description                                                  |
17202| --------------------- | ------------------------------------------------------------ |
17203| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17204| int                   | Index.                                                       |
17205
17206**Returns**
17207
17208Returns the indents.
17209
17210
17211### OH_Drawing_TypographyGetLineCount()
17212
17213```
17214size_t OH_Drawing_TypographyGetLineCount (OH_Drawing_Typography* )
17215```
17216
17217**Description**
17218
17219Obtains the number of lines in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17220
17221**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17222
17223**Since**: 11
17224
17225**Parameters**
17226
17227| Name                  | Description                                                  |
17228| --------------------- | ------------------------------------------------------------ |
17229| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17230
17231**Returns**
17232
17233Returns the number of lines.
17234
17235
17236### OH_Drawing_TypographyGetLineFontMetrics()
17237
17238```
17239OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics (OH_Drawing_Typography* , size_t lineNumber, size_t* fontMetricsSize )
17240```
17241
17242**Description**
17243
17244Obtains all font metrics from a given line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. Otherwise, a null pointer is returned. When [OH_Drawing_Font_Metrics](_o_h___drawing___font___metrics.md) is no longer required, call [OH_Drawing_TypographyDestroyLineFontMetrics](#oh_drawing_typographydestroylinefontmetrics) to release the pointer to the object.
17245
17246**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17247
17248**Since**: 12
17249
17250**Parameters**
17251
17252| Name                  | Description                                                  |
17253| --------------------- | ------------------------------------------------------------ |
17254| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17255| lineNumber            | Line number, which is an integer. The minimum value is 1, and the maximum value depends on the number of lines parsed by the font engine after text input. If a value greater than the maximum number is passed in, an error value is returned and an error message is printed. |
17256| fontMetricsSize       | Pointer to the size of the struct.                           |
17257
17258**Returns**
17259
17260Returns all the font metrics.
17261
17262
17263### OH_Drawing_TypographyGetLineHeight()
17264
17265```
17266double OH_Drawing_TypographyGetLineHeight (OH_Drawing_Typography* , int  )
17267```
17268
17269**Description**
17270
17271Obtains the line height in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17272
17273**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17274
17275**Since**: 11
17276
17277**Parameters**
17278
17279| Name                  | Description                                                  |
17280| --------------------- | ------------------------------------------------------------ |
17281| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17282| int                   | Target line.                                                 |
17283
17284**Returns**
17285
17286Returns the height.
17287
17288
17289### OH_Drawing_TypographyGetLineInfo()
17290
17291```
17292bool OH_Drawing_TypographyGetLineInfo (OH_Drawing_Typography* , int , bool , bool , OH_Drawing_LineMetrics*  )
17293```
17294
17295**Description**
17296
17297Obtains the metrics of a given line or the metrics of the first character in a given line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17298
17299**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17300
17301**Since**: 12
17302
17303**Parameters**
17304
17305| Name                   | Description                                                  |
17306| ---------------------- | ------------------------------------------------------------ |
17307| OH_Drawing_Typography  | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17308| int                    | Row No.                                                      |
17309| bool                   | Whether to obtain the metrics of the entire line. The value **true** means to obtain the metrics of the entire line, and **false** means to obtain the metrics of the first character in the line. |
17310| bool                   | Whether whitespace characters are included in the text width. The value **true** means that whitespace characters are not included, **false** means the opposite. |
17311| OH_Drawing_LineMetrics | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). |
17312
17313**Returns**
17314
17315Returns **true** if the metrics of the given line or the metrics of the first character in the given line is obtained; returns **false** otherwise.
17316
17317
17318### OH_Drawing_TypographyGetLineMetrics()
17319
17320```
17321OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics (OH_Drawing_Typography* )
17322```
17323
17324**Description**
17325
17326Obtains the line metrics in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) is no longer required, call [OH_Drawing_DestroyLineMetrics](#oh_drawing_destroylinemetrics) to release the pointer to the object.
17327
17328**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17329
17330**Since**: 12
17331
17332**Parameters**
17333
17334| Name                  | Description                                                  |
17335| --------------------- | ------------------------------------------------------------ |
17336| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17337
17338**Returns**
17339
17340Returns the pointer to the [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object.
17341
17342
17343### OH_Drawing_TypographyGetLineMetricsAt()
17344
17345```
17346bool OH_Drawing_TypographyGetLineMetricsAt (OH_Drawing_Typography* , int , OH_Drawing_LineMetrics*  )
17347```
17348
17349**Description**
17350
17351Obtains the metrics of a given line in a typography object. For details, see [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17352
17353**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17354
17355**Since**: 12
17356
17357**Parameters**
17358
17359| Name                                                       | Description                                                  |
17360| ---------------------------------------------------------- | ------------------------------------------------------------ |
17361| OH_Drawing_Typography                                      | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17362| int                                                        | Line No.                                                     |
17363| [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) | Pointer to an [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md) object, which is obtained by calling [OH_Drawing_LineMetrics](_o_h___drawing___line_metrics.md). |
17364
17365**Returns**
17366
17367Returns **true** if the metrics of the given line are obtained; returns **false** otherwise.
17368
17369
17370### OH_Drawing_TypographyGetLineTextRange()
17371
17372```
17373OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange (OH_Drawing_Typography* , int , bool  )
17374```
17375
17376**Description**
17377
17378Obtains the line bounds in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. This function can only be used to obtain the bounds of existing lines. That is, the line index must start from 0, and the maximum index is [OH_Drawing_TypographyGetLineCount](#oh_drawing_typographygetlinecount) - 1.
17379
17380**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17381
17382**Since**: 12
17383
17384**Parameters**
17385
17386| Name                  | Description                                                  |
17387| --------------------- | ------------------------------------------------------------ |
17388| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17389| int                   | Row index.                                                   |
17390| bool                  | Whether the returned bounds contain spaces. The value **true** means that the bounds contain spaces, and **false** means the opposite. |
17391
17392**Returns**
17393
17394Returns the pointer to the [OH_Drawing_Range](#oh_drawing_range) object.
17395
17396
17397### OH_Drawing_TypographyGetLineWidth()
17398
17399```
17400double OH_Drawing_TypographyGetLineWidth (OH_Drawing_Typography* , int  )
17401```
17402
17403**Description**
17404
17405Obtains the line width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17406
17407**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17408
17409**Since**: 11
17410
17411**Parameters**
17412
17413| Name                  | Description                                                  |
17414| --------------------- | ------------------------------------------------------------ |
17415| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17416| int                   | Target line.                                                 |
17417
17418**Returns**
17419
17420Returns the width.
17421
17422
17423### OH_Drawing_TypographyGetLongestLine()
17424
17425```
17426double OH_Drawing_TypographyGetLongestLine (OH_Drawing_Typography* )
17427```
17428
17429**Description**
17430
17431Obtains the width of the longest line in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. You are advised to round up the return value. If the text content is empty, **0.0** is returned.
17432
17433**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17434
17435**Since**: 9
17436
17437**Parameters**
17438
17439| Name                  | Description                                                  |
17440| --------------------- | ------------------------------------------------------------ |
17441| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17442
17443**Returns**
17444
17445Returns the width of the longest line.
17446
17447
17448### OH_Drawing_TypographyGetMaxIntrinsicWidth()
17449
17450```
17451double OH_Drawing_TypographyGetMaxIntrinsicWidth (OH_Drawing_Typography* )
17452```
17453
17454**Description**
17455
17456Obtains the maximum intrinsic width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17457
17458**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17459
17460**Since**: 9
17461
17462**Parameters**
17463
17464| Name                  | Description                                                  |
17465| --------------------- | ------------------------------------------------------------ |
17466| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17467
17468**Returns**
17469
17470Returns the maximum intrinsic width.
17471
17472
17473### OH_Drawing_TypographyGetMaxWidth()
17474
17475```
17476double OH_Drawing_TypographyGetMaxWidth (OH_Drawing_Typography* )
17477```
17478
17479**Description**
17480
17481Obtains the typography width set by the user. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17482
17483**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17484
17485**Since**: 9
17486
17487**Parameters**
17488
17489| Name                  | Description                                                  |
17490| --------------------- | ------------------------------------------------------------ |
17491| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17492
17493**Returns**
17494
17495Returns the typography width set by the user.
17496
17497
17498### OH_Drawing_TypographyGetMinIntrinsicWidth()
17499
17500```
17501double OH_Drawing_TypographyGetMinIntrinsicWidth (OH_Drawing_Typography* )
17502```
17503
17504**Description**
17505
17506Obtains the minimum intrinsic width in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called.
17507
17508**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17509
17510**Since**: 9
17511
17512**Parameters**
17513
17514| Name                  | Description                                                  |
17515| --------------------- | ------------------------------------------------------------ |
17516| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17517
17518**Returns**
17519
17520Returns the minimum intrinsic width.
17521
17522
17523### OH_Drawing_TypographyGetRectsForPlaceholders()
17524
17525```
17526OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForPlaceholders (OH_Drawing_Typography* )
17527```
17528
17529**Description**
17530
17531Obtains text boxes for placeholders in a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_TextBox](#oh_drawing_textbox) is no longer required, call [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) to release the pointer to the object.
17532
17533**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17534
17535**Since**: 11
17536
17537**Parameters**
17538
17539| Name                  | Description                                                  |
17540| --------------------- | ------------------------------------------------------------ |
17541| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17542
17543**Returns**
17544
17545Returns the [OH_Drawing_TextBox](#oh_drawing_textbox) struct that holds the text boxes.
17546
17547### OH_Drawing_TypographyGetRectsForRange()
17548
17549```
17550OH_Drawing_TextBox* OH_Drawing_TypographyGetRectsForRange (OH_Drawing_Typography* , size_t , size_t , OH_Drawing_RectHeightStyle , OH_Drawing_RectWidthStyle  )
17551```
17552
17553**Description**
17554
17555Obtains text boxes in a given range of a typography object. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called. When [OH_Drawing_TextBox](#oh_drawing_textbox) is no longer required, call [OH_Drawing_TypographyDestroyTextBox](#oh_drawing_typographydestroytextbox) to release the pointer to the object.
17556
17557**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17558
17559**Since**: 11
17560
17561**Parameters**
17562
17563| Name                       | Description                                                  |
17564| -------------------------- | ------------------------------------------------------------ |
17565| OH_Drawing_Typography      | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17566| size_t                     | Start position.                                              |
17567| size_t                     | End position.                                                |
17568| OH_Drawing_RectHeightStyle | Height style. For details about the available options, see [OH_Drawing_RectHeightStyle](#oh_drawing_rectheightstyle). |
17569| OH_Drawing_RectWidthStyle  | Width style. For details about the available options, see [OH_Drawing_RectWidthStyle](#oh_drawing_rectwidthstyle). |
17570
17571**Returns**
17572
17573Returns the [OH_Drawing_TextBox](#oh_drawing_textbox) struct that holds the text boxes.
17574
17575
17576### OH_Drawing_TypographyGetTextAlign()
17577
17578```
17579OH_Drawing_TextAlign OH_Drawing_TypographyGetTextAlign (OH_Drawing_TypographyStyle* )
17580```
17581
17582**Description**
17583
17584Obtains the text alignment mode.
17585
17586**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17587
17588**Since**: 12
17589
17590**Parameters**
17591
17592| Name                       | Description                                                  |
17593| -------------------------- | ------------------------------------------------------------ |
17594| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17595
17596**Returns**
17597
17598Returns the text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign).
17599
17600
17601### OH_Drawing_TypographyGetTextDirection()
17602
17603```
17604OH_Drawing_TextDirection OH_Drawing_TypographyGetTextDirection (OH_Drawing_TypographyStyle* )
17605```
17606
17607**Description**
17608
17609Obtains the text direction of a typography style.
17610
17611**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17612
17613**Since**: 12
17614
17615**Parameters**
17616
17617| Name                       | Description                                                  |
17618| -------------------------- | ------------------------------------------------------------ |
17619| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17620
17621**Returns**
17622
17623Returns the text direction. For details about the available options, see [OH_Drawing_TextDirection](#oh_drawing_textdirection).
17624
17625
17626### OH_Drawing_TypographyGetTextEllipsis()
17627
17628```
17629char* OH_Drawing_TypographyGetTextEllipsis (OH_Drawing_TypographyStyle* )
17630```
17631
17632**Description**
17633
17634Obtains the text ellipsis content of a typography style.
17635
17636**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17637
17638**Since**: 12
17639
17640**Parameters**
17641
17642| Name                       | Description                                                  |
17643| -------------------------- | ------------------------------------------------------------ |
17644| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17645
17646**Returns**
17647
17648Returns the pointer to the text ellipsis content obtained.
17649
17650
17651### OH_Drawing_TypographyGetTextMaxLines()
17652
17653```
17654size_t OH_Drawing_TypographyGetTextMaxLines (OH_Drawing_TypographyStyle* )
17655```
17656
17657**Description**
17658
17659Obtains the maximum number of lines.
17660
17661**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17662
17663**Since**: 12
17664
17665**Parameters**
17666
17667| Name                       | Description                                                  |
17668| -------------------------- | ------------------------------------------------------------ |
17669| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17670
17671**Returns**
17672
17673Returns the maximum number of lines.
17674
17675
17676### OH_Drawing_TypographyGetTextStyle()
17677
17678```
17679OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle (OH_Drawing_TypographyStyle* style)
17680```
17681
17682**Description**
17683
17684Obtains the default text style of a typography style.
17685
17686**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17687
17688**Since**: 12
17689
17690**Parameters**
17691
17692| Name                       | Description                                                  |
17693| -------------------------- | ------------------------------------------------------------ |
17694| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17695
17696**Returns**
17697
17698Returns the pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object. If the object is no longer required, call [OH_Drawing_DestroyTextStyle](#oh_drawing_destroytextstyle) to release the pointer to the object.
17699
17700
17701### OH_Drawing_TypographyGetUnresolvedGlyphsCount()
17702
17703```
17704int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount (OH_Drawing_Typography* )
17705```
17706
17707**Description**
17708
17709Obtains the number of unresolved glyphs in a typography object. This function can be called only after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called and applied.
17710
17711**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17712
17713**Since**: 12
17714
17715**Parameters**
17716
17717| Name                  | Description                                                  |
17718| --------------------- | ------------------------------------------------------------ |
17719| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17720
17721**Returns**
17722
17723Returns the number of unresolved glyphs.
17724
17725
17726### OH_Drawing_TypographyGetWordBoundary()
17727
17728```
17729OH_Drawing_Range* OH_Drawing_TypographyGetWordBoundary (OH_Drawing_Typography* , size_t  )
17730```
17731
17732**Description**
17733
17734Obtains the word boundary in a typography object.
17735
17736**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17737
17738**Since**: 11
17739
17740**Parameters**
17741
17742| Name                  | Description                                                  |
17743| --------------------- | ------------------------------------------------------------ |
17744| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17745| size_t                | Index of the word.                                           |
17746
17747**Returns**
17748
17749Returns the [OH_Drawing_Range](#oh_drawing_range) struct that holds the word boundary.
17750
17751
17752### OH_Drawing_TypographyHandlerAddPlaceholder()
17753
17754```
17755void OH_Drawing_TypographyHandlerAddPlaceholder (OH_Drawing_TypographyCreate* , OH_Drawing_PlaceholderSpan*  )
17756```
17757
17758**Description**
17759
17760Adds a placeholder.
17761
17762**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17763
17764**Since**: 11
17765
17766**Parameters**
17767
17768| Name                        | Description                                                  |
17769| --------------------------- | ------------------------------------------------------------ |
17770| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
17771| OH_Drawing_PlaceholderSpan  | Pointer to an [OH_Drawing_PlaceholderSpan](_o_h___drawing___placeholder_span.md) object. |
17772
17773
17774### OH_Drawing_TypographyHandlerAddSymbol()
17775
17776```
17777void OH_Drawing_TypographyHandlerAddSymbol (OH_Drawing_TypographyCreate* , uint32_t symbol )
17778```
17779
17780**Description**
17781
17782Adds the symbol to use in the typography creation process.
17783
17784**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17785
17786**Since**: 12
17787
17788**Parameters**
17789
17790| Name                        | Description                                                  |
17791| --------------------------- | ------------------------------------------------------------ |
17792| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
17793| uint32_t                    | Symbol. For details about the supported symbols, see the value in the JSON file. For details about the configurable symbols (unicode values in the list view), see [HarmonyOS Symbol](https://developer.huawei.com/consumer/cn/design/harmonyos-symbol/). |
17794
17795
17796### OH_Drawing_TypographyHandlerAddText()
17797
17798```
17799void OH_Drawing_TypographyHandlerAddText (OH_Drawing_TypographyCreate* , const char*  )
17800```
17801
17802**Description**
17803
17804Adds text.
17805
17806**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17807
17808**Since**: 8
17809
17810**Parameters**
17811
17812| Name                        | Description                                                  |
17813| --------------------------- | ------------------------------------------------------------ |
17814| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
17815| char                        | Pointer to the text content.                                 |
17816
17817
17818### OH_Drawing_TypographyHandlerPopTextStyle()
17819
17820```
17821void OH_Drawing_TypographyHandlerPopTextStyle (OH_Drawing_TypographyCreate* )
17822```
17823
17824**Description**
17825
17826Pops the top text style out of the text style stack.
17827
17828**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17829
17830**Since**: 8
17831
17832**Parameters**
17833
17834| Name                        | Description                                                  |
17835| --------------------------- | ------------------------------------------------------------ |
17836| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
17837
17838
17839### OH_Drawing_TypographyHandlerPushTextStyle()
17840
17841```
17842void OH_Drawing_TypographyHandlerPushTextStyle (OH_Drawing_TypographyCreate* , OH_Drawing_TextStyle*  )
17843```
17844
17845**Description**
17846
17847Pushes a text style into the text style stack. Any text added afterward will use the style currently on top of the stack.
17848
17849**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17850
17851**Since**: 8
17852
17853**Parameters**
17854
17855| Name                        | Description                                                  |
17856| --------------------------- | ------------------------------------------------------------ |
17857| OH_Drawing_TypographyCreate | Pointer to an [OH_Drawing_TypographyCreate](#oh_drawing_typographycreate) object. The pointer is obtained by calling [OH_Drawing_CreateTypographyHandler](#oh_drawing_createtypographyhandler). |
17858| OH_Drawing_TextStyle        | Pointer to an [OH_Drawing_TextStyle](#oh_drawing_textstyle) object, which is obtained by calling [OH_Drawing_CreateTextStyle](#oh_drawing_createtextstyle). |
17859
17860
17861### OH_Drawing_TypographyIsEllipsized()
17862
17863```
17864bool OH_Drawing_TypographyIsEllipsized (OH_Drawing_TypographyStyle* style)
17865```
17866
17867**Description**
17868
17869Checks whether an ellipsis is configured for a typography style.
17870
17871**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17872
17873**Since**: 12
17874
17875**Parameters**
17876
17877| Name                       | Description                                                  |
17878| -------------------------- | ------------------------------------------------------------ |
17879| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17880
17881**Returns**
17882
17883Returns **true** if the text has an ellipsis; returns **false** otherwise.
17884
17885
17886### OH_Drawing_TypographyIsLineUnlimited()
17887
17888```
17889bool OH_Drawing_TypographyIsLineUnlimited (OH_Drawing_TypographyStyle* style)
17890```
17891
17892**Description**
17893
17894Checks whether the maximum number of lines is limited for text.
17895
17896**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17897
17898**Since**: 12
17899
17900**Parameters**
17901
17902| Name                       | Description                                                  |
17903| -------------------------- | ------------------------------------------------------------ |
17904| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
17905
17906**Returns**
17907
17908Returns **true** if that the maximum number of lines is limited; returns **false** otherwise.
17909
17910
17911### OH_Drawing_TypographyLayout()
17912
17913```
17914void OH_Drawing_TypographyLayout (OH_Drawing_Typography* , double  )
17915```
17916
17917**Description**
17918
17919Lays out the typography.
17920
17921**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17922
17923**Since**: 8
17924
17925**Parameters**
17926
17927| Name                  | Description                                                  |
17928| --------------------- | ------------------------------------------------------------ |
17929| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17930| double                | Maximum text width.                                          |
17931
17932
17933### OH_Drawing_TypographyMarkDirty()
17934
17935```
17936void OH_Drawing_TypographyMarkDirty (OH_Drawing_Typography* )
17937```
17938
17939**Description**
17940
17941Marks a typography object as dirty data. This function is used to initialize the typography state.
17942
17943**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17944
17945**Since**: 12
17946
17947**Parameters**
17948
17949| Name                  | Description                                                  |
17950| --------------------- | ------------------------------------------------------------ |
17951| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17952
17953
17954### OH_Drawing_TypographyPaint()
17955
17956```
17957void OH_Drawing_TypographyPaint (OH_Drawing_Typography* , OH_Drawing_Canvas* , double , double  )
17958```
17959
17960**Description**
17961
17962Draws text from the upper left corner at a specified position. This function must be called after [OH_Drawing_TypographyLayout](#oh_drawing_typographylayout) is called and applied.
17963
17964**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17965
17966**Since**: 8
17967
17968**Parameters**
17969
17970| Name                  | Description                                                  |
17971| --------------------- | ------------------------------------------------------------ |
17972| OH_Drawing_Typography | Pointer to an **OH_Drawing_Typography** object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17973| OH_Drawing_Canvas     | Pointer to an **OH_Drawing_Canvas** object, which is obtained by calling **OH_Drawing_CanvasCreate()**. |
17974| double                | X coordinate.                                                |
17975| double                | Y coordinate.                                                |
17976
17977
17978### OH_Drawing_TypographySetIndents()
17979
17980```
17981void OH_Drawing_TypographySetIndents (OH_Drawing_Typography* , int , const float indents[] )
17982```
17983
17984**Description**
17985
17986Sets indents for typography. If this function is not called, texts will have no indentation applied.
17987
17988**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
17989
17990**Since**: 12
17991
17992**Parameters**
17993
17994| Name                  | Description                                                  |
17995| --------------------- | ------------------------------------------------------------ |
17996| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
17997| int                   | Number of indents. The value must be less than or equal to the length of the indents array to avoid display exceptions caused by access to the out-of-bounds array. |
17998| float                 | Pointer to a floating-point array, in which each element indicates an indentation width, in px. Before using [OH_Drawing_Typography](#oh_drawing_typography), you must declare and initialize the floating-point array. |
17999
18000
18001### OH_Drawing_TypographyStyleDestroyStrutStyle()
18002
18003```
18004void OH_Drawing_TypographyStyleDestroyStrutStyle (OH_Drawing_StrutStyle* )
18005```
18006
18007**Description**
18008
18009Reclaims the memory occupied by a strut style.
18010
18011**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18012
18013**Since**: 12
18014
18015**Parameters**
18016
18017| Name                                                     | Description                                                  |
18018| -------------------------------------------------------- | ------------------------------------------------------------ |
18019| [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) | Pointer to an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object, which is obtained by calling [OH_Drawing_TypographyStyleGetStrutStyle](#oh_drawing_typographystylegetstrutstyle). |
18020
18021
18022### OH_Drawing_TypographyStyleEquals()
18023
18024```
18025bool OH_Drawing_TypographyStyleEquals (OH_Drawing_TypographyStyle* from, OH_Drawing_TypographyStyle* to )
18026```
18027
18028**Description**
18029
18030Checks whether two typography styles are the same. The text height modifier mode [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior) is not involved in the comparison.
18031
18032**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18033
18034**Since**: 12
18035
18036**Parameters**
18037
18038| Name | Description                             |
18039| ---- | --------------------------------------- |
18040| from | Pointer to the first typography style.  |
18041| to   | Pointer to the second typography style. |
18042
18043**Returns**
18044
18045Returns **true** if the two are the same; returns **false** otherwise.
18046
18047
18048### OH_Drawing_TypographyStyleGetEffectiveAlignment()
18049
18050```
18051OH_Drawing_TextAlign OH_Drawing_TypographyStyleGetEffectiveAlignment (OH_Drawing_TypographyStyle* style)
18052```
18053
18054**Description**
18055
18056Obtains the text alignment mode.
18057
18058**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18059
18060**Since**: 12
18061
18062**Parameters**
18063
18064| Name                       | Description                                                  |
18065| -------------------------- | ------------------------------------------------------------ |
18066| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18067
18068**Returns**
18069
18070Returns the text alignment mode. For details about the available options, see [OH_Drawing_TextAlign](#oh_drawing_textalign).
18071
18072
18073### OH_Drawing_TypographyStyleGetFontStyleStruct()
18074
18075```
18076OH_Drawing_FontStyleStruct OH_Drawing_TypographyStyleGetFontStyleStruct (OH_Drawing_TypographyStyle* drawingStyle)
18077```
18078
18079**Description**
18080
18081Obtains the font style, including the font weight, width, and slant, of the default text style of a typography style.
18082
18083**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18084
18085**Since**: 12
18086
18087**Parameters**
18088
18089| Name                       | Description                                                  |
18090| -------------------------- | ------------------------------------------------------------ |
18091| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18092
18093**Returns**
18094
18095Returns the font style, including the font weight, width, and slant.
18096
18097
18098### OH_Drawing_TypographyStyleGetStrutStyle()
18099
18100```
18101OH_Drawing_StrutStyle* OH_Drawing_TypographyStyleGetStrutStyle (OH_Drawing_TypographyStyle* )
18102```
18103
18104**Description**
18105
18106Obtains the strut style of a typography style.
18107
18108**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18109
18110**Since**: 12
18111
18112**Parameters**
18113
18114| Name                       | Description                                                  |
18115| -------------------------- | ------------------------------------------------------------ |
18116| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18117
18118**Returns**
18119
18120Returns the pointer to the strut style, which is an [OH_Drawing_StrutStyle](_o_h___drawing___strut_style.md) object.
18121
18122
18123### OH_Drawing_TypographyStyleIsHintEnabled()
18124
18125```
18126bool OH_Drawing_TypographyStyleIsHintEnabled (OH_Drawing_TypographyStyle* style)
18127```
18128
18129**Description**
18130
18131Checks whether font hinting is enabled for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.
18132
18133**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18134
18135**Since**: 12
18136
18137**Parameters**
18138
18139| Name                       | Description                                                  |
18140| -------------------------- | ------------------------------------------------------------ |
18141| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18142
18143**Returns**
18144
18145Returns **true** if font hinting is enabled; returns **false** otherwise.
18146
18147
18148### OH_Drawing_TypographyStyleSetHintsEnabled()
18149
18150```
18151void OH_Drawing_TypographyStyleSetHintsEnabled (OH_Drawing_TypographyStyle* style, bool hintsEnabled )
18152```
18153
18154**Description**
18155
18156Sets whether to enable font hinting for a typography style. Font hinting is used to improve the readability and appearance of small-sized text when rendering it.
18157
18158**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18159
18160**Since**: 12
18161
18162**Parameters**
18163
18164| Name                       | Description                                                  |
18165| -------------------------- | ------------------------------------------------------------ |
18166| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18167| hintsEnabled               | Whether to enable font hinting. The value **true** means to enable font hinting, and **false** means the opposite. |
18168
18169
18170### OH_Drawing_TypographyStyleStrutStyleEquals()
18171
18172```
18173bool OH_Drawing_TypographyStyleStrutStyleEquals (OH_Drawing_StrutStyle* from, OH_Drawing_StrutStyle* to )
18174```
18175
18176**Description**
18177
18178Checks whether two strut styles are equal.
18179
18180**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18181
18182**Since**: 12
18183
18184**Parameters**
18185
18186| Name | Description                        |
18187| ---- | ---------------------------------- |
18188| from | Pointer to the first strut style.  |
18189| to   | Pointer to the second strut style. |
18190
18191**Returns**
18192
18193Returns **true** if the two strut styles are the same; returns **false** otherwise.
18194
18195### OH_Drawing_TypographyTextGetHeightBehavior()
18196
18197```
18198OH_Drawing_TextHeightBehavior OH_Drawing_TypographyTextGetHeightBehavior (OH_Drawing_TypographyStyle* )
18199```
18200
18201**Description**
18202
18203Obtains the text height modifier pattern.
18204
18205**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18206
18207**Since**: 12
18208
18209**Parameters**
18210
18211| Name                       | Description                                                  |
18212| -------------------------- | ------------------------------------------------------------ |
18213| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18214
18215**Returns**
18216
18217Returns the text height modifier pattern. For details about the available options, see [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior).
18218
18219
18220### OH_Drawing_TypographyTextGetLineStyle()
18221
18222```
18223bool OH_Drawing_TypographyTextGetLineStyle (OH_Drawing_TypographyStyle* )
18224```
18225
18226**Description**
18227
18228Checks whether the text line style is enabled for a typography style.
18229
18230**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18231
18232**Since**: 12
18233
18234**Parameters**
18235
18236| Name                       | Description                                                  |
18237| -------------------------- | ------------------------------------------------------------ |
18238| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18239
18240**Returns**
18241
18242Returns **true** if the text line style is enabled; returns **false** otherwise.
18243
18244
18245### OH_Drawing_TypographyTextlineGetStyleOnly()
18246
18247```
18248bool OH_Drawing_TypographyTextlineGetStyleOnly (OH_Drawing_TypographyStyle* )
18249```
18250
18251**Description**
18252
18253Checks whether only the text line style is enabled for a typography style.
18254
18255**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18256
18257**Since**: 12
18258
18259**Parameters**
18260
18261| Name                       | Description                                                  |
18262| -------------------------- | ------------------------------------------------------------ |
18263| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18264
18265**Returns**
18266
18267Returns **true** if only the text line style is enabled; returns **false** otherwise.
18268
18269
18270### OH_Drawing_TypographyTextlineStyleDestroyFontFamilies()
18271
18272```
18273void OH_Drawing_TypographyTextlineStyleDestroyFontFamilies (char** fontFamilies, size_t fontFamiliesNum )
18274```
18275
18276**Description**
18277
18278Reclaims the memory occupied by the font families.
18279
18280**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18281
18282**Since**: 12
18283
18284**Parameters**
18285
18286| Name            | Description                          |
18287| --------------- | ------------------------------------ |
18288| fontFamilies    | Double pointer to the font families. |
18289| fontFamiliesNum | Number of font families.             |
18290
18291
18292### OH_Drawing_TypographyTextlineStyleGetFontFamilies()
18293
18294```
18295char** OH_Drawing_TypographyTextlineStyleGetFontFamilies (OH_Drawing_TypographyStyle* , size_t* num)
18296```
18297
18298**Description**
18299
18300Obtains the font families of a text line style.
18301
18302**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18303
18304**Since**: 12
18305
18306**Parameters**
18307
18308| Name                       | Description                                                  |
18309| -------------------------- | ------------------------------------------------------------ |
18310| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18311| num | Pointer to the number of font families. |
18312
18313**Returns**
18314
18315Returns the font families.
18316
18317
18318### OH_Drawing_TypographyTextlineStyleGetFontSize()
18319
18320```
18321double OH_Drawing_TypographyTextlineStyleGetFontSize (OH_Drawing_TypographyStyle* )
18322```
18323
18324**Description**
18325
18326Obtains the font size of a text line style.
18327
18328**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18329
18330**Since**: 12
18331
18332**Parameters**
18333
18334| Name                       | Description                                                  |
18335| -------------------------- | ------------------------------------------------------------ |
18336| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18337
18338**Returns**
18339
18340Returns the font size.
18341
18342
18343### OH_Drawing_TypographyTextlineStyleGetFontStyle()
18344
18345```
18346OH_Drawing_FontStyle OH_Drawing_TypographyTextlineStyleGetFontStyle (OH_Drawing_TypographyStyle* )
18347```
18348
18349**Description**
18350
18351Obtains the font style of the strut style in a typography style.
18352
18353**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18354
18355**Since**: 12
18356
18357**Parameters**
18358
18359| Name                       | Description                                                  |
18360| -------------------------- | ------------------------------------------------------------ |
18361| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18362
18363**Returns**
18364
18365Returns the font style. For details about the available options, see [OH_Drawing_FontStyle](#oh_drawing_fontstyle).
18366
18367
18368### OH_Drawing_TypographyTextlineStyleGetFontWeight()
18369
18370```
18371OH_Drawing_FontWeight OH_Drawing_TypographyTextlineStyleGetFontWeight (OH_Drawing_TypographyStyle*)
18372```
18373
18374**Description**
18375
18376Obtains the font weight of the strut style in a typography style.
18377
18378**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18379
18380**Since**: 12
18381
18382**Parameters**
18383
18384| Name                       | Description                                                  |
18385| -------------------------- | ------------------------------------------------------------ |
18386| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18387
18388**Returns**
18389
18390Returns the font weight. For details about the available options, see [OH_Drawing_FontWeight](#oh_drawing_fontweight).
18391
18392
18393### OH_Drawing_TypographyTextlineStyleGetHalfLeading()
18394
18395```
18396bool OH_Drawing_TypographyTextlineStyleGetHalfLeading (OH_Drawing_TypographyStyle* )
18397```
18398
18399**Description**
18400
18401Checks whether half leading is enabled for a text line style.
18402
18403**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18404
18405**Since**: 12
18406
18407**Parameters**
18408
18409| Name                       | Description                                                  |
18410| -------------------------- | ------------------------------------------------------------ |
18411| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18412
18413**Returns**
18414
18415Returns **true** if half leading is enabled; returns **false** otherwise.
18416
18417
18418### OH_Drawing_TypographyTextlineStyleGetHeightOnly()
18419
18420```
18421bool OH_Drawing_TypographyTextlineStyleGetHeightOnly (OH_Drawing_TypographyStyle* )
18422```
18423
18424**Description**
18425
18426Checks whether only the font height is used for a text line style.
18427
18428**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18429
18430**Since**: 12
18431
18432**Parameters**
18433
18434| Name                       | Description                                                  |
18435| -------------------------- | ------------------------------------------------------------ |
18436| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18437
18438**Returns**
18439
18440Returns **true** if only the font height is used; returns false otherwise.
18441
18442
18443### OH_Drawing_TypographyTextlineStyleGetHeightScale()
18444
18445```
18446double OH_Drawing_TypographyTextlineStyleGetHeightScale (OH_Drawing_TypographyStyle* )
18447```
18448
18449**Description**
18450
18451Obtains the height scale factor of a text line style.
18452
18453**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18454
18455**Since**: 12
18456
18457**Parameters**
18458
18459| Name                       | Description                                                  |
18460| -------------------------- | ------------------------------------------------------------ |
18461| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18462
18463**Returns**
18464
18465Returns the height scale factor.
18466
18467
18468### OH_Drawing_TypographyTextlineStyleGetSpacingScale()
18469
18470```
18471double OH_Drawing_TypographyTextlineStyleGetSpacingScale (OH_Drawing_TypographyStyle* )
18472```
18473
18474**Description**
18475
18476Obtains the spacing scale factor of a text line style.
18477
18478**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18479
18480**Since**: 12
18481
18482**Parameters**
18483
18484| Name                       | Description                                                  |
18485| -------------------------- | ------------------------------------------------------------ |
18486| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18487
18488**Returns**
18489
18490Returns the spacing scale factor.
18491
18492
18493### OH_Drawing_TypographyTextSetHeightBehavior()
18494
18495```
18496void OH_Drawing_TypographyTextSetHeightBehavior (OH_Drawing_TypographyStyle* , OH_Drawing_TextHeightBehavior heightMode )
18497```
18498
18499**Description**
18500
18501Sets a text height modifier pattern.
18502
18503**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18504
18505**Since**: 12
18506
18507**Parameters**
18508
18509| Name                       | Description                                                  |
18510| -------------------------- | ------------------------------------------------------------ |
18511| OH_Drawing_TypographyStyle | Pointer to an [OH_Drawing_TypographyStyle](#oh_drawing_typographystyle) object, which is obtained by calling [OH_Drawing_CreateTypographyStyle](#oh_drawing_createtypographystyle). |
18512| heightMode                 | Text height modifier pattern. For details about the available options, see [OH_Drawing_TextHeightBehavior](#oh_drawing_textheightbehavior). |
18513
18514
18515### OH_Drawing_TypographyUpdateFontSize()
18516
18517```
18518void OH_Drawing_TypographyUpdateFontSize (OH_Drawing_Typography* , size_t from, size_t to, float fontSize )
18519```
18520
18521**Description**
18522
18523Updates the font size in a typography object.
18524
18525**System capability**: SystemCapability.Graphic.Graphic2D.NativeDrawing
18526
18527**Since**: 12
18528
18529**Parameters**
18530
18531| Name                  | Description                                                  |
18532| --------------------- | ------------------------------------------------------------ |
18533| OH_Drawing_Typography | Pointer to an [OH_Drawing_Typography](#oh_drawing_typography) object, which is obtained by calling [OH_Drawing_CreateTypography](#oh_drawing_createtypography). |
18534| from                  | Reserved field, which is not used.                           |
18535| to                    | Reserved field, which is not used.                           |
18536| fontSize              | New font size.                                               |