From e8c1e2e068ea529fbf22287545280be59be02af9 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Wed, 27 Nov 2024 15:36:43 +0800 Subject: [PATCH] =?UTF-8?q?Drawing=20ThemeFont=20=EF=BC=88cherry=20picked?= =?UTF-8?q?=20commit=20from=20=20Signed-off-b?= =?UTF-8?q?y:=20l00844999=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graphic_2d/native_drawing/drawing_font.h | 28 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 ++++++ 2 files changed, 36 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 364ffb886..11b9b6cf8 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -552,6 +552,34 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPathForGlyph(const OH_Drawing_Font* font, OH_Drawing_ErrorCode OH_Drawing_FontGetTextPath(const OH_Drawing_Font* font, const void* text, size_t byteLength, OH_Drawing_TextEncoding encoding, float x, float y, OH_Drawing_Path* path); +/** + * @brief Sets whether to follow the theme font first. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cFont Indicates the pointer to an OH_Drawing_Font object. + * @param followed Indicates whether to follow the theme font first. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cFont is nullptr. + * @since 16 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontSetThemeFontFollowed(OH_Drawing_Font* cFont, bool followed); + +/** + * @brief Gets whether to follow the theme font first. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cFont Indicates the pointer to an OH_Drawing_Font object. + * @param followed Indicates whether to follow the theme font first. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cFont or followed is nullptr. + * @since 16 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_FontIsThemeFontFollowed(const OH_Drawing_Font* cFont, bool* followed); + #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 a0ac4408f..b9a1fc45a 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -238,6 +238,10 @@ "first_introduced": "12", "name": "OH_Drawing_FontIsSubpixel" }, + { + "first_introduced": "16", + "name": "OH_Drawing_FontIsThemeFontFollowed" + }, { "first_introduced": "12", "name": "OH_Drawing_FontMeasureSingleCharacter" @@ -276,6 +280,10 @@ "first_introduced": "12", "name": "OH_Drawing_FontSetSubpixel" }, + { + "first_introduced": "16", + "name": "OH_Drawing_FontSetThemeFontFollowed" + }, { "first_introduced": "12", "name": "OH_Drawing_FontTextToGlyphs" -- Gitee