From 83ea7d46e326f83c2935b6dcbe885c903355275b Mon Sep 17 00:00:00 2001 From: liuyongkai2 Date: Fri, 5 Sep 2025 19:13:51 +0800 Subject: [PATCH] =?UTF-8?q?Text=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=A4=A7=E5=B0=8F=E7=9A=84=E8=A1=8C=E9=AB=98?= =?UTF-8?q?=E5=92=8C=E8=A1=8C=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyongkai2 --- api/@internal/component/ets/text.d.ts | 40 ++++++++++++++++++++ api/@internal/component/ets/text_common.d.ts | 24 ++++++++++++ 2 files changed, 64 insertions(+) diff --git a/api/@internal/component/ets/text.d.ts b/api/@internal/component/ets/text.d.ts index 7f498aacce..7ae6963ab2 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -671,6 +671,46 @@ declare class TextAttribute extends CommonMethod { */ lineSpacing(value: LengthMetrics): TextAttribute; + /** + * Set the minimum line height + * + * @param { LengthMetrics } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 21 + */ + minLineHeight(value: LengthMetrics): TextAttribute; + + /** + * Set the maximum line height + * + * @param { LengthMetrics } value + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 21 + */ + maxLineHeight(value: LengthMetrics): TextAttribute; + + /** + * Called when the vertical center mode of the font is set. + * + * @param { number | string | Resource } value + * @param { LineHeightOptions } [options] - Indicates the options of setting line height + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 21 + */ + lineHeight(value: number | string | Resource, options?: LineHeightOptions): TextAttribute; + /** * Set font line spacing with options. * diff --git a/api/@internal/component/ets/text_common.d.ts b/api/@internal/component/ets/text_common.d.ts index 2f6b2461ae..f642e02436 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -1998,6 +1998,30 @@ declare interface LineSpacingOptions { onlyBetweenLines?: boolean; } +/** + * Defines the options of setting line height. + * + * @interface LineHeightOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @from + * @atomicservice + * @since 21 + */ +declare interface LineHeightOptions { + /** + * enable the multiply mode of line height setting. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @from + * @atomicservice + * @since 21 + */ + enableMultiply: boolean; +} + /** * Defines the options of max lines. * @interface MaxLinesOptions -- Gitee