From e0aa748f1cc7a0b2baed69cb193782ca4be56609 Mon Sep 17 00:00:00 2001 From: PengKejie Date: Mon, 19 Aug 2024 19:34:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3OH=5FDrawin?= =?UTF-8?q?g=5FTypographyGetLongestLineWithIndent=EF=BC=8C=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=B8=A6=E6=9C=89=E7=BC=A9=E8=BF=9B=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E9=95=BF=E8=A1=8C=E5=AE=BD=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PengKejie (cherry picked from commit 476764a78b02309e0ec27316878fa7c5608062a9) --- .../native_drawing/drawing_text_typography.h | 14 ++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 355635ea1..1fa3e610c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1028,6 +1028,20 @@ double OH_Drawing_TypographyGetHeight(OH_Drawing_Typography*); */ double OH_Drawing_TypographyGetLongestLine(OH_Drawing_Typography*); +/** + * @brief Obtains the width of the longest line with indent. You are advised to + * round up the return value in actual use. When the text content is empty, the + * minimum float value, that is, 0.0, is returned. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Pointer to an OH_Drawing_Typography object, which is obtained by + * {@link OH_Drawing_CreateTypography}. + * @return Returns the width of the longest line with indent. + * @since 13 + * @version 1.1 + */ +double OH_Drawing_TypographyGetLongestLineWithIndent(OH_Drawing_Typography*); + /** * @brief Gets the min intrinsic width. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 5f0503977..dcf8e09f9 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -699,6 +699,10 @@ { "name": "OH_Drawing_TypographyGetMaxWidth" }, { "name": "OH_Drawing_TypographyGetHeight" }, { "name": "OH_Drawing_TypographyGetLongestLine" }, + { + "first_introduced": "13", + "name": "OH_Drawing_TypographyGetLongestLineWithIndent" + }, { "name": "OH_Drawing_TypographyGetMinIntrinsicWidth" }, { "name": "OH_Drawing_TypographyGetMaxIntrinsicWidth" }, { "name": "OH_Drawing_TypographyGetAlphabeticBaseline" }, -- Gitee