diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 542012e2af96ab4602bfab5555598f97724a156b..a6cc5784a69ec9d1856cd3be4c17cec2f8731251 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -122,6 +122,14 @@ typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; */ typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow; +/** + * @brief Defines an OH_Drawing_RectStyle, which is used to create an OH_Drawing_RectStyle object. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_RectStyle OH_Drawing_RectStyle; + #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 6899fed889683b9e19b88d8452c1e020c41f86ce..537fa6b13919f842cbbc54f2fa1c27ed2d9452f2 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1684,6 +1684,127 @@ float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); */ void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); +/** + * @brief Creates an OH_Drawing_RectStyle object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_RectStyle object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_RectStyle* OH_Drawing_CreateRectStyle(void); + +/** + * @brief Releases the memory occupied by an OH_Drawing_RectStyle object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_RectStyle Indicates the pointer to an OH_Drawing_RectStyle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyRectStyle(OH_Drawing_RectStyle*); + +/** + * @brief Sets the background rect and styleId. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_RectStyle Indicates the pointer to an OH_Drawing_RectStyle object. + * @param int Indicates the styleId to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleSetBackgroundRect(OH_Drawing_TextStyle*, OH_Drawing_RectStyle*, int); + +/** + * @brief Adds the symbol. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyCreate Indicates the pointer to an OH_Drawing_TypographyCreate object. + * @param uint32_t Indicates the symbol to add. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TypographyHandlerAddSymbol(OH_Drawing_TypographyCreate*, uint32_t); + +/** + * @brief Sets features in fontfeatures of textstyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param char Indicates the pointer to the tag to set. + * @param int Indicates the value to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleSetFeature(OH_Drawing_TextStyle*, const char*, int); + +/** + * @brief Gets value with key in fontfeatures. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param char Indicates the pointer to the key of fontfeature in map. + * @return Returns the value of the key in map. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_TextStyleGetFeature(OH_Drawing_TextStyle*, const char*); + +/** + * @brief Gets all elements in fontfeatures map. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return char Indicates the pointer to the string in Json of all elements in fontfeatures map. + * @since 12 + * @version 1.0 + */ +char* OH_Drawing_TextStyleGetFeatures(OH_Drawing_TextStyle*); + +/** + * @brief Gets size of fontfeatures map. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the size of fontfeatures map. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_TextStyleGetFeaturesSize(OH_Drawing_TextStyle*); + +/** + * @brief Clear elements in fontfeatures map. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleClearFeatures(OH_Drawing_TextStyle*); + +/** + * @brief Sets the base line shift. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param double Indicates the baseline shift to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleSetBaseLineShift(OH_Drawing_TextStyle*, double); + +/** + * @brief Gets the base line shift. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the baseline shift. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TextStyleGetBaseLineShift(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..145a75992e8530b0ad3344a8f64f0136df352c79 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -573,6 +573,49 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextFontHeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_CreateRectStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyRectStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleSetBackgroundRect" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyHandlerAddSymbol" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleSetFeature" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFeature" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFeatures" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFeaturesSize" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleClearFeatures" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetBaseLineShift" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleSetBaseLineShift" } - ] \ No newline at end of file