From aa68ff4fcbf72e2dfe8df14a15b369bb39c888f0 Mon Sep 17 00:00:00 2001 From: wanyanglan Date: Sat, 7 Jun 2025 20:17:56 +0800 Subject: [PATCH] =?UTF-8?q?Font=E5=92=8CCanvas=E9=83=A8=E5=88=86NDK?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=89=88=E6=9C=AC=E6=9B=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?19.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanyanglan Change-Id: I508f420b36f021138fe23b83220e7542a3217672 --- .../native_drawing/drawing_canvas.h | 2 +- .../graphic_2d/native_drawing/drawing_font.h | 22 +++++++++---------- .../native_drawing/libnative_drawing.ndk.json | 14 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 10824c04c..8f515031b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -926,7 +926,7 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, O * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas or recordCmd is nullptr. - * @since 20 + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmdNesting(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 81cb70dc0..69fb717ce 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -296,15 +296,15 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureText(const OH_Drawing_Font* font, con * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, text * and textWidth is nullptr or byteLength is 0 or brush and pen are both not empty. - * @since 20 + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontMeasureTextWithBrushOrPen(const OH_Drawing_Font* font, const void* text, - size_t byteLength, OH_Drawing_TextEncoding encoding, const OH_Drawing_Brush* brush, const OH_Drawing_Brush* pen, + size_t byteLength, OH_Drawing_TextEncoding encoding, const OH_Drawing_Brush* brush, const OH_Drawing_Pen* pen, OH_Drawing_Rect* bounds, float* textWidth); /** - * @brief Retrieves the advance and bounding box for each glyph in glyphs + * @brief Retrieves the advance and bounding box for each glyph in glyphs. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param font Indicates the pointer to an OH_Drawing_Font object. @@ -313,16 +313,16 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureTextWithBrushOrPen(const OH_Drawing_F * @param brush Indicates the pointer to an OH_Drawing_Brush object. * @param pen Indicates the pointer to an OH_Drawing_Pen object. * @param widths Indicates the text advances for each glyph returned to the caller. - * @param bounds Indicates the text bounding box for each glyph returned to caller. + * @param bounds Indicates the text bounding box for each glyph returned to the caller. * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font and glyphs is nullptr * or count is no larger than 0 or brush and pen are both not empty. - * @since 20 + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetWidthsBounds(const OH_Drawing_Font* font, const uint16_t* glyphs, int count, - const OH_Drawing_Brush* brush, const OH_Drawing_Brush* pen, float* widths, OH_Drawing_Array* bounds); + const OH_Drawing_Brush* brush, const OH_Drawing_Pen* pen, float* widths, OH_Drawing_Array* bounds); /** * @brief Retrieves the positions for each glyph, beginning at the specified origin. @@ -332,16 +332,16 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetWidthsBounds(const OH_Drawing_Font* font, * @param glyphs Indicates the array of glyph indices to be measured. * @param count Indicates the number of glyphs. * @param origin Indicates the location of the first glyph. - * @param points Indicates the relative position for each glyph returned to tha caller. + * @param points Indicates the relative position for each glyph returned to the caller. * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font, glyphs and points is nullptr or - * count is not larger than 0. - * @since 20 + * count is no larger than 0. + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetPos(const OH_Drawing_Font* font, const uint16_t* glyphs, int count, - const OH_Drawing_Point* origin, OH_Drawing_Point2D* bounds); + const OH_Drawing_Point* origin, OH_Drawing_Point2D* points); /** * @brief Returns the recommended spacing between lines. @@ -352,7 +352,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetPos(const OH_Drawing_Font* font, const ui * @return Returns the error code. * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of font and spacing is nullptr. - * @since 20 + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetSpacing(const OH_Drawing_Font* font, float* spacing); diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index cd1b53c1f..147c46aef 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -283,19 +283,19 @@ "name": "OH_Drawing_FontMeasureText" }, { - "first_introduced": "20", + "first_introduced": "19", "name": "OH_Drawing_FontMeasureTextWithBrushOrPen" }, { - "first_introduced": "20", + "first_introduced": "19", "name": "OH_Drawing_FontGetWidthsBounds" }, { - "first_introduced": "20", + "first_introduced": "19", "name": "OH_Drawing_FontGetPos" }, { - "first_introduced": "20", + "first_introduced": "19", "name": "OH_Drawing_FontGetSpacing" }, { @@ -1879,12 +1879,12 @@ "name": "OH_Drawing_CanvasDrawPixelMapNine" }, { - "first_introduced": "20", - "name": "OH_Drawing_SetTypographyTextTrailingSpaceOptimized" + "first_introduced": "19", + "name":"OH_Drawing_CanvasDrawRecordCmdNesting" }, { "first_introduced": "20", - "name":"OH_Drawing_CanvasDrawRecordCmdNesting" + "name": "OH_Drawing_SetTypographyTextTrailingSpaceOptimized" }, { "first_introduced": "20", -- Gitee