From 2ff7350a8433571882d0a4bc2e7a8fcbf5317405 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 8 Mar 2024 09:10:56 +0000 Subject: [PATCH] =?UTF-8?q?!389=20=E5=AD=97=E4=BD=93=E6=96=B0=E5=A2=9Endk?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 145 ++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 52 +++++++ 2 files changed, 197 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 6899fed88..e911f8512 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1684,6 +1684,151 @@ float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); */ void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); +/** + * @brief Gets the text color. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the text color. + * @since 12 + * @version 1.0 + */ +uint32_t OH_Drawing_TextStyleGetColor(OH_Drawing_TextStyle*); + +/** + * @brief Gets text decoration style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns text decoration style. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextDecorationStyle OH_Drawing_TextStyleGetDecorationStyle(OH_Drawing_TextStyle*); + +/** + * @brief Gets font weight. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns font Weight. + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontWeight OH_Drawing_TextStyleGetFontWeight(OH_Drawing_TextStyle*); + +/** + * @brief Gets font style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns font style. + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontStyle OH_Drawing_TextStyleGetFontStyle(OH_Drawing_TextStyle*); + +/** + * @brief Gets the font baseline. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the font baseline. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextBaseline OH_Drawing_TextStyleGetBaseline(OH_Drawing_TextStyle*); + +/** + * @brief Gets a list of font families. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param num Indicates count of font families result. + * @return Returns a list of font families. + * @since 12 + * @version 1.0 + */ +char** OH_Drawing_TextStyleGetFontFamilies(OH_Drawing_TextStyle*, size_t* num); + +/** + * @brief Releases the memory occupied by a list of font families. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param fontFamilies Indicates the pointer to a list of font families. + * @param num Indicates the count of obtained font families. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleDestroyFontFamilies(char** fontFamilies, size_t num); + +/** + * @brief Gets font size. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns font size. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TextStyleGetFontSize(OH_Drawing_TextStyle*); + +/** + * @brief Gets the letter spacing of the text. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the size of the letter spacing. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TextStyleGetLetterSpacing(OH_Drawing_TextStyle*); + +/** + * @brief Gets the word spacing of the text. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns word spacing size. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TextStyleGetWordSpacing(OH_Drawing_TextStyle*); + +/** + * @brief Gets font height. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns font height. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TextStyleGetFontHeight(OH_Drawing_TextStyle*); + +/** + * @brief Gets whether to set the text to half line spacing. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns true indicates that the spacing takes effect, false indicates that the spacing does not take effect. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle*); + +/** + * @brief Gets the locale. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns a locale of data type as a pointer to a char. As with the TextStyle lifecycle. + * No release is required and the return value is invalidated after the set method is called. + * @since 12 + * @version 1.0 + */ +const char* OH_Drawing_TextStyleGetLocale(OH_Drawing_TextStyle*); + #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 165a808af..513b81734 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -577,6 +577,58 @@ { "first_introduced": "12", "name": "OH_Drawing_CreateSharedFontCollection" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetColor" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetDecorationStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontWeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetBaseline" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontFamilies" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleDestroyFontFamilies" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontSize" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetLetterSpacing" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetWordSpacing" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontHeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetHalfLeading" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetLocale" } ] \ No newline at end of file -- Gitee