From 09f732f68f6b2e84d93b2409c53b46cea56591b6 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 21 Mar 2024 05:46:50 +0000 Subject: [PATCH] add ndk about font metric Signed-off-by: changleipeng Change-Id: Ia4c1772d47192ae671646e5bc82d5959eaa11724 --- .../native_drawing/drawing_text_typography.h | 23 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 9 +++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 6899fed88..7f5676fda 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1684,6 +1684,29 @@ float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); */ void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); +/** + * @brief Releases the memory occupied by vector with the text shadow object OH_Drawing_TextShadow. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography A pointer to a typesetting object + * @param lineNumber The specific number of rows you need to get, starting at one + * @param charNumber Gets the number of words that the current row has + * @param success Marks the success of this information acquisition + * @return Returns the first address to the current font metrics + * @since 12 + * @version 1.0 + */ +OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typography* typography, size_t lineNumber, + size_t* charNumber, bool* success); + +/** + * @brief Free up all the space taken up by the lineFontMetric + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param lineFontMetric The first address of the lineFontMetric gather to be destroyed + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyFontMetrics(OH_Drawing_Font_Metrics* lineFontMetric); #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 d8586b349..6d8001137 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -585,6 +585,13 @@ { "first_introduced": "12", "name": "OH_Drawing_CreateSharedFontCollection" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetLineFontMetrics" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyFontMetrics" } - ] \ No newline at end of file -- Gitee