From 4e14a2899a2117600bdeed02803d53bbee144659 Mon Sep 17 00:00:00 2001 From: wanyanglan Date: Sun, 25 May 2025 14:41:58 +0800 Subject: [PATCH 1/2] OH_Drawing_FontMeasureTextWithBrushOrPen and OH_Drawing_FontGetWidthsBounds parameter type change. Signed-off-by: wanyanglan --- graphic/graphic_2d/native_drawing/drawing_font.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 81cb70dc0..088f7daf1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -300,11 +300,11 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureText(const OH_Drawing_Font* font, con * @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,7 +313,7 @@ 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 @@ -322,7 +322,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureTextWithBrushOrPen(const OH_Drawing_F * @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. + * count is no larger than 0. * @since 20 * @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. -- Gitee From 75fabce5f4c192a154bb8e4ace6441d4154825cd Mon Sep 17 00:00:00 2001 From: wanyanglan Date: Wed, 4 Jun 2025 16:57:07 +0800 Subject: [PATCH 2/2] since 20 has been changed to since 19. Signed-off-by: wanyanglan Change-Id: I132378e29414e8ef549d760bf303b8dc04f68837 --- graphic/graphic_2d/native_drawing/drawing_canvas.h | 2 +- graphic/graphic_2d/native_drawing/drawing_font.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 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 088f7daf1..69fb717ce 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -296,7 +296,7 @@ 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, @@ -318,7 +318,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontMeasureTextWithBrushOrPen(const OH_Drawing_F * 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, @@ -337,7 +337,7 @@ OH_Drawing_ErrorCode OH_Drawing_FontGetWidthsBounds(const OH_Drawing_Font* font, * 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 no larger than 0. - * @since 20 + * @since 19 * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_FontGetPos(const OH_Drawing_Font* font, const uint16_t* glyphs, int count, @@ -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); -- Gitee