diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index 8873eaaf23e7389d04a20395f7281ebdd6a0ba39..4c3be177904f755f56b60af1007ab40bd3de148f 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_run.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_run.h @@ -41,6 +41,7 @@ #define C_INCLUDE_DRAWING_TEXT_RUN_H #include "drawing_text_declaration.h" +#include "drawing_text_typography.h" #include "drawing_types.h" #ifdef __cplusplus @@ -208,6 +209,27 @@ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); * @since 18 */ uint32_t OH_Drawing_GetRunGlyphCount(OH_Drawing_Run* run); + +/** + * @brief Get the text direction. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param run Indicates the pointer to an OH_Drawing_Run object. + * @return Return the text direction of an OH_Drawing_TextDirection object. + * @since 20 + */ +OH_Drawing_TextDirection OH_Drawing_GetRunTextDirection(OH_Drawing_Run* run); + +/** + * @brief Gets the width of glyph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param glyphs The run of glyph array object OH_Drawing_Array. + * @param index The run of glyph index. + * @return The width of glyph. + * @since 20 + */ +uint16_t OH_Drawing_GetRunGlyphAdvanceByIndex(OH_Drawing_Array* glyphs, size_t index); #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 e13687d429e5ac4b5fe5f166a49471ba61797534..e4cc6f481ed244509bcbaae9fcea22e534cbf581 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1793,5 +1793,13 @@ { "first_introduced": "18", "name": "OH_Drawing_CanvasDrawPixelMapNine" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_GetRunTextDirection" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_GetRunGlyphAdvanceByIndex" } ] \ No newline at end of file