diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index f08f8060c7eb196f680849341d2abc03547cda97..f9f741b2a343c0675b7a16f091496f4b1098d3bd 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -2621,6 +2621,54 @@ int32_t OH_Drawing_TypographyGetUnresolvedGlyphsCount(OH_Drawing_Typography* typ */ void OH_Drawing_TypographyUpdateFontSize(OH_Drawing_Typography* typography, size_t from, size_t to, float fontSize); +/** + * @brief Update the font color of the typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param color Indicates the color to update. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyUpdateFontColor(OH_Drawing_Typography* typography, uint32_t color); + +/** + * @brief Update the decoration of the typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param decoration Indicates the text decoration to update. For details, see the enum + * OH_Drawing_TextDecoration. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyUpdateDecoration(OH_Drawing_Typography* typography, OH_Drawing_TextDecoration decoration); + +/** + * @brief Update the decoration thickness scale of the typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param decorationThicknessScale Indicates the thickness scale of the text decoration to update. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyUpdateDecorationThicknessScale(OH_Drawing_Typography* typography, + double decorationThicknessScale); + +/** + * @brief Update the decoration style of the typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param typography Indicates the pointer to the text OH_Drawing_Typography object. + * @param decorationStyle Indicates the text decoration style to update. + * For details, see the enum OH_Drawing_TextDecorationStyle. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_TypographyUpdateDecorationStyle(OH_Drawing_Typography* typography, + OH_Drawing_TextDecorationStyle decorationStyle); + /** * @brief Get whether the text layout enables line styles. * @@ -2922,6 +2970,18 @@ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawi */ size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); +/** +* @brief Sets whether to optimize whitespace at the end of each line for text typography. +* +* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing +* @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. +* @param trailingSpaceOptimized Boolean value indicating whether to optimize whitespace at the end of each line +* for text typography to set. +* @since 20 +* @version 1.0 +*/ +void OH_Drawing_SetTypographyTextTrailingSpaceOptimized(OH_Drawing_TypographyStyle* style, bool trailingSpaceOptimized); + /** * @brief Set text badge type. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index d39f4f1c07184f84e0d55546bb74acde7b422bef..ba89b8f93675531c1e889088d91b8e7e9a198c05 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1470,6 +1470,22 @@ "first_introduced": "12", "name": "OH_Drawing_TypographyUpdateFontSize" }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyUpdateFontColor" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyUpdateDecoration" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyUpdateDecorationThicknessScale" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_TypographyUpdateDecorationStyle" + }, { "first_introduced": "12", "name": "OH_Drawing_TypographyTextGetLineStyle" @@ -1794,6 +1810,10 @@ "first_introduced": "18", "name": "OH_Drawing_CanvasDrawPixelMapNine" }, + { + "first_introduced": "20", + "name": "OH_Drawing_SetTypographyTextTrailingSpaceOptimized" + }, { "first_introduced": "20", "name": "OH_Drawing_SetTextStyleBadgeType"