diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 6899fed889683b9e19b88d8452c1e020c41f86ce..54f99f6a2ca4f095b35fa9bbf76c07e479accd6a 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 e076cd829af17a63caeda7107214f27e9fc6d99b..9f769abafc65c3702ad271401c895db2e62b463c 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -573,6 +573,54 @@ { "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