From 1ec9672ab556bab00597369926490a650d97f5bb Mon Sep 17 00:00:00 2001 From: zyb Date: Thu, 13 Mar 2025 14:28:55 +0800 Subject: [PATCH 1/2] Add the enum of TextFallBackFontStyle and the interface of SetTextStyleFallBackFontStyle --- .../native_drawing/drawing_text_typography.h | 25 +++++++++++++++++++ 1 file changed, 25 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..e82d3de26 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -634,6 +634,20 @@ typedef struct { char** families; } OH_Drawing_StrutStyle; +/** + * @brief The fall back font style of text. + * + * @since 20 + * @version 1.0 + */ +enum OH_Drawing_TextFallBackFontStyle { + TEXT_FONT_FALL_BACK_NORMAL,// default + TEXT_FONT_FALL_BACK_SERIF, + TEXT_FONT_FALL_BACK_SANS, + TEXT_FONT_FALL_BACK_MONO, + TEXT_FONT_FAIL_BACK_BUTT +}; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * @@ -2888,6 +2902,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 + */ +OH_Drawing_SetTextStyleFallBackFontStyle(OH_Drawing_TextStyle* style, OH_Drawing_TextFallBackFontStyle fallBackFontStyle); + /** * @brief Get DrawingArray size. * -- Gitee From b24308b741d16139128d8e816dbfb861368e4313 Mon Sep 17 00:00:00 2001 From: zyb Date: Thu, 13 Mar 2025 14:28:55 +0800 Subject: [PATCH 2/2] Add the enum of TextFallBackFontStyle and the interface of SetTextStyleFallBackFontStyle --- .../native_drawing/drawing_text_typography.h | 25 +++++++++++++++++++ 1 file changed, 25 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..d4024130e 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -634,6 +634,20 @@ typedef struct { char** families; } OH_Drawing_StrutStyle; +/** + * @brief The fall back font style of text. + * + * @since 20 + * @version 1.0 + */ +enum OH_Drawing_TextFallBackFontStyle { + TEXT_FONT_FALL_BACK_NORMAL, // default + TEXT_FONT_FALL_BACK_SERIF, + TEXT_FONT_FALL_BACK_SANS, + TEXT_FONT_FALL_BACK_MONO, + TEXT_FONT_FAIL_BACK_BUTT +}; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * @@ -2888,6 +2902,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 + */ +OH_Drawing_SetTextStyleFallBackFontStyle(OH_Drawing_TextStyle* style, OH_Drawing_TextFallBackFontStyle fallBackFontStyle); + /** * @brief Get DrawingArray size. * -- Gitee