From 37ee94eeaec4616e6842f7c4be729db5a8006070 Mon Sep 17 00:00:00 2001 From: zyb Date: Thu, 13 Mar 2025 15:02:26 +0800 Subject: [PATCH] Add the enum of TextFallBackFontStyle and the interface of SetTextStyleFallBackFontStyle --- .../native_drawing/drawing_text_typography.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 966621728..6908a27f4 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -634,6 +634,23 @@ typedef struct { char** families; } OH_Drawing_StrutStyle; +/** + * @brief The fall back font style of text. + * + * @since 20 + * @version 1.0 + */ +enum OH_Drawing_TextFallBackFontStyle { + /*default font style*/ + TEXT_FONT_FALL_BACK_NORMAL, + /*serif font font style*/ + TEXT_FONT_FALL_BACK_SERIF, + /*sans serif font style*/ + TEXT_FONT_FALL_BACK_SANS, + /*monospaced font style*/ + TEXT_FONT_FALL_BACK_MONO +}; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * @@ -2888,6 +2905,17 @@ float OH_Drawing_GetTextTabLocation(OH_Drawing_TextTab* tab); */ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawing_TextTab* tab); +/** + * @brief Sets the fall back font style of OH_Drawing_TextStyle object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param style Indicates the pointer to an OH_Drawing_TextStyle object. + * @param fallBackFontStyle Indicates the fall back font style to set. For details, see the enum OH_Drawing_TextFallBackFontStyle. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_SetTextStyleFallBackFontStyle(OH_Drawing_TextStyle* style, OH_Drawing_TextFallBackFontStyle fallBackFontStyle); + /** * @brief Get DrawingArray size. * -- Gitee