diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 8a704ced57b0a924345ff14edaf9a85fba79c2ad..e562fcd762f0b578f7e2e830072b4daacf9cd73b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -196,6 +196,11 @@ typedef enum { ALIGNMENT_BOTTOM_OF_ROW_BOX, /** Center of Row Box */ ALIGNMENT_CENTER_OF_ROW_BOX, + /** + * Follow paragraph setting + * @since 20 + */ + ALIGNMENT_FOLLOW_PARAGRAPH, } OH_Drawing_PlaceholderVerticalAlignment; /** @@ -592,6 +597,23 @@ typedef enum OH_Drawing_TextBadgeType { TEXT_SUBSCRIPT, } OH_Drawing_TextBadgeType; +/** + * @brief Type of vertical alignment. + * + * @since 20 + * @version 1.0 + */ +typedef enum OH_Drawing_TextVerticalAlignment { + /** Baseline of text line */ + TEXT_VERTICAL_ALIGNMENT_BASELINE, + /** Bottom of text line */ + TEXT_VERTICAL_ALIGNMENT_BOTTOM, + /** Center of text line */ + TEXT_VERTICAL_ALIGNMENT_CENTER, + /** Top of text line */ + TEXT_VERTICAL_ALIGNMENT_TOP +} OH_Drawing_TextVerticalAlignment; + /** * @brief Defines the font style struct. * @@ -2360,6 +2382,19 @@ double OH_Drawing_TextStyleGetFontHeight(OH_Drawing_TextStyle* style); */ bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle* style); +/** + * @brief Sets the typography vertical alignment mode. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param align Indicates the typography vertical alignment mode. For details, + * see the enum OH_Drawing_TextVerticalAlignment. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_SetTypographyVerticalAlignment(OH_Drawing_TypographyStyle* style, + OH_Drawing_TextVerticalAlignment align); + /** * @brief Gets the locale. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 5479d9f0f1f5343040e3867b24fc9252bd48fffe..1275bbab126a9a0133de6baba92398dd2f8f0bd3 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1917,5 +1917,9 @@ { "first_introduced": "20", "name": "OH_Drawing_SetTextUndefinedGlyphDisplay" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_SetTypographyVerticalAlignment" } ] \ No newline at end of file