From 4925891dacaa7763a10a7a17cc4bf43fc93d1743 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 7 Mar 2024 07:58:34 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=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 | 133 ++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 49 ++++++- 2 files changed, 181 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 6899fed88..54f99f6a2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1684,6 +1684,139 @@ float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); */ void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); +/** + * @brief Get text color. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Return text color. + * @since 12 + * @version 1.0 + */ +uint32_t OH_Drawing_GetTextStyleColor(OH_Drawing_TextStyle*); + +/** + * @brief Gets the text decoration style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns the text decoration style. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_GetTextStyleDecorationStyle(OH_Drawing_TextStyle*); + +/** + * @brief Get Font weight. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Return Font Weight. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_GetTextStyleFontWeight(OH_Drawing_TextStyle*); + +/** + * @brief Get Font style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Return Font style. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_GetTextStyleFontStyle(OH_Drawing_TextStyle*); + +/** + * @brief Gets the font baseline position. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns the font baseline position. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_GetTextStyleBaseLine(OH_Drawing_TextStyle*); + +/** + * @brief Get font type. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param size_t Number of font names. + * @return Returns an array of font type strings. + * @since 12 + * @version 1.0 + */ +char** OH_Drawing_GetTextStyleFontFamilies(OH_Drawing_TextStyle*, size_t* num); + +/** + * @brief Get font size. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Return font size. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_GetTextStyleFontSize(OH_Drawing_TextStyle*); + +/** + * @brief Gets the character spacing of the text. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns the size of the character spacing. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_GetTextStyleLetterSpacing(OH_Drawing_TextStyle*); + +/** + * @brief Gets the word spacing of the text. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns word spacing size. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_GetTextStyleWordSpacing(OH_Drawing_TextStyle*); + +/** + * @brief Get font height. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Return font height. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_GetTextStyleFontHeight(OH_Drawing_TextStyle*); + +/** + * @brief Gets whether to set the text to half line spacing. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return true indicates that the spacing takes effect;false indicates that the spacing does not take effect + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_GetTextStyleHalfLeading(OH_Drawing_TextStyle*); + +/** + * @brief Get locale. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns a locale of data type as a pointer to a char + * @since 12 + * @version 1.0 + */ +const char* OH_Drawing_GetTextStyleLocale(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 e076cd829..010b1d44f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -573,6 +573,53 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextFontHeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleColor" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleDecorationStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontWeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleBaseLine" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontFamilies" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontSize" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleLetterSpacing" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleWordSpacing" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontHeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleHalfLeading" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleLocale" } - ] \ No newline at end of file -- Gitee From b15a41e85a10cdc72c9ed97118eb908665ff5b57 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 7 Mar 2024 08:11:49 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 010b1d44f..3b9cbf917 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -622,4 +622,5 @@ "first_introduced": "12", "name": "OH_Drawing_GetTextStyleLocale" } + ] \ No newline at end of file -- Gitee From 879c6940a994f5e563111cf7b5edae5d4adfbdeb Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 7 Mar 2024 09:08:27 +0000 Subject: [PATCH 3/3] =?UTF-8?q?json=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3b9cbf917..9f769abaf 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -622,5 +622,5 @@ "first_introduced": "12", "name": "OH_Drawing_GetTextStyleLocale" } - + ] \ No newline at end of file -- Gitee