diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 38ea644f359e53892c949eb6f499df748d079975..b861683933e327eb431d698c3e0f2ff8848615be 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -497,6 +497,32 @@ typedef struct OH_Drawing_Font_Metrics { */ float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*); +/** + * @brief Retrieves the bound for each glyph in glyphs. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param glyphs Indicates the array of glyph indices to be measured. + * @param count Indicates the number of glyphs. + * @param bounds Indicates the bound for each glyph returned to the caller. + * @since 13 + * @version 1.0 + */ +void OH_Drawing_FontGetBounds(const OH_Drawing_Font*, const uint16_t* glyphs, int count, OH_Drawing_Rect* bounds); + +/** + * @brief create a path object of specified Glyph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Font Indicates the pointer to an OH_Drawing_Font object. + * @param glyph glyph index to be measured. + * @return Returns an OH_Drawing_Path object, must be release by OH_Drawing_PathDestroy + * Returns nullptr if OH_Drawing_Font is nullptr. + * @since 13 + * @version 1.0 + */ +OH_Drawing_Path* OH_Drawing_FontCreatePathForGlyph(OH_Drawing_Font*, uint16_t glyph); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index e07abff68df1f0ac2cd19ec03a9dacac6565144f..c3b5dfc004b153e6105447c631f0fc36f5b84b4c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -214,6 +214,40 @@ void OH_Drawing_RectCopy(OH_Drawing_Rect* src, OH_Drawing_Rect* dst); */ void OH_Drawing_RectDestroy(OH_Drawing_Rect*); +/** + * @brief Creates an array of OH_Drawing_Rect object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param size Indicates the size of the array + * @return Returns the pointer to the array OH_Drawing_Rect object created. + * Must be release by OH_Drawing_RectDestroyArray interface + * @since 13 + * @version 1.0 + */ +OH_Drawing_Rect* OH_Drawing_RectCreateArray(uint16_t size); + +/** + * @brief return the specified OH_Drawing_Rect object from array object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param rectArr Indicates the array object + * @param index Indicates the index of array, caller must make sure the index is valid. + * @return Returns the pointer to the array OH_Drawing_Rect object. + * @since 13 + * @version 1.0 + */ +OH_Drawing_Rect* OH_Drawing_RectGetArrayElement(OH_Drawing_Rect* rectArr, uint16_t index); + +/** + * @brief Destroys an array OH_Drawing_Rect object and reclaims the memory occupied by the object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Rect Indicates the pointer to an array OH_Drawing_Rect object. + * @since 13 + * @version 1.0 + */ +void OH_Drawing_RectDestroyArray(OH_Drawing_Rect*); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index f0d6835c1e41a25d9e5b1d28eff675a8e46fb7f0..3e2e1f913f9e63442c4b7459c29c92279527a53a 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1441,5 +1441,25 @@ { "first_introduced": "12", "name":"OH_Drawing_SetTextShadow" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_FontGetBounds" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_FontCreatePathForGlyph" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RectCreateArray" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RectGetArrayElement" + }, + { + "first_introduced": "13", + "name":"OH_Drawing_RectDestroyArray" } ] \ No newline at end of file