From 0aa32be56a877a81c1c8e0685d7ea2889ccdbea4 Mon Sep 17 00:00:00 2001 From: mobHot Date: Sun, 20 Apr 2025 20:58:15 +0800 Subject: [PATCH] add the support for trimming line end space Signed-off-by: mobHot Change-Id: Ie9ed8598790afff270517980b095e260e3e1ed75 --- .../native_drawing/drawing_text_typography.h | 12 ++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 3d49d1934..e506f04be 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -2907,6 +2907,18 @@ void OH_Drawing_SetTypographyTextTab(OH_Drawing_TypographyStyle* style, OH_Drawi */ size_t OH_Drawing_GetDrawingArraySize(OH_Drawing_Array* drawingArray); +/** + * @brief Sets whether to trim excess whitespace at the end of each line for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param style Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param trimLineEndSpace Boolean value indicating whether to trim excess whitespace at the end of each line for text + * typography to set. + * @since 20 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextTrimLineEndSpace(OH_Drawing_TypographyStyle* style, bool trimLineEndSpace); + #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 e13687d42..634b17933 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1793,5 +1793,9 @@ { "first_introduced": "18", "name": "OH_Drawing_CanvasDrawPixelMapNine" + }, + { + "first_introduced": "20", + "name": "OH_Drawing_SetTypographyTextTrimLineEndSpace" } ] \ No newline at end of file -- Gitee