diff --git a/graphic/graphic_2d/native_drawing/drawing_text_run.h b/graphic/graphic_2d/native_drawing/drawing_text_run.h index 8873eaaf23e7389d04a20395f7281ebdd6a0ba39..cd9dff6ea2fdb187fd1547507b679bf408314914 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,59 @@ void OH_Drawing_DestroyRunPositions(OH_Drawing_Array* positions); * @since 18 */ uint32_t OH_Drawing_GetRunGlyphCount(OH_Drawing_Run* run); + +/** + * @brief Gets the Font Object of run. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param run Indicates the pointer to an OH_Drawing_Run object. + * @return The Font Object of run. + * @since 20 + * @version 1.0 + */ +OH_Drawing_Font* OH_Drawing_GetRunFont(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 glyph advance array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param run Indicates the pointer to an OH_Drawing_Run object. + * @param start The run of start index. + * @param length The run of length, if start and length are set to 0, then get all of the current run. + * @return Indicates the pointer to the glyph advance array object OH_Drawing_Array. + * @since 20 + */ +OH_Drawing_Array* OH_Drawing_GetRunGlyphAdvances(OH_Drawing_Run* run, uint32_t start, uint32_t length); + +/** + * @brief Gets the glyph advance by index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param advances The glyph advance array object OH_Drawing_Array. + * @param index The run of glyph index. + * @return Run of glyph advance pointer to an OH_Drawing_Point object. + * @since 20 + */ +OH_Drawing_Point* OH_Drawing_GetRunGlyphAdvanceByIndex(OH_Drawing_Array* advances, size_t index); + +/** + * @brief Releases the memory of glyph advance array. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param advances The run of glyph advance array object OH_Drawing_Array. + * @since 20 + */ +void OH_Drawing_DestroyRunGlyphAdvances(OH_Drawing_Array* advances); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 8a704ced57b0a924345ff14edaf9a85fba79c2ad..712747bca85e43007ad4858db6212862ab0ad5cd 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -2683,6 +2683,17 @@ void OH_Drawing_TypographyUpdateDecorationThicknessScale(OH_Drawing_Typography* void OH_Drawing_TypographyUpdateDecorationStyle(OH_Drawing_Typography* typography, OH_Drawing_TextDecorationStyle decorationStyle); +/** + * @brief Updates the decoration color of the paragraph. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param color Indicates the text decoration color to update. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyUpdateDecorationColor(OH_Drawing_Typography* typography, uint32_t color); + /** * @brief Get whether the text layout enables line styles. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index cf09449993e400c5c5665db5c6463a6c9d7d9634..7fa26533164493ac2a85e4a97d92d3bafd3de529 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1534,6 +1534,10 @@ "first_introduced": "20", "name": "OH_Drawing_TypographyUpdateDecorationStyle" }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyUpdateDecorationColor" + }, { "first_introduced": "12", "name": "OH_Drawing_TypographyTextGetLineStyle" @@ -1834,10 +1838,30 @@ "first_introduced": "18", "name":"OH_Drawing_GetRunGlyphCount" }, + { + "first_introduced": "20", + "name":"OH_Drawing_GetRunTextDirection" + }, + { + "first_introduced": "20", + "name":"OH_Drawing_GetRunGlyphAdvances" + }, + { + "first_introduced": "20", + "name":"OH_Drawing_GetRunGlyphAdvanceByIndex" + }, + { + "first_introduced": "20", + "name":"OH_Drawing_DestroyRunGlyphAdvances" + }, { "first_introduced": "14", "name":"OH_Drawing_GetFontCollectionGlobalInstance" }, + { + "first_introduced": "20", + "name":"OH_Drawing_GetRunFont" + }, { "first_introduced": "18", "name":"OH_Drawing_CanvasQuickRejectPath"