From 7332d015c6a577fce5dc840f245c6a87d42c9544 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 5 Feb 2024 10:17:18 +0000 Subject: [PATCH 01/32] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../native_drawing/drawing_text_declaration.h | 23 + .../native_drawing/drawing_text_typography.h | 506 ++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 117 ++++ 3 files changed, 646 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 14cfaa33b..e3704ebd9 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -105,6 +105,29 @@ typedef struct OH_Drawing_PositionAndAffinity OH_Drawing_PositionAndAffinity; * @version 1.0 */ typedef struct OH_Drawing_Range OH_Drawing_Range; +/** + * @brief Defines an OH_Drawing_FontParser, which is used to parse system font files. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; + +/** + * @brief Defines an OH_Drawing_LineMetrics, which is used to describes the information of lines. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_LineMetrics OH_Drawing_LineMetrics; + +/** + * @brief Defines an OH_Drawing_FontMetrics, which is used to create an OH_Drawing_FontMetrics object. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_FontMetrics OH_Drawing_FontMetrics; #ifdef __cplusplus } diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index ce73be523..4310292eb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -286,6 +286,35 @@ typedef enum { RECT_WIDTH_STYLE_MAX, } OH_Drawing_RectWidthStyle; +/** + * @brief Describes the font information. + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /** The file path of System font */ + char* path; + /** The postScript name of the system font */ + char* postScriptName; + /** The name of System font */ + char* fullName; + /** The family of System font */ + char* fontFamily; + /** The subfont family of the system font */ + char* fontSubfamily; + /** The weight of System font */ + int weight; + /** The width of System font */ + int width; + /** Whether the system font is tilted */ + int italic; + /** Whether the system font is compact */ + bool monoSpace; + /** whether symbolic fonts are supported */ + bool symbolic; +} OH_Drawing_FontDescriptor; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * @@ -471,6 +500,94 @@ void OH_Drawing_SetTextStyleFontStyle(OH_Drawing_TextStyle*, int /* OH_Drawing_F */ void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*); +/** + * @brief Sets the foreground brush style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); + +/** + * @brief Gets the foreground brush style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Indicates the pointer to an OH_Drawing_Brush object. + * @since 12 + * @version 1.0 + */ +OH_Drawing_Brush* OH_Drawing_GetTextStyleForegroundBrush(OH_Drawing_TypographyStyle*); + +/** + * @brief Sets the foreground pen style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Pen object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); + +/** + * @brief Gets the foreground pen style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Indicates the pointer to an OH_Drawing_Pen object. + * @since 12 + * @version 1.0 + */ +OH_Drawing_Pen* OH_Drawing_GetTextStyleForegroundPen(OH_Drawing_TypographyStyle*); + +/** + * @brief Sets the background brush style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); + +/** + * @brief Gets the background brush style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Indicates the pointer to an OH_Drawing_Brush object. + * @since 12 + * @version 1.0 + */ +OH_Drawing_Brush* OH_Drawing_GetTextStyleBackgroundBrush(OH_Drawing_TypographyStyle*); + +/** + * @brief Sets the background pen style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Pen object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); + +/** + * @brief Gets the background pen style. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Indicates the pointer to an OH_Drawing_Pen object. + * @since 12 + * @version 1.0 + */ +OH_Drawing_Pen* OH_Drawing_GetTextStyleBackgroundPen(OH_Drawing_TypographyStyle*); + /** * @brief Creates a pointer to an OH_Drawing_TypographyCreate object. * @@ -1014,6 +1131,395 @@ double OH_Drawing_TypographyGetLineWidth(OH_Drawing_Typography*, int); */ OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, int, bool); +/** + * @brief Creates an OH_Drawing_FontDescriptor object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_FontDescriptor object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor(void); + +/** + * @brief Releases the memory occupied by an OH_Drawing_FontDescriptor object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontDescriptor Indicates the pointer to an OH_Drawing_FontDescriptor object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor*); + +/** + * @brief Creates an OH_Drawing_FontParser object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_FontParser object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontParser* OH_Drawing_CreateFontParser(void); + +/** + * @brief Releases the memory occupied by an OH_Drawing_FontParser object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); + +/** + * @brief Gets a list of system font names. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @param size_t Returns the number of obtained system font names. + * @return Returns a list of obtained system fonts. + * @since 12 + * @version 1.0 + */ +char** OH_Drawing_GetSystemFontList(OH_Drawing_FontParser*, size_t*); + +/** + * @brief Releases the memory occupied by a list of system font names. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param char** Indicates the pointer to a list of system font names. + * @param size_t The number of obtained system font names. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestorySystemFontList(char**, size_t); + +/** + * @brief Gets information about the system font by font name. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @param char** font name. + * @return Returns system fonts information. + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontParser*, const char*); + +/** + * @brief Get line metrics information. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @return Indicates the pointer to an OH_Drawing_LineMetrics object. + * @since 12 + * @version 1.0 + */ +OH_Drawing_LineMetrics* OH_Drawing_GetLineMetrics(OH_Drawing_Typography*); + +/** + * @brief Get the number of lines. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. + * @return Returns the number of lines. + * @since 12 + * @version 1.0 + */ +size_t OH_Drawing_GetLineMetricsSize(OH_Drawing_LineMetrics*); + +/** + * @brief Releases the memory occupied by line metrics. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestoryLineMetrics(OH_Drawing_LineMetrics*); + +/** + * @brief Gets the specified line by line number. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param int line number. + * @return Returns the specified row information obtained. + * @since 12 + * @version 1.0 + */ +OH_Drawing_LineMetrics* OH_Drawing_GetLineMetricsAt(OH_Drawing_Typography*, int); + +/** + * @brief Sets the ellipsis of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param char Indicates the line textellipsis. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle*, const char*); + +/** + * @brief Sets the locale of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param char Indicates the pointer to the locale to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char*); + +/** + * @brief Sets the textSplitRatio of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param float Indicates the textSplitRatio of lines to set.. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); + +/** + * @brief Gets the TextStyle of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns line text textstyle. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextStyle* OH_Drawing_TypographyGetLineTextStyle(OH_Drawing_TypographyStyle*); + +/** + * @brief Gets the EffectiveAlign of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns line text align. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_TypographyGetEffectiveAlign(OH_Drawing_TypographyStyle*); + +/** + * @brief Gets the IsUnlimitedLines of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns whether the text has a maximum line limit, with true indicating a maximum line limit and false indicating no maximum line limit. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_TypographyIsUnlimitedLines(OH_Drawing_TypographyStyle*); + +/** + * @brief Gets the IsEllipsized of lines in a text file. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @return Returns whether the text has ellipsis, true meaning there is an ellipsis and false meaning there is no ellipsis. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); + +/** + * @brief set line textstyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TypographySetTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_TextStyle* style); + +/** + * @brief Gets the position of the specified line or the first text of the specified line + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param int Line number + * @param bool True is the information for the whole line, and false is the information to get the first character + * @param bool Whether the text width contains whitespace + * @return Returns the position information. + * @since 12 + * @version 1.0 + */ +OH_Drawing_LineInfo* OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool); + +/** + * @brief Sets the font weight of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param int Indicates the font weight of text typography to set. For details, see the enum OH_Drawing_FontWeight. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle*, int); + +/** + * @brief Sets the font style of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param int Indicates the font style of text typography to set. For details, see the enum OH_Drawing_FontStyle. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle*, int); + +/** + * @brief Sets the font family of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param char Indicates the pointer to the font family of text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const char*); + +/** + * @brief Sets the font size of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param double Indicates the font size of text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle* style, double fontSize); + +/** + * @brief Sets the font height of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param double Indicates the font height of text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double /* fontHeight */); + +/** + * @brief Sets the half leading of text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param bool Indicates the half leading of text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); + +/** + * @brief Sets whether to enable line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param bool Indicates whether the line style for text typography is used. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool); + +/** + * @brief Sets the font weight of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param int Indicates the font weight of line style for text typography to set. For details, see the enum OH_Drawing_FontWeight. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle*, int); + +/** + * @brief Sets the font style of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param int Indicates the font style of line style for text typography to set. For details, see the enum OH_Drawing_FontStyle. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, int); + +/** + * @brief Sets the font families of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param int Indicates the number of font families to set. + * @param char Indicates the pointer to the font families of line style for text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle*, + int /* fontFamiliesNumber */, const char* fontFamilies[]); + +/** + * @brief Sets the font size of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param double Indicates the font size of line style for text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, double); + +/** + * @brief Sets the font height of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param double Indicates the font height of line style for text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle*, double /* fontHeight */); + +/** + * @brief Sets the half leading of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param bool Indicates the half leading of line for text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle*, bool); + +/** + * @brief Sets the spacing scale of line style for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param double Indicates the space scale of line for text typography to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyle*, double); + +/** + * @brief Sets whether only line style is enabled for text typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param bool Indicates the line style for text typography to set only. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool); + + #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 e916a8a3f..b3dcdf69b 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -337,5 +337,122 @@ { "first_introduced": "12", "name": "OH_Drawing_TypographyGetLineTextRange" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_CreateFontDescriptor" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyFontDescriptor" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_CreateFontParser" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyFontParser" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetSystemFontList" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestorySystemFontList" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_FontParserGetFontByName" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetLineMetrics" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetLineMetricsSize" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestoryLineMetrics" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetLineMetricsAt" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographySetTextStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleFontMetrics" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetLineInfo" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTextStyleForegroundBrush" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleForegroundBrush" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTextStyleForegroundPen" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleForegroundPen" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTextStyleBackgroundBrush" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleBackgroundBrush" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTextStyleBackgroundPen" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleBackgroundPen" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographySetIndents" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_CreateTextShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyTextShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleGetShadows" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleShadowsCount" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleAddShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_GetTextStyleClearShadows" } + ] \ No newline at end of file -- Gitee From 7b02032c3f2d5c52845df49e5f3d711c89373180 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 02:40:56 +0000 Subject: [PATCH 02/32] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 126 ++++++++++++++---- .../native_drawing/libnative_drawing.ndk.json | 20 +-- 2 files changed, 110 insertions(+), 36 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 4310292eb..0cecbf5c3 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -293,26 +293,26 @@ typedef enum { * @version 1.0 */ typedef struct { - /** The file path of System font */ - char* path; - /** The postScript name of the system font */ - char* postScriptName; - /** The name of System font */ - char* fullName; - /** The family of System font */ - char* fontFamily; - /** The subfont family of the system font */ - char* fontSubfamily; - /** The weight of System font */ - int weight; - /** The width of System font */ - int width; - /** Whether the system font is tilted */ - int italic; - /** Whether the system font is compact */ - bool monoSpace; - /** whether symbolic fonts are supported */ - bool symbolic; + /** The file path of System font */ + char* path; + /** The postScript name of the system font */ + char* postScriptName; + /** The name of System font */ + char* fullName; + /** The family of System font */ + char* fontFamily; + /** The subfont family of the system font */ + char* fontSubfamily; + /** The weight of System font */ + int weight; + /** The width of System font */ + int width; + /** Whether the system font is tilted */ + int italic; + /** Whether the system font is compact */ + bool monoSpace; + /** whether symbolic fonts are supported */ + bool symbolic; } OH_Drawing_FontDescriptor; /** @@ -1181,7 +1181,7 @@ void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); * @since 12 * @version 1.0 */ -char** OH_Drawing_GetSystemFontList(OH_Drawing_FontParser*, size_t*); +char** OH_Drawing_FontParserGetSystemFontList(OH_Drawing_FontParser*, size_t*); /** * @brief Releases the memory occupied by a list of system font names. @@ -1192,7 +1192,7 @@ char** OH_Drawing_GetSystemFontList(OH_Drawing_FontParser*, size_t*); * @since 12 * @version 1.0 */ -void OH_Drawing_DestorySystemFontList(char**, size_t); +void OH_Drawing_DestroySystemFontList(char**, size_t); /** * @brief Gets information about the system font by font name. @@ -1215,7 +1215,7 @@ OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontPar * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_GetLineMetrics(OH_Drawing_Typography*); +OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typography*); /** * @brief Get the number of lines. @@ -1226,7 +1226,7 @@ OH_Drawing_LineMetrics* OH_Drawing_GetLineMetrics(OH_Drawing_Typography*); * @since 12 * @version 1.0 */ -size_t OH_Drawing_GetLineMetricsSize(OH_Drawing_LineMetrics*); +size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); /** * @brief Releases the memory occupied by line metrics. @@ -1236,7 +1236,7 @@ size_t OH_Drawing_GetLineMetricsSize(OH_Drawing_LineMetrics*); * @since 12 * @version 1.0 */ -void OH_Drawing_DestoryLineMetrics(OH_Drawing_LineMetrics*); +void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics*); /** * @brief Gets the specified line by line number. @@ -1248,7 +1248,7 @@ void OH_Drawing_DestoryLineMetrics(OH_Drawing_LineMetrics*); * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_GetLineMetricsAt(OH_Drawing_Typography*, int); +OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int); /** * @brief Sets the ellipsis of lines in a text file. @@ -1519,7 +1519,81 @@ void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyl */ void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool); +/** + * @brief Creates an OH_Drawing_TextShadow object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Returns the pointer to the OH_Drawing_TextShadow object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); + +/** + * @brief Releases the memory occupied by an OH_Drawing_TextShadow object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow*); + +/** + * @brief Gets the vector of TextShadow in TextStyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param int Indicates the number in vector to set. + * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object array. + * @return Returns the vector of TextShadow. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); + +/** + * @brief Gets the size of vector of TextShadow in TextStyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the size of vector. + * @since 12 + * @version 1.0 + */ +int OH_Drawing_TextStyleGetShadowsCount(OH_Drawing_TextStyle*); + +/** + * @brief Adds element in vector of TextShadow in TextStyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextShadow*); + +/** + * @brief clear elements in vector of TextShadow in TextStyle. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); +/** + * @brief Set indents of the typography. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param float Indicates the pointer to the indents to set. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float indents[]); #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 b3dcdf69b..a1059e1b9 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -356,11 +356,11 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetSystemFontList" + "name": "OH_Drawing_FontParserGetSystemFontList" }, { "first_introduced": "12", - "name": "OH_Drawing_DestorySystemFontList" + "name": "OH_Drawing_DestroySystemFontList" }, { "first_introduced": "12", @@ -368,19 +368,19 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetLineMetrics" + "name": "OH_Drawing_TypographyGetLineMetrics" }, { "first_introduced": "12", - "name": "OH_Drawing_GetLineMetricsSize" + "name": "OH_Drawing_LineMetricsGetSize" }, { "first_introduced": "12", - "name": "OH_Drawing_DestoryLineMetrics" + "name": "OH_Drawing_DestroyLineMetrics" }, { "first_introduced": "12", - "name": "OH_Drawing_GetLineMetricsAt" + "name": "OH_Drawing_TypographyGetLineMetricsAt" }, { "first_introduced": "12", @@ -440,19 +440,19 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleGetShadows" + "name": "OH_Drawing_TextStyleGetShadows" }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleShadowsCount" + "name": "OH_Drawing_TextStyleGetShadowsCount" }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleAddShadow" + "name": "OH_Drawing_TextStyleAddShadow" }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleClearShadows" + "name": "OH_Drawing_TextStyleClearShadows" } ] \ No newline at end of file -- Gitee From be2c516f170667df2c1f7d5c3eec1d3b87a9c81a Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 03:57:18 +0000 Subject: [PATCH 03/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 70 +++++++++++++++---- .../native_drawing/libnative_drawing.ndk.json | 12 ++-- 2 files changed, 64 insertions(+), 18 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 0cecbf5c3..2a2a653ed 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -286,6 +286,41 @@ typedef enum { RECT_WIDTH_STYLE_MAX, } OH_Drawing_RectWidthStyle; +/** + * @brief Text line position information + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /** Text ascender height */ + double ascender; + /** Tex descender height */ + double descender; + /** The height of a capital letter */ + double capHeight; + /** The height of a lowercase letter */ + double xHeight; + /** Text width */ + double width; + /** Line height */ + double height; + /** + * The distance from the left end of the text to the left end of the container, + * aligned to 0, is the width of the container minus the width of the line of text + */ + double x; + /** + * The height from the top of the text to the top of the container, the first line is 0, + * and the second line is the height of the first line + */ + double y; + /** Line start character index */ + size_t startIndex; + /** End of line character index */ + size_t endIndex; +} OH_Drawing_LineInfo; + /** * @brief Describes the font information. * @@ -516,18 +551,18 @@ void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @since 12 * @version 1.0 */ -OH_Drawing_Brush* OH_Drawing_GetTextStyleForegroundBrush(OH_Drawing_TypographyStyle*); +void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); /** * @brief Sets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. * @since 12 * @version 1.0 */ @@ -538,11 +573,11 @@ void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. * @since 12 * @version 1.0 */ -OH_Drawing_Pen* OH_Drawing_GetTextStyleForegroundPen(OH_Drawing_TypographyStyle*); +void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); /** * @brief Sets the background brush style. @@ -560,18 +595,18 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. * @since 12 * @version 1.0 */ -OH_Drawing_Brush* OH_Drawing_GetTextStyleBackgroundBrush(OH_Drawing_TypographyStyle*); + void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); /** * @brief Sets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. * @since 12 * @version 1.0 */ @@ -582,11 +617,11 @@ void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. * @since 12 * @version 1.0 */ -OH_Drawing_Pen* OH_Drawing_GetTextStyleBackgroundPen(OH_Drawing_TypographyStyle*); +void OH_Drawing_TextStyleGetBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen*); /** * @brief Creates a pointer to an OH_Drawing_TypographyCreate object. @@ -1331,12 +1366,23 @@ bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); * @brief set line textstyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_TextStyle*); + +/** + * @brief get line fontmetrics. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the text FontMetrics * @since 12 * @version 1.0 */ -void OH_Drawing_TypographySetTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_TextStyle* style); +OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_TextStyle*); /** * @brief Gets the position of the specified line or the first text of the specified line diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index a1059e1b9..82e358b44 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -384,11 +384,11 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographySetTextStyle" + "name": "OH_Drawing_SetTypographyTextStyle" }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleFontMetrics" + "name": "OH_Drawing_TextStyleGetFontMetrics" }, { "first_introduced": "12", @@ -400,7 +400,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleForegroundBrush" + "name": "OH_Drawing_TextStyleGetForegroundBrush" }, { "first_introduced": "12", @@ -408,7 +408,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleForegroundPen" + "name": "OH_Drawing_TextStyleGetForegroundPen" }, { "first_introduced": "12", @@ -416,7 +416,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleBackgroundBrush" + "name": "OH_Drawing_TextStyleGetBackgroundBrush" }, { "first_introduced": "12", @@ -424,7 +424,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_GetTextStyleBackgroundPen" + "name": "OH_Drawing_TextStyleGetBackgroundPen" }, { "first_introduced": "12", -- Gitee From 33df54c3739cef76892404b8f750f976a5d1e6ba Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 06:05:47 +0000 Subject: [PATCH 04/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_declaration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index e3704ebd9..8a98840f0 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -105,6 +105,7 @@ typedef struct OH_Drawing_PositionAndAffinity OH_Drawing_PositionAndAffinity; * @version 1.0 */ typedef struct OH_Drawing_Range OH_Drawing_Range; + /** * @brief Defines an OH_Drawing_FontParser, which is used to parse system font files. * -- Gitee From e59548e3170c6a31d2a639dc95ecab77d6d9c215 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 06:42:11 +0000 Subject: [PATCH 05/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 4 +-- .../native_drawing/libnative_drawing.ndk.json | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 2a2a653ed..7fda92f83 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1316,7 +1316,7 @@ void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char* * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); +void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); /** * @brief Gets the TextStyle of lines in a text file. @@ -1327,7 +1327,7 @@ void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float) * @since 12 * @version 1.0 */ -OH_Drawing_TextStyle* OH_Drawing_TypographyGetLineTextStyle(OH_Drawing_TypographyStyle*); +OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographyStyle*); /** * @brief Gets the EffectiveAlign of lines in a text file. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 82e358b44..e1bd38cbe 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -382,6 +382,34 @@ "first_introduced": "12", "name": "OH_Drawing_TypographyGetLineMetricsAt" }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextEllipsis" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLocale" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextSplitRatio" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetTextStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetEffectiveAlign" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyIsUnlimitedLines" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyIsEllipsized" + }, { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextStyle" -- Gitee From 4c7c0884a1f001fe9421d503a87bfe59bb5ffd95 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 07:57:31 +0000 Subject: [PATCH 06/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 7fda92f83..2ab76f502 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -350,6 +350,47 @@ typedef struct { bool symbolic; } OH_Drawing_FontDescriptor; +/** + * @brief The metrics of font. + * + * @since 12 + * @version 1.0 + */ +typedef struct { + /** Indicating which metrics are valid */ + uint32_t flags; + /** Greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts */ + float top; + /** Distance to reserve above baseline, typically negative */ + float ascent; + /** Distance to reserve below baseline, typically positive */ + float descent; + /** Greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts */ + float bottom; + /** Distance to add between lines, typically positive or zero */ + float leading; + /** Average character width, zero if unknown */ + float avgCharWidth; + /** Maximum character width, zero if unknown */ + float maxCharWidth; + /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ + float xMin; + /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ + float xMax; + /** Height of lower-case 'x', zero if unknown, typically negative */ + float xHeight; + /** Height of an upper-case letter, zero if unknown, typically negative */ + float capHeight; + /** Underline thickness */ + float underlineThickness; + /** Distance from baseline to top of stroke, typically positive */ + float underlinePosition; + /** Strikeout thickness */ + float strikeoutThickness; + /** Distance from baseline to bottom of stroke, typically negative */ + float strikeoutPosition; +} OH_Drawing_FontMetrics; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * -- Gitee From 9ea89ae98178e85500e5288b1f0a0b64e52f7f38 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 09:52:28 +0000 Subject: [PATCH 07/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 2ab76f502..8f290f8fe 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -391,6 +391,44 @@ typedef struct { float strikeoutPosition; } OH_Drawing_FontMetrics; +/** + * @brief The metrics of line. + * + * @since 12 + * @version 1.0 + */ +struct OH_Drawing_LineMetrics { + /** Text ascender height */ + double ascender; + /** Tex descender height */ + double descender; + /** The height of a capital letter */ + double capHeight; + /** The height of a lowercase letter */ + double xHeight; + /** Text width */ + double width; + /** Line height */ + double height; + /** + * The distance from the left end of the text to the left end of the container, + * aligned to 0, is the width of the container minus the width of the line of text + */ + double x; + /** + * The height from the top of the text to the top of the container, the first line is 0, + * and the second line is the height of the first line + */ + double y; + /** Start Index */ + size_t startIndex; + /** End Index */ + size_t endIndex; + + /** The metrics information of the first character.*/ + OH_Drawing_FontMetrics firstCharMetrics; +}; + /** * @brief Creates an OH_Drawing_TypographyStyle object. * -- Gitee From 5c4ada5a59c73143207ed2974c65146e041e193d Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 6 Feb 2024 10:01:41 +0000 Subject: [PATCH 08/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 42 ++----------------- .../native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 8f290f8fe..efd64d491 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -286,41 +286,6 @@ typedef enum { RECT_WIDTH_STYLE_MAX, } OH_Drawing_RectWidthStyle; -/** - * @brief Text line position information - * - * @since 12 - * @version 1.0 - */ -typedef struct { - /** Text ascender height */ - double ascender; - /** Tex descender height */ - double descender; - /** The height of a capital letter */ - double capHeight; - /** The height of a lowercase letter */ - double xHeight; - /** Text width */ - double width; - /** Line height */ - double height; - /** - * The distance from the left end of the text to the left end of the container, - * aligned to 0, is the width of the container minus the width of the line of text - */ - double x; - /** - * The height from the top of the text to the top of the container, the first line is 0, - * and the second line is the height of the first line - */ - double y; - /** Line start character index */ - size_t startIndex; - /** End of line character index */ - size_t endIndex; -} OH_Drawing_LineInfo; - /** * @brief Describes the font information. * @@ -397,7 +362,7 @@ typedef struct { * @since 12 * @version 1.0 */ -struct OH_Drawing_LineMetrics { +typedef struct { /** Text ascender height */ double ascender; /** Tex descender height */ @@ -424,10 +389,9 @@ struct OH_Drawing_LineMetrics { size_t startIndex; /** End Index */ size_t endIndex; - /** The metrics information of the first character.*/ OH_Drawing_FontMetrics firstCharMetrics; -}; +} OH_Drawing_LineMetrics; /** * @brief Creates an OH_Drawing_TypographyStyle object. @@ -1475,7 +1439,7 @@ OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_TextStyle* * @since 12 * @version 1.0 */ -OH_Drawing_LineInfo* OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool); +OH_Drawing_LineMetrics* OH_Drawing_TypographyGetMetrics(OH_Drawing_Typography*, int, bool, bool); /** * @brief Sets the font weight of text typography. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e1bd38cbe..d58681e0d 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -420,7 +420,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographyGetLineInfo" + "name": "OH_Drawing_TypographyGetMetrics" }, { "first_introduced": "12", -- Gitee From 47da2a46889acdf397f2b541500b01ca0a265b34 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Wed, 7 Feb 2024 03:42:02 +0000 Subject: [PATCH 09/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 24 +++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 36 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index efd64d491..4257c64a8 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1673,6 +1673,18 @@ void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextS */ void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); +/** + * @brief Gets element in vector of TextShadow with index. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param int Indicates the index to set. + * @return Returns the pointer to element with the index in vector of OH_Drawing_TextShadow objects. + * @since 12 + * @version 1.0 + */ +OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextStyle*, int); + /** * @brief Set indents of the typography. * @@ -1683,6 +1695,18 @@ void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); * @version 1.0 */ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float indents[]); + +/** + * @brief Gets element with index in vector of Indents. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param int Indicates the index to set. + * @return double Indicates the element with the index in vector of Indents. + * @since 12 + * @version 1.0 + */ +double OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); #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 d58681e0d..9b4974fb5 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -200,6 +200,42 @@ { "name": "OH_Drawing_ImageBuildFromBitmap" }, { "name": "OH_Drawing_ImageGetWidth" }, { "name": "OH_Drawing_ImageGetHeight" }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetShadowWithIndex" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetIndentsWithIndex" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleClearShadows" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleAddShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetShadowsCount" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetShadows" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyTextShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_CreateTextShadow" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographySetIndents" + }, { "first_introduced": "12", "name": "OH_Drawing_ImageGetImageInfo" -- Gitee From 664c40c37f6d07f833f000c4a0968f4744ce8d13 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 03:30:41 +0000 Subject: [PATCH 10/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_declaration.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 8a98840f0..8c0b99afc 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -114,22 +114,6 @@ typedef struct OH_Drawing_Range OH_Drawing_Range; */ typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; -/** - * @brief Defines an OH_Drawing_LineMetrics, which is used to describes the information of lines. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_LineMetrics OH_Drawing_LineMetrics; - -/** - * @brief Defines an OH_Drawing_FontMetrics, which is used to create an OH_Drawing_FontMetrics object. - * - * @since 12 - * @version 1.0 - */ -typedef struct OH_Drawing_FontMetrics OH_Drawing_FontMetrics; - #ifdef __cplusplus } #endif -- Gitee From 2f80ba089f31794dabd9d1d8ca2ea463bcdf60d1 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 06:21:34 +0000 Subject: [PATCH 11/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 4 ++-- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 4257c64a8..2b9e0b039 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -335,7 +335,7 @@ typedef struct { /** Distance to add between lines, typically positive or zero */ float leading; /** Average character width, zero if unknown */ - float avgCharWidth; + float avgCharWidth; /** Maximum character width, zero if unknown */ float maxCharWidth; /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ @@ -1439,7 +1439,7 @@ OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_TextStyle* * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_TypographyGetMetrics(OH_Drawing_Typography*, int, bool, bool); +OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool); /** * @brief Sets the font weight of text typography. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 9b4974fb5..9c7348229 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -418,6 +418,10 @@ "first_introduced": "12", "name": "OH_Drawing_TypographyGetLineMetricsAt" }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetLineInfo" + }, { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextEllipsis" -- Gitee From 83b3b96d321a6462904ddbc2f3f19a1de34fb9b5 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 08:06:46 +0000 Subject: [PATCH 12/32] 1 Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_text_declaration.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index 8c0b99afc..cd74de367 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -114,6 +114,14 @@ typedef struct OH_Drawing_Range OH_Drawing_Range; */ typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; +/** + * @brief Defines an OH_Drawing_FontParser, which is used to manage text shadow. + * + * @since 12 + * @version 1.0 + */ +typedef struct OH_Drawing_TextShadow OH_Drawing_TextShadow; + #ifdef __cplusplus } #endif -- Gitee From abd5e0e97be6b51f4b41917dfec2d6586de5be4b Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 08:32:57 +0000 Subject: [PATCH 13/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_font_collection.h | 20 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index b517e5af1..425842da6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -62,6 +62,26 @@ OH_Drawing_FontCollection* OH_Drawing_CreateFontCollection(void); */ void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*); +/** + * @brief Disable the font collection fallback. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection*); + +/** + * @brief Disable the font collection systemfont. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DisableFontCollectionSystemFont(OH_Drawing_FontCollection*); + #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 9c7348229..c4b846ef0 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -521,6 +521,14 @@ { "first_introduced": "12", "name": "OH_Drawing_TextStyleClearShadows" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DisableFontCollectionFallback" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DisableFontCollectionSystemFont" } ] \ No newline at end of file -- Gitee From 8402e85413dd737f465f3327d5b75c0ff3b994b9 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 09:04:16 +0000 Subject: [PATCH 14/32] 1 Signed-off-by: changleipeng --- .../native_drawing/libnative_drawing.ndk.json | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index c4b846ef0..2910a9869 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -496,39 +496,54 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographySetIndents" + "name": "OH_Drawing_DisableFontCollectionFallback" }, { "first_introduced": "12", - "name": "OH_Drawing_CreateTextShadow" + "name": "OH_Drawing_DisableFontCollectionSystemFont" }, { "first_introduced": "12", - "name": "OH_Drawing_DestroyTextShadow" + "name": "OH_Drawing_SetTypographyTextFontWeight" }, { "first_introduced": "12", - "name": "OH_Drawing_TextStyleGetShadows" + "name": "OH_Drawing_SetTypographyTextFontStyle" }, { "first_introduced": "12", - "name": "OH_Drawing_TextStyleGetShadowsCount" + "name": "OH_Drawing_SetTypographyTextFontSize" }, { "first_introduced": "12", - "name": "OH_Drawing_TextStyleAddShadow" + "name": "OH_Drawing_SetTypographyTextHalfLeading" }, { "first_introduced": "12", - "name": "OH_Drawing_TextStyleClearShadows" + "name": "OH_Drawing_SetTypographyTextUseLineStyle" }, { "first_introduced": "12", - "name": "OH_Drawing_DisableFontCollectionFallback" + "name": "OH_Drawing_SetTypographyTextLineStyleFontWeight" }, { "first_introduced": "12", - "name": "OH_Drawing_DisableFontCollectionSystemFont" + "name": "OH_Drawing_SetTypographyTextLineStyleFontStyle" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleFontFamilies" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleFontSize" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleFontHeight" } + OH_Drawing_SetTypographyTextLineStyleHalfLeading + OH_Drawing_SetTypographyTextLineStyleSpacingScale + OH_Drawing_SetTypographyTextLineStyleOnly ] \ No newline at end of file -- Gitee From 42a7548727fb1f4a7c7454cb9821d56ca98be7be Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sun, 18 Feb 2024 09:05:10 +0000 Subject: [PATCH 15/32] 1 Signed-off-by: changleipeng --- .../native_drawing/libnative_drawing.ndk.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 2910a9869..33410032d 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -541,9 +541,18 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextLineStyleFontHeight" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleHalfLeading" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleSpacingScale" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_SetTypographyTextLineStyleOnly" } - OH_Drawing_SetTypographyTextLineStyleHalfLeading - OH_Drawing_SetTypographyTextLineStyleSpacingScale - OH_Drawing_SetTypographyTextLineStyleOnly ] \ No newline at end of file -- Gitee From 0b28c8de6df3a30ad4da18876a8678b54138cc1e Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 19 Feb 2024 03:42:41 +0000 Subject: [PATCH 16/32] 1 Signed-off-by: changleipeng --- .../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 2b9e0b039..fc075a60d 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1707,6 +1707,18 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in * @version 1.0 */ double OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); + +/** + * @brief get line fontmetrics. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @return Returns the text FontMetrics + * @since 12 + * @version 1.0 + */ +OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); #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 33410032d..75a523a3b 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -553,6 +553,10 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextLineStyleOnly" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TextStyleGetFontMetrics" } ] \ No newline at end of file -- Gitee From c7e2af7b36656588541f13dc093de9f2e0f096a1 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 19 Feb 2024 06:23:28 +0000 Subject: [PATCH 17/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 16 +++------------- .../native_drawing/libnative_drawing.ndk.json | 4 ---- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index fc075a60d..6112f796c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1420,12 +1420,13 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T * @brief get line fontmetrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Returns the text FontMetrics + * @return Returns the text FontMetrics. * @since 12 * @version 1.0 */ -OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_TextStyle*); +OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); /** * @brief Gets the position of the specified line or the first text of the specified line @@ -1708,17 +1709,6 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in */ double OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); -/** - * @brief get line fontmetrics. - * - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @return Returns the text FontMetrics - * @since 12 - * @version 1.0 - */ -OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); #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 75a523a3b..33410032d 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -553,10 +553,6 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextLineStyleOnly" - }, - { - "first_introduced": "12", - "name": "OH_Drawing_TextStyleGetFontMetrics" } ] \ No newline at end of file -- Gitee From 283531fbb771c29d8863032280db91ae41234619 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 19 Feb 2024 09:23:37 +0000 Subject: [PATCH 18/32] 1 Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_text_typography.h | 8 ++++---- .../graphic_2d/native_drawing/libnative_drawing.ndk.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 6112f796c..118b7e5be 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -433,7 +433,7 @@ void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle*, int /* O * @since 8 * @version 1.0 */ -void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); +void OH_Drawing_SetTypographyTextAlignment(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); /** * @brief Sets the maximum number of lines in a text file. @@ -1384,7 +1384,7 @@ OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographySty int OH_Drawing_TypographyGetEffectiveAlign(OH_Drawing_TypographyStyle*); /** - * @brief Gets the IsUnlimitedLines of lines in a text file. + * @brief Gets the UnlimitedLines of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. @@ -1392,7 +1392,7 @@ int OH_Drawing_TypographyGetEffectiveAlign(OH_Drawing_TypographyStyle*); * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyIsUnlimitedLines(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyUnlimitedLines(OH_Drawing_TypographyStyle*); /** * @brief Gets the IsEllipsized of lines in a text file. @@ -1651,7 +1651,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); * @since 12 * @version 1.0 */ -int OH_Drawing_TextStyleGetShadowsCount(OH_Drawing_TextStyle*); +int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle*); /** * @brief Adds element in vector of TextShadow in TextStyle. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 33410032d..88ae70a0b 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -142,7 +142,7 @@ { "name": "OH_Drawing_CreateTypographyStyle" }, { "name": "OH_Drawing_DestroyTypographyStyle" }, { "name": "OH_Drawing_SetTypographyTextDirection" }, - { "name": "OH_Drawing_SetTypographyTextAlign" }, + { "name": "OH_Drawing_SetTypographyTextAlignment" }, { "name": "OH_Drawing_SetTypographyTextMaxLines" }, { "name": "OH_Drawing_CreateTextStyle" }, { "name": "OH_Drawing_DestroyTextStyle" }, @@ -218,7 +218,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TextStyleGetShadowsCount" + "name": "OH_Drawing_TextStyleGetShadowCount" }, { "first_introduced": "12", @@ -444,7 +444,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographyIsUnlimitedLines" + "name": "OH_Drawing_TypographyUnlimitedLines" }, { "first_introduced": "12", -- Gitee From 860c4f914247a998995d18b6bbaffc6c557a694a Mon Sep 17 00:00:00 2001 From: changleipeng Date: Mon, 19 Feb 2024 09:47:44 +0000 Subject: [PATCH 19/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 6 +++--- .../graphic_2d/native_drawing/libnative_drawing.ndk.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 118b7e5be..c8bee64f7 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -433,7 +433,7 @@ void OH_Drawing_SetTypographyTextDirection(OH_Drawing_TypographyStyle*, int /* O * @since 8 * @version 1.0 */ -void OH_Drawing_SetTypographyTextAlignment(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); +void OH_Drawing_SetTypographyTextAlign(OH_Drawing_TypographyStyle*, int /* OH_Drawing_TextAlign */); /** * @brief Sets the maximum number of lines in a text file. @@ -1381,7 +1381,7 @@ OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographySty * @since 12 * @version 1.0 */ -int OH_Drawing_TypographyGetEffectiveAlign(OH_Drawing_TypographyStyle*); +int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); /** * @brief Gets the UnlimitedLines of lines in a text file. @@ -1392,7 +1392,7 @@ int OH_Drawing_TypographyGetEffectiveAlign(OH_Drawing_TypographyStyle*); * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyUnlimitedLines(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyUnlimitedLines(OH_Drawing_TypographyStyle*); /** * @brief Gets the IsEllipsized of lines in a text file. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 88ae70a0b..e35911496 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -142,7 +142,7 @@ { "name": "OH_Drawing_CreateTypographyStyle" }, { "name": "OH_Drawing_DestroyTypographyStyle" }, { "name": "OH_Drawing_SetTypographyTextDirection" }, - { "name": "OH_Drawing_SetTypographyTextAlignment" }, + { "name": "OH_Drawing_SetTypographyTextAlign" }, { "name": "OH_Drawing_SetTypographyTextMaxLines" }, { "name": "OH_Drawing_CreateTextStyle" }, { "name": "OH_Drawing_DestroyTextStyle" }, @@ -440,7 +440,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographyGetEffectiveAlign" + "name": "OH_Drawing_TypographyGetEffectiveAlignment" }, { "first_introduced": "12", -- Gitee From 3c17c88bd1a56726e5edeb9110f4444adb62f24a Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 20 Feb 2024 02:04:46 +0000 Subject: [PATCH 20/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index c8bee64f7..a3114b57e 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1392,7 +1392,7 @@ int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyUnlimitedLines(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyIsUnlimitedLines(OH_Drawing_TypographyStyle*); /** * @brief Gets the IsEllipsized of lines in a text file. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e35911496..b341cf887 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -444,7 +444,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographyUnlimitedLines" + "name": "OH_Drawing_TypographyIsUnlimitedLines" }, { "first_introduced": "12", -- Gitee From 820a9c0851c6446b32c9ef9b0bdc09b0c5a5733d Mon Sep 17 00:00:00 2001 From: changleipeng Date: Tue, 20 Feb 2024 02:25:54 +0000 Subject: [PATCH 21/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 +- graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index a3114b57e..3d81326f7 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1392,7 +1392,7 @@ int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); * @since 12 * @version 1.0 */ -bool OH_Drawing_TypographyIsUnlimitedLines(OH_Drawing_TypographyStyle*); +bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle*); /** * @brief Gets the IsEllipsized of lines in a text file. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index b341cf887..eb66d7232 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -444,7 +444,7 @@ }, { "first_introduced": "12", - "name": "OH_Drawing_TypographyIsUnlimitedLines" + "name": "OH_Drawing_TypographyIsLineUnlimited" }, { "first_introduced": "12", -- Gitee From bcc03ca6b4d7371ee1cf194d26c781ec7e844021 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Wed, 21 Feb 2024 07:21:25 +0000 Subject: [PATCH 22/32] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_font.h | 22 ++++++++ .../native_drawing/drawing_text_declaration.h | 2 +- .../native_drawing/drawing_text_typography.h | 54 +++---------------- 3 files changed, 30 insertions(+), 48 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 06aa4323b..8e1fc3739 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -150,6 +150,8 @@ void OH_Drawing_FontDestroy(OH_Drawing_Font*); * @version 1.0 */ typedef struct { + /** Indicating which metrics are valid */ + uint32_t flags; /** storage for top in font metrics */ float top; /** storage for ascent in font metrics */ @@ -160,6 +162,26 @@ typedef struct { float bottom; /** storage for leading in font metrics */ float leading; + /** Average character width, zero if unknown */ + float avgCharWidth; + /** Maximum character width, zero if unknown */ + float maxCharWidth; + /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ + float xMin; + /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ + float xMax; + /** Height of lower-case 'x', zero if unknown, typically negative */ + float xHeight; + /** Height of an upper-case letter, zero if unknown, typically negative */ + float capHeight; + /** Underline thickness */ + float underlineThickness; + /** Distance from baseline to top of stroke, typically positive */ + float underlinePosition; + /** Strikeout thickness */ + float strikeoutThickness; + /** Distance from baseline to bottom of stroke, typically negative */ + float strikeoutPosition; } OH_Drawing_Font_Metrics; /** diff --git a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h index cd74de367..542012e2a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_declaration.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_declaration.h @@ -115,7 +115,7 @@ typedef struct OH_Drawing_Range OH_Drawing_Range; typedef struct OH_Drawing_FontParser OH_Drawing_FontParser; /** - * @brief Defines an OH_Drawing_FontParser, which is used to manage text shadow. + * @brief Defines an OH_Drawing_TextShadow, which is used to manage text shadow. * * @since 12 * @version 1.0 diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 3d81326f7..06990e0c1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -40,6 +40,7 @@ #include "cstddef" #include "drawing_canvas.h" #include "drawing_color.h" +#include "drawing_font.h" #include "drawing_text_declaration.h" #include "drawing_types.h" @@ -315,47 +316,6 @@ typedef struct { bool symbolic; } OH_Drawing_FontDescriptor; -/** - * @brief The metrics of font. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - /** Indicating which metrics are valid */ - uint32_t flags; - /** Greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable fonts */ - float top; - /** Distance to reserve above baseline, typically negative */ - float ascent; - /** Distance to reserve below baseline, typically positive */ - float descent; - /** Greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable fonts */ - float bottom; - /** Distance to add between lines, typically positive or zero */ - float leading; - /** Average character width, zero if unknown */ - float avgCharWidth; - /** Maximum character width, zero if unknown */ - float maxCharWidth; - /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ - float xMin; - /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ - float xMax; - /** Height of lower-case 'x', zero if unknown, typically negative */ - float xHeight; - /** Height of an upper-case letter, zero if unknown, typically negative */ - float capHeight; - /** Underline thickness */ - float underlineThickness; - /** Distance from baseline to top of stroke, typically positive */ - float underlinePosition; - /** Strikeout thickness */ - float strikeoutThickness; - /** Distance from baseline to bottom of stroke, typically negative */ - float strikeoutPosition; -} OH_Drawing_FontMetrics; - /** * @brief The metrics of line. * @@ -390,7 +350,7 @@ typedef struct { /** End Index */ size_t endIndex; /** The metrics information of the first character.*/ - OH_Drawing_FontMetrics firstCharMetrics; + OH_Drawing_Font_Metrics firstCharMetrics; } OH_Drawing_LineMetrics; /** @@ -1426,7 +1386,7 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T * @since 12 * @version 1.0 */ -OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); +OH_Drawing_Font_Metrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); /** * @brief Gets the position of the specified line or the first text of the specified line @@ -1436,11 +1396,11 @@ OH_Drawing_FontMetrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography * @param int Line number * @param bool True is the information for the whole line, and false is the information to get the first character * @param bool Whether the text width contains whitespace - * @return Returns the position information. + * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool); +void OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, OH_Drawing_LineMetrics*); /** * @brief Sets the font weight of text typography. @@ -1703,11 +1663,11 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. * @param int Indicates the index to set. - * @return double Indicates the element with the index in vector of Indents. + * @return float Indicates the element with the index in vector of Indents. * @since 12 * @version 1.0 */ -double OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); +float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); #ifdef __cplusplus } -- Gitee From 2ff31aafc68146cb3a1971706038fe574073e282 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 22 Feb 2024 08:21:36 +0000 Subject: [PATCH 23/32] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_font.h | 82 ++++-- .../native_drawing/drawing_text_typography.h | 246 +++++++++++------- 2 files changed, 218 insertions(+), 110 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 8e1fc3739..a852b8bd3 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -149,38 +149,86 @@ void OH_Drawing_FontDestroy(OH_Drawing_Font*); * @since 12 * @version 1.0 */ -typedef struct { - /** Indicating which metrics are valid */ +typedef struct OH_Drawing_Font_Metrics { + /** + * @brief Indicating which metrics are valid + * @since_2013 12 + */ uint32_t flags; - /** storage for top in font metrics */ + /** + * @brief storage for top in font metrics + * @since_2013 12 + */ float top; - /** storage for ascent in font metrics */ + /** + * @brief storage for ascent in font metrics + * @since_2013 12 + */ float ascent; - /** storage for descent in font metrics */ + /** + * @brief storage for descent in font metrics + * @since_2013 12 + */ float descent; - /** storage for bottom in font metrics */ + /** + * @brief storage for bottom in font metrics + * @since_2013 12 + */ float bottom; - /** storage for leading in font metrics */ + /** + * @brief storage for leading in font metrics + * @since_2013 12 + */ float leading; - /** Average character width, zero if unknown */ + /** + * @brief Average character width, zero if unknown + * @since_2013 12 + */ float avgCharWidth; - /** Maximum character width, zero if unknown */ + /** + * @brief Maximum character width, zero if unknown + * @since_2013 12 + */ float maxCharWidth; - /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ + /** + * @brief Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts + * @since_2013 12 + */ float xMin; - /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ + /** + * @brief Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts + * @since_2013 12 + */ float xMax; - /** Height of lower-case 'x', zero if unknown, typically negative */ + /** + * @brief Height of lower-case letter, zero if unknown, typically negative + * @since_2013 12 + */ float xHeight; - /** Height of an upper-case letter, zero if unknown, typically negative */ + /** + * @brief Height of an upper-case letter, zero if unknown, typically negative + * @since_2013 12 + */ float capHeight; - /** Underline thickness */ + /** + * @brief Underline thickness + * @since_2013 12 + */ float underlineThickness; - /** Distance from baseline to top of stroke, typically positive */ + /** + * @brief Distance from baseline to top of stroke, typically positive + * @since_2013 12 + */ float underlinePosition; - /** Strikeout thickness */ + /** + * @brief Strikeout thickness + * @since_2013 12 + */ float strikeoutThickness; - /** Distance from baseline to bottom of stroke, typically negative */ + /** + * @brief Distance from baseline to bottom of stroke, typically negative + * @since_2013 12 + */ float strikeoutPosition; } OH_Drawing_Font_Metrics; diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 06990e0c1..2cc498f12 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -293,26 +293,56 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef struct { - /** The file path of System font */ +typedef struct OH_Drawing_FontDescriptor { + /** + * @brief The file path of System font + * @since_2013 12 + */ char* path; - /** The postScript name of the system font */ + /** + * @brief System font name defined by PostScript Page Description Language (PDL) rules + * @since_2013 12 + */ char* postScriptName; - /** The name of System font */ + /** + * @brief The name of System font + * @since_2013 12 + */ char* fullName; - /** The family of System font */ + /** + * @brief The family of System font + * @since_2013 12 + */ char* fontFamily; - /** The subfont family of the system font */ + /** + * @brief The subfont family of the system font + * @since_2013 12 + */ char* fontSubfamily; - /** The weight of System font */ + /** + * @brief The weight of System font + * @since_2013 12 + */ int weight; - /** The width of System font */ + /** + * @brief The width of System font + * @since_2013 12 + */ int width; - /** Whether the system font is tilted */ + /** + * @brief Whether the system font is tilted + * @since_2013 12 + */ int italic; - /** Whether the system font is compact */ + /** + * @brief Whether the system font is compact + * @since_2013 12 + */ bool monoSpace; - /** whether symbolic fonts are supported */ + /** + * @brief whether symbolic fonts are supported + * @since_2013 12 + */ bool symbolic; } OH_Drawing_FontDescriptor; @@ -322,34 +352,63 @@ typedef struct { * @since 12 * @version 1.0 */ -typedef struct { - /** Text ascender height */ +typedef struct OH_Drawing_LineMetrics { + /** + * @brief Text ascender height + * @since_2013 12 + */ double ascender; - /** Tex descender height */ + /** + * @brief Tex descender height + * @since_2013 12 + */ double descender; - /** The height of a capital letter */ + /** + * @brief The height of a capital letter + * @since_2013 12 + */ double capHeight; - /** The height of a lowercase letter */ + /** + * @brief The height of a lowercase letter + * @since_2013 12 + */ double xHeight; - /** Text width */ + /** + * @brief Text width + * @since_2013 12 + */ double width; - /** Line height */ + /** + * @brief Line height + * @since_2013 12 + */ double height; /** - * The distance from the left end of the text to the left end of the container, + * @brief The distance from the left end of the text to the left end of the container, * aligned to 0, is the width of the container minus the width of the line of text + * @since_2013 12 */ double x; /** - * The height from the top of the text to the top of the container, the first line is 0, + * @brief The height from the top of the text to the top of the container, the first line is 0, * and the second line is the height of the first line + * @since_2013 12 */ double y; - /** Start Index */ + /** + * @brief Start Index + * @since_2013 12 + */ size_t startIndex; - /** End Index */ + /** + * @brief End Index + * @since_2013 12 + */ size_t endIndex; - /** The metrics information of the first character.*/ + /** + * @brief The metrics information of the first character + * @since_2013 12 + */ OH_Drawing_Font_Metrics firstCharMetrics; } OH_Drawing_LineMetrics; @@ -542,8 +601,8 @@ void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*); * @brief Sets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. * @since 12 * @version 1.0 */ @@ -553,8 +612,8 @@ void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Gets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. * @since 12 * @version 1.0 */ @@ -564,8 +623,8 @@ void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Sets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. * @since 12 * @version 1.0 */ @@ -575,8 +634,8 @@ void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Gets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. * @since 12 * @version 1.0 */ @@ -586,8 +645,8 @@ void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Sets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. * @since 12 * @version 1.0 */ @@ -597,8 +656,8 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Gets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. * @since 12 * @version 1.0 */ @@ -608,8 +667,8 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Sets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. * @since 12 * @version 1.0 */ @@ -619,8 +678,8 @@ void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Gets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. * @since 12 * @version 1.0 */ @@ -1173,7 +1232,7 @@ OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, * @brief Creates an OH_Drawing_FontDescriptor object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the OH_Drawing_FontDescriptor object created. + * @return Returns the pointer to the font descriptor object {@link OH_Drawing_FontDescriptor} object created. * @since 12 * @version 1.0 */ @@ -1183,7 +1242,7 @@ OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor(void); * @brief Releases the memory occupied by an OH_Drawing_FontDescriptor object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor Indicates the pointer to an OH_Drawing_FontDescriptor object. + * @param OH_Drawing_FontDescriptor the pointer to the font descriptor object {@link OH_Drawing_FontDescriptor} object. * @since 12 * @version 1.0 */ @@ -1193,7 +1252,7 @@ void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor*); * @brief Creates an OH_Drawing_FontParser object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the OH_Drawing_FontParser object created. + * @return Returns the pointer to the font parser object {@link OH_Drawing_FontParser} object. * @since 12 * @version 1.0 */ @@ -1203,7 +1262,7 @@ OH_Drawing_FontParser* OH_Drawing_CreateFontParser(void); * @brief Releases the memory occupied by an OH_Drawing_FontParser object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. * @since 12 * @version 1.0 */ @@ -1213,7 +1272,7 @@ void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); * @brief Gets a list of system font names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. * @param size_t Returns the number of obtained system font names. * @return Returns a list of obtained system fonts. * @since 12 @@ -1236,7 +1295,7 @@ void OH_Drawing_DestroySystemFontList(char**, size_t); * @brief Gets information about the system font by font name. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to an OH_Drawing_FontParser object. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. * @param char** font name. * @return Returns system fonts information. * @since 12 @@ -1248,8 +1307,8 @@ OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontPar * @brief Get line metrics information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @return Indicates the pointer to an OH_Drawing_LineMetrics object. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @return Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. * @since 12 * @version 1.0 */ @@ -1259,7 +1318,7 @@ OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typograph * @brief Get the number of lines. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. * @return Returns the number of lines. * @since 12 * @version 1.0 @@ -1270,7 +1329,7 @@ size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); * @brief Releases the memory occupied by line metrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. * @since 12 * @version 1.0 */ @@ -1292,7 +1351,7 @@ OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typogra * @brief Sets the ellipsis of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. * @param char Indicates the line textellipsis. * @since 12 * @version 1.0 @@ -1303,7 +1362,7 @@ void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle*, const cha * @brief Sets the locale of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param char Indicates the pointer to the locale to set. * @since 12 * @version 1.0 @@ -1314,8 +1373,8 @@ void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char* * @brief Sets the textSplitRatio of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param float Indicates the textSplitRatio of lines to set.. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param float Indicates the textSplitRatio of lines to set. * @since 12 * @version 1.0 */ @@ -1325,7 +1384,7 @@ void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); * @brief Gets the TextStyle of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @return Returns line text textstyle. * @since 12 * @version 1.0 @@ -1336,7 +1395,7 @@ OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographySty * @brief Gets the EffectiveAlign of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @return Returns line text align. * @since 12 * @version 1.0 @@ -1347,7 +1406,7 @@ int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); * @brief Gets the UnlimitedLines of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @return Returns whether the text has a maximum line limit, with true indicating a maximum line limit and false indicating no maximum line limit. * @since 12 * @version 1.0 @@ -1358,7 +1417,7 @@ bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle*); * @brief Gets the IsEllipsized of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @return Returns whether the text has ellipsis, true meaning there is an ellipsis and false meaning there is no ellipsis. * @since 12 * @version 1.0 @@ -1369,8 +1428,8 @@ bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); * @brief set line textstyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @since 12 * @version 1.0 */ @@ -1380,8 +1439,8 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T * @brief get line fontmetrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @return Returns the text FontMetrics. * @since 12 * @version 1.0 @@ -1389,24 +1448,25 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T OH_Drawing_Font_Metrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); /** - * @brief Gets the position of the specified line or the first text of the specified line + * @brief Gets the position of the specified line or the first text of the specified line. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param int Line number + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param int Line number. * @param bool True is the information for the whole line, and false is the information to get the first character - * @param bool Whether the text width contains whitespace - * @param OH_Drawing_LineMetrics Indicates the pointer to an OH_Drawing_LineMetrics object. + * @param bool Whether the text width contains whitespace. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @return return whether the information was successfully fetched. * @since 12 * @version 1.0 */ -void OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, OH_Drawing_LineMetrics*); +bool OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, OH_Drawing_LineMetrics*); /** * @brief Sets the font weight of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param int Indicates the font weight of text typography to set. For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 @@ -1417,7 +1477,7 @@ void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle*, int); * @brief Sets the font style of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param int Indicates the font style of text typography to set. For details, see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 @@ -1428,7 +1488,7 @@ void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle*, int); * @brief Sets the font family of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param char Indicates the pointer to the font family of text typography to set. * @since 12 * @version 1.0 @@ -1439,7 +1499,7 @@ void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const c * @brief Sets the font size of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param double Indicates the font size of text typography to set. * @since 12 * @version 1.0 @@ -1450,7 +1510,7 @@ void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle* style, dou * @brief Sets the font height of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param double Indicates the font height of text typography to set. * @since 12 * @version 1.0 @@ -1461,7 +1521,7 @@ void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double * @brief Sets the half leading of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param bool Indicates the half leading of text typography to set. * @since 12 * @version 1.0 @@ -1472,7 +1532,7 @@ void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); * @brief Sets whether to enable line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param bool Indicates whether the line style for text typography is used. * @since 12 * @version 1.0 @@ -1483,7 +1543,7 @@ void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool) * @brief Sets the font weight of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param int Indicates the font weight of line style for text typography to set. For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 @@ -1494,7 +1554,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle* * @brief Sets the font style of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param int Indicates the font style of line style for text typography to set. For details, see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 @@ -1505,7 +1565,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, * @brief Sets the font families of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param int Indicates the number of font families to set. * @param char Indicates the pointer to the font families of line style for text typography to set. * @since 12 @@ -1518,7 +1578,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyl * @brief Sets the font size of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param double Indicates the font size of line style for text typography to set. * @since 12 * @version 1.0 @@ -1529,7 +1589,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, * @brief Sets the font height of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param double Indicates the font height of line style for text typography to set. * @since 12 * @version 1.0 @@ -1540,7 +1600,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle* * @brief Sets the half leading of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param bool Indicates the half leading of line for text typography to set. * @since 12 * @version 1.0 @@ -1551,7 +1611,7 @@ void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle * @brief Sets the spacing scale of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param double Indicates the space scale of line for text typography to set. * @since 12 * @version 1.0 @@ -1562,7 +1622,7 @@ void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyl * @brief Sets whether only line style is enabled for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to an OH_Drawing_TypographyStyle object. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. * @param bool Indicates the line style for text typography to set only. * @since 12 * @version 1.0 @@ -1573,7 +1633,7 @@ void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool * @brief Creates an OH_Drawing_TextShadow object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the OH_Drawing_TextShadow object created. + * @return Returns the pointer to the text shadow object created {@link OH_Drawing_TextShadow}. * @since 12 * @version 1.0 */ @@ -1583,7 +1643,7 @@ OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); * @brief Releases the memory occupied by an OH_Drawing_TextShadow object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. * @since 12 * @version 1.0 */ @@ -1593,9 +1653,9 @@ void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow*); * @brief Gets the vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @param int Indicates the number in vector to set. - * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object array. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. * @return Returns the vector of TextShadow. * @since 12 * @version 1.0 @@ -1606,7 +1666,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); * @brief Gets the size of vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @return Returns the size of vector. * @since 12 * @version 1.0 @@ -1617,8 +1677,8 @@ int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle*); * @brief Adds element in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param OH_Drawing_TextShadow Indicates the pointer to an OH_Drawing_TextShadow object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. * @since 12 * @version 1.0 */ @@ -1628,7 +1688,7 @@ void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextS * @brief clear elements in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @since 12 * @version 1.0 */ @@ -1638,7 +1698,7 @@ void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); * @brief Gets element in vector of TextShadow with index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @param int Indicates the index to set. * @return Returns the pointer to element with the index in vector of OH_Drawing_TextShadow objects. * @since 12 @@ -1650,7 +1710,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextSty * @brief Set indents of the typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. * @param float Indicates the pointer to the indents to set. * @since 12 * @version 1.0 @@ -1661,7 +1721,7 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in * @brief Gets element with index in vector of Indents. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. * @param int Indicates the index to set. * @return float Indicates the element with the index in vector of Indents. * @since 12 -- Gitee From 145c0a1eda5b2948c254bf9e3376aa26bd70097e Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 22 Feb 2024 08:26:05 +0000 Subject: [PATCH 24/32] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 2cc498f12..1a44b5c98 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -300,7 +300,7 @@ typedef struct OH_Drawing_FontDescriptor { */ char* path; /** - * @brief System font name defined by PostScript Page Description Language (PDL) rules + * @brief A name that uniquely identifies the font * @since_2013 12 */ char* postScriptName; -- Gitee From cc6a87a9f63c0be082bd979fb6e37d954d66ddfa Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 22 Feb 2024 09:38:33 +0000 Subject: [PATCH 25/32] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_text_typography.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 1a44b5c98..8e1adea4e 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1339,13 +1339,14 @@ void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics*); * @brief Gets the specified line by line number. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. - * @param int line number. - * @return Returns the specified row information obtained. + * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param int Line number. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @return Whether the line metrics was obtained. * @since 12 * @version 1.0 */ -OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int); +bool OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int, OH_Drawing_LineMetrics*); /** * @brief Sets the ellipsis of lines in a text file. -- Gitee From b64c054e6944e804dc4418c77ad684da3fa2bfe1 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 22 Feb 2024 11:05:07 +0000 Subject: [PATCH 26/32] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 8e1adea4e..fcc442d68 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1442,11 +1442,12 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @return Returns the text FontMetrics. + * @param OH_Drawing_Font_Metrics Indicates the pointer to a font metrics object {@link OH_Drawing_Font_Metrics}. + * @return Whether the font metrics was obtained. * @since 12 * @version 1.0 */ -OH_Drawing_Font_Metrics* OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*); +bool OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextStyle*, OH_Drawing_Font_Metrics*); /** * @brief Gets the position of the specified line or the first text of the specified line. -- Gitee From 20f90335efe479f8430964c873e0bdfc1212aec9 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Thu, 22 Feb 2024 12:18:34 +0000 Subject: [PATCH 27/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_text_typography.h | 10 ++++++++++ .../native_drawing/libnative_drawing.ndk.json | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index fcc442d68..d00cc9844 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1731,6 +1731,16 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in */ float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); +/** + * @brief Releases the memory occupied by vector with OH_Drawing_TextShadow objects. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_DestroyTextShadows(OH_Drawing_TextShadow*); + #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 eb66d7232..3aaac45b8 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -553,6 +553,10 @@ { "first_introduced": "12", "name": "OH_Drawing_SetTypographyTextLineStyleOnly" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_DestroyTextShadows" } ] \ No newline at end of file -- Gitee From 43d9f8a4c1d6ebdb2e6ab2d7b67e43f4e0e547b1 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 23 Feb 2024 03:27:06 +0000 Subject: [PATCH 28/32] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- .../graphic_2d/native_drawing/drawing_font.h | 80 +++--------- .../native_drawing/drawing_font_collection.h | 4 +- .../native_drawing/drawing_text_typography.h | 115 +++++------------- 3 files changed, 46 insertions(+), 153 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index a852b8bd3..cbbec950c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -150,85 +150,37 @@ void OH_Drawing_FontDestroy(OH_Drawing_Font*); * @version 1.0 */ typedef struct OH_Drawing_Font_Metrics { - /** - * @brief Indicating which metrics are valid - * @since_2013 12 - */ + /** Indicating which metrics are valid */ uint32_t flags; - /** - * @brief storage for top in font metrics - * @since_2013 12 - */ + /** storage for top in font metrics */ float top; - /** - * @brief storage for ascent in font metrics - * @since_2013 12 - */ + /** storage for ascent in font metrics */ float ascent; - /** - * @brief storage for descent in font metrics - * @since_2013 12 - */ + /** storage for descent in font metrics */ float descent; - /** - * @brief storage for bottom in font metrics - * @since_2013 12 - */ + /** storage for bottom in font metrics */ float bottom; - /** - * @brief storage for leading in font metrics - * @since_2013 12 - */ + /** storage for leading in font metrics */ float leading; - /** - * @brief Average character width, zero if unknown - * @since_2013 12 - */ + /** Average character width, zero if unknown */ float avgCharWidth; - /** - * @brief Maximum character width, zero if unknown - * @since_2013 12 - */ + /** Maximum character width, zero if unknown */ float maxCharWidth; - /** - * @brief Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts - * @since_2013 12 - */ + /** Greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with variable fonts */ float xMin; - /** - * @brief Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts - * @since_2013 12 - */ + /** Greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with variable fonts */ float xMax; - /** - * @brief Height of lower-case letter, zero if unknown, typically negative - * @since_2013 12 - */ + /** Height of lower-case letter, zero if unknown, typically negative */ float xHeight; - /** - * @brief Height of an upper-case letter, zero if unknown, typically negative - * @since_2013 12 - */ + /** Height of an upper-case letter, zero if unknown, typically negative */ float capHeight; - /** - * @brief Underline thickness - * @since_2013 12 - */ + /** @brief Underline thickness */ float underlineThickness; - /** - * @brief Distance from baseline to top of stroke, typically positive - * @since_2013 12 - */ + /** Distance from baseline to top of stroke, typically positive */ float underlinePosition; - /** - * @brief Strikeout thickness - * @since_2013 12 - */ + /** Strikeout thickness */ float strikeoutThickness; - /** - * @brief Distance from baseline to bottom of stroke, typically negative - * @since_2013 12 - */ + /** Distance from baseline to bottom of stroke, typically negative */ float strikeoutPosition; } OH_Drawing_Font_Metrics; diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index 425842da6..9341d2a5b 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -66,7 +66,7 @@ void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*); * @brief Disable the font collection fallback. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param OH_Drawing_FontCollection Indicates the pointer to a {@link OH_Drawing_FontCollection} object. * @since 12 * @version 1.0 */ @@ -76,7 +76,7 @@ void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection*); * @brief Disable the font collection systemfont. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. + * @param OH_Drawing_FontCollection Indicates the pointer to an {@link OH_Drawing_FontCollection} object. * @since 12 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index d00cc9844..b8f10c1e7 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -294,55 +294,25 @@ typedef enum { * @version 1.0 */ typedef struct OH_Drawing_FontDescriptor { - /** - * @brief The file path of System font - * @since_2013 12 - */ + /** The file path of System font */ char* path; - /** - * @brief A name that uniquely identifies the font - * @since_2013 12 - */ + /** A name that uniquely identifies the font */ char* postScriptName; - /** - * @brief The name of System font - * @since_2013 12 - */ + /** The name of System font */ char* fullName; - /** - * @brief The family of System font - * @since_2013 12 - */ + /** The family of System font */ char* fontFamily; - /** - * @brief The subfont family of the system font - * @since_2013 12 - */ + /** The subfont family of the system font */ char* fontSubfamily; - /** - * @brief The weight of System font - * @since_2013 12 - */ + /** The weight of System font */ int weight; - /** - * @brief The width of System font - * @since_2013 12 - */ + /** The width of System font */ int width; - /** - * @brief Whether the system font is tilted - * @since_2013 12 - */ + /** Whether the system font is tilted */ int italic; - /** - * @brief Whether the system font is compact - * @since_2013 12 - */ + /** Whether the system font is compact */ bool monoSpace; - /** - * @brief whether symbolic fonts are supported - * @since_2013 12 - */ + /** whether symbolic fonts are supported */ bool symbolic; } OH_Drawing_FontDescriptor; @@ -353,62 +323,33 @@ typedef struct OH_Drawing_FontDescriptor { * @version 1.0 */ typedef struct OH_Drawing_LineMetrics { - /** - * @brief Text ascender height - * @since_2013 12 - */ + /** Text ascender height */ double ascender; - /** - * @brief Tex descender height - * @since_2013 12 - */ + /** Tex descender height */ double descender; - /** - * @brief The height of a capital letter - * @since_2013 12 - */ + /** The height of a capital letter */ double capHeight; - /** - * @brief The height of a lowercase letter - * @since_2013 12 - */ + /** The height of a lowercase letter */ double xHeight; - /** - * @brief Text width - * @since_2013 12 - */ + /** Text width */ double width; - /** - * @brief Line height - * @since_2013 12 - */ + /** Line height */ double height; /** - * @brief The distance from the left end of the text to the left end of the container, - * aligned to 0, is the width of the container minus the width of the line of text - * @since_2013 12 + * The distance from the left end of the text to the left end of the container, + * aligned to 0, is the width of the container minus the width of the line of text */ double x; /** - * @brief The height from the top of the text to the top of the container, the first line is 0, + * The height from the top of the text to the top of the container, the first line is 0, * and the second line is the height of the first line - * @since_2013 12 */ double y; - /** - * @brief Start Index - * @since_2013 12 - */ + /** Start Index */ size_t startIndex; - /** - * @brief End Index - * @since_2013 12 - */ + /** End Index */ size_t endIndex; - /** - * @brief The metrics information of the first character - * @since_2013 12 - */ + /** The metrics information of the first character */ OH_Drawing_Font_Metrics firstCharMetrics; } OH_Drawing_LineMetrics; @@ -1506,7 +1447,7 @@ void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const c * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle* style, double fontSize); +void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle*, double); /** * @brief Sets the font height of text typography. @@ -1517,7 +1458,7 @@ void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle* style, dou * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double /* fontHeight */); +void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double); /** * @brief Sets the half leading of text typography. @@ -1596,7 +1537,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle*, double /* fontHeight */); +void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle*, double); /** * @brief Sets the half leading of line style for text typography. @@ -1642,7 +1583,7 @@ void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); /** - * @brief Releases the memory occupied by an OH_Drawing_TextShadow object. + * @brief Releases the memory occupied by the text shadow object {@link OH_Drawing_TextShadow}. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. @@ -1702,7 +1643,7 @@ void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. * @param int Indicates the index to set. - * @return Returns the pointer to element with the index in vector of OH_Drawing_TextShadow objects. + * @return Returns the pointer to element with the index in vector of the text style object {@link OH_Drawing_TextStyle}. * @since 12 * @version 1.0 */ @@ -1732,7 +1673,7 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); /** - * @brief Releases the memory occupied by vector with OH_Drawing_TextShadow objects. + * @brief Releases the memory occupied by vector with the text shadow object {@link OH_Drawing_TextShadow}. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. -- Gitee From 475c4e2224b74ce32e0991e439094267d7bac2d4 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 23 Feb 2024 07:07:35 +0000 Subject: [PATCH 29/32] 1 Signed-off-by: changleipeng --- .../native_drawing/drawing_font_collection.h | 4 +- .../native_drawing/drawing_text_typography.h | 144 +++++++++--------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index 9341d2a5b..425842da6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -66,7 +66,7 @@ void OH_Drawing_DestroyFontCollection(OH_Drawing_FontCollection*); * @brief Disable the font collection fallback. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to a {@link OH_Drawing_FontCollection} object. + * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 12 * @version 1.0 */ @@ -76,7 +76,7 @@ void OH_Drawing_DisableFontCollectionFallback(OH_Drawing_FontCollection*); * @brief Disable the font collection systemfont. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontCollection Indicates the pointer to an {@link OH_Drawing_FontCollection} object. + * @param OH_Drawing_FontCollection Indicates the pointer to an OH_Drawing_FontCollection object. * @since 12 * @version 1.0 */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index b8f10c1e7..747130d76 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -542,8 +542,8 @@ void OH_Drawing_SetTextStyleLocale(OH_Drawing_TextStyle*, const char*); * @brief Sets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ @@ -553,8 +553,8 @@ void OH_Drawing_SetTextStyleForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Gets the foreground brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ @@ -564,8 +564,8 @@ void OH_Drawing_TextStyleGetForegroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Sets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ @@ -575,8 +575,8 @@ void OH_Drawing_SetTextStyleForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Gets the foreground pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ @@ -586,8 +586,8 @@ void OH_Drawing_TextStyleGetForegroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Sets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ @@ -597,8 +597,8 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Gets the background brush style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Brush Indicates the pointer to a brush object {@link OH_Drawing_Brush}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Brush Indicates the pointer to a brush object OH_Drawing_Brush. * @since 12 * @version 1.0 */ @@ -608,8 +608,8 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @brief Sets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ @@ -619,8 +619,8 @@ void OH_Drawing_SetTextStyleBackgroundPen(OH_Drawing_TextStyle*, OH_Drawing_Pen* * @brief Gets the background pen style. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Pen Indicates the pointer to a pen object {@link OH_Drawing_Pen}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Pen Indicates the pointer to a pen object OH_Drawing_Pen. * @since 12 * @version 1.0 */ @@ -1173,7 +1173,7 @@ OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, * @brief Creates an OH_Drawing_FontDescriptor object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the font descriptor object {@link OH_Drawing_FontDescriptor} object created. + * @return Returns the pointer to the font descriptor object OH_Drawing_FontDescriptor created. * @since 12 * @version 1.0 */ @@ -1183,7 +1183,7 @@ OH_Drawing_FontDescriptor* OH_Drawing_CreateFontDescriptor(void); * @brief Releases the memory occupied by an OH_Drawing_FontDescriptor object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontDescriptor the pointer to the font descriptor object {@link OH_Drawing_FontDescriptor} object. + * @param OH_Drawing_FontDescriptor the pointer to the font descriptor object OH_Drawing_FontDescriptor. * @since 12 * @version 1.0 */ @@ -1193,7 +1193,7 @@ void OH_Drawing_DestroyFontDescriptor(OH_Drawing_FontDescriptor*); * @brief Creates an OH_Drawing_FontParser object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the font parser object {@link OH_Drawing_FontParser} object. + * @return Returns the pointer to the font parser object OH_Drawing_FontParser. * @since 12 * @version 1.0 */ @@ -1203,7 +1203,7 @@ OH_Drawing_FontParser* OH_Drawing_CreateFontParser(void); * @brief Releases the memory occupied by an OH_Drawing_FontParser object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. * @since 12 * @version 1.0 */ @@ -1213,7 +1213,7 @@ void OH_Drawing_DestroyFontParser(OH_Drawing_FontParser*); * @brief Gets a list of system font names. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. * @param size_t Returns the number of obtained system font names. * @return Returns a list of obtained system fonts. * @since 12 @@ -1236,7 +1236,7 @@ void OH_Drawing_DestroySystemFontList(char**, size_t); * @brief Gets information about the system font by font name. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_FontParser Indicates the pointer to the font parser object {@link OH_Drawing_FontParser}. + * @param OH_Drawing_FontParser Indicates the pointer to the font parser object OH_Drawing_FontParser. * @param char** font name. * @return Returns system fonts information. * @since 12 @@ -1248,8 +1248,8 @@ OH_Drawing_FontDescriptor* OH_Drawing_FontParserGetFontByName(OH_Drawing_FontPar * @brief Get line metrics information. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. - * @return Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @return Indicates the pointer to a lime metrics object OH_Drawing_LineMetrics. * @since 12 * @version 1.0 */ @@ -1259,7 +1259,7 @@ OH_Drawing_LineMetrics* OH_Drawing_TypographyGetLineMetrics(OH_Drawing_Typograph * @brief Get the number of lines. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object OH_Drawing_LineMetrics. * @return Returns the number of lines. * @since 12 * @version 1.0 @@ -1270,7 +1270,7 @@ size_t OH_Drawing_LineMetricsGetSize(OH_Drawing_LineMetrics*); * @brief Releases the memory occupied by line metrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object OH_Drawing_LineMetrics. * @since 12 * @version 1.0 */ @@ -1280,9 +1280,9 @@ void OH_Drawing_DestroyLineMetrics(OH_Drawing_LineMetrics*); * @brief Gets the specified line by line number. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. * @param int Line number. - * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object OH_Drawing_LineMetrics. * @return Whether the line metrics was obtained. * @since 12 * @version 1.0 @@ -1293,7 +1293,7 @@ bool OH_Drawing_TypographyGetLineMetricsAt(OH_Drawing_Typography*, int, OH_Drawi * @brief Sets the ellipsis of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. * @param char Indicates the line textellipsis. * @since 12 * @version 1.0 @@ -1304,7 +1304,7 @@ void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle*, const cha * @brief Sets the locale of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param char Indicates the pointer to the locale to set. * @since 12 * @version 1.0 @@ -1315,7 +1315,7 @@ void OH_Drawing_SetTypographyTextLocale(OH_Drawing_TypographyStyle*, const char* * @brief Sets the textSplitRatio of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param float Indicates the textSplitRatio of lines to set. * @since 12 * @version 1.0 @@ -1326,7 +1326,7 @@ void OH_Drawing_SetTypographyTextSplitRatio(OH_Drawing_TypographyStyle*, float); * @brief Gets the TextStyle of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @return Returns line text textstyle. * @since 12 * @version 1.0 @@ -1337,7 +1337,7 @@ OH_Drawing_TextStyle* OH_Drawing_TypographyGetTextStyle(OH_Drawing_TypographySty * @brief Gets the EffectiveAlign of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @return Returns line text align. * @since 12 * @version 1.0 @@ -1348,7 +1348,7 @@ int OH_Drawing_TypographyGetEffectiveAlignment(OH_Drawing_TypographyStyle*); * @brief Gets the UnlimitedLines of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @return Returns whether the text has a maximum line limit, with true indicating a maximum line limit and false indicating no maximum line limit. * @since 12 * @version 1.0 @@ -1359,7 +1359,7 @@ bool OH_Drawing_TypographyIsLineUnlimited(OH_Drawing_TypographyStyle*); * @brief Gets the IsEllipsized of lines in a text file. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @return Returns whether the text has ellipsis, true meaning there is an ellipsis and false meaning there is no ellipsis. * @since 12 * @version 1.0 @@ -1370,8 +1370,8 @@ bool OH_Drawing_TypographyIsEllipsized(OH_Drawing_TypographyStyle*); * @brief set line textstyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ @@ -1381,9 +1381,9 @@ void OH_Drawing_SetTypographyTextStyle(OH_Drawing_TypographyStyle*, OH_Drawing_T * @brief get line fontmetrics. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_Font_Metrics Indicates the pointer to a font metrics object {@link OH_Drawing_Font_Metrics}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_Font_Metrics Indicates the pointer to a font metrics object OH_Drawing_Font_Metrics. * @return Whether the font metrics was obtained. * @since 12 * @version 1.0 @@ -1394,11 +1394,11 @@ bool OH_Drawing_TextStyleGetFontMetrics(OH_Drawing_Typography*, OH_Drawing_TextS * @brief Gets the position of the specified line or the first text of the specified line. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. * @param int Line number. * @param bool True is the information for the whole line, and false is the information to get the first character * @param bool Whether the text width contains whitespace. - * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object {@link OH_Drawing_LineMetrics}. + * @param OH_Drawing_LineMetrics Indicates the pointer to a lime metrics object OH_Drawing_LineMetrics. * @return return whether the information was successfully fetched. * @since 12 * @version 1.0 @@ -1409,7 +1409,7 @@ bool OH_Drawing_TypographyGetLineInfo(OH_Drawing_Typography*, int, bool, bool, O * @brief Sets the font weight of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param int Indicates the font weight of text typography to set. For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 @@ -1420,7 +1420,7 @@ void OH_Drawing_SetTypographyTextFontWeight(OH_Drawing_TypographyStyle*, int); * @brief Sets the font style of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param int Indicates the font style of text typography to set. For details, see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 @@ -1431,7 +1431,7 @@ void OH_Drawing_SetTypographyTextFontStyle(OH_Drawing_TypographyStyle*, int); * @brief Sets the font family of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param char Indicates the pointer to the font family of text typography to set. * @since 12 * @version 1.0 @@ -1442,7 +1442,7 @@ void OH_Drawing_SetTypographyTextFontFamily(OH_Drawing_TypographyStyle*, const c * @brief Sets the font size of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param double Indicates the font size of text typography to set. * @since 12 * @version 1.0 @@ -1453,7 +1453,7 @@ void OH_Drawing_SetTypographyTextFontSize(OH_Drawing_TypographyStyle*, double); * @brief Sets the font height of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param double Indicates the font height of text typography to set. * @since 12 * @version 1.0 @@ -1464,7 +1464,7 @@ void OH_Drawing_SetTypographyTextFontHeight(OH_Drawing_TypographyStyle*, double) * @brief Sets the half leading of text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param bool Indicates the half leading of text typography to set. * @since 12 * @version 1.0 @@ -1475,7 +1475,7 @@ void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); * @brief Sets whether to enable line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param bool Indicates whether the line style for text typography is used. * @since 12 * @version 1.0 @@ -1486,7 +1486,7 @@ void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool) * @brief Sets the font weight of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param int Indicates the font weight of line style for text typography to set. For details, see the enum OH_Drawing_FontWeight. * @since 12 * @version 1.0 @@ -1497,7 +1497,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontWeight(OH_Drawing_TypographyStyle* * @brief Sets the font style of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param int Indicates the font style of line style for text typography to set. For details, see the enum OH_Drawing_FontStyle. * @since 12 * @version 1.0 @@ -1508,7 +1508,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, * @brief Sets the font families of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param int Indicates the number of font families to set. * @param char Indicates the pointer to the font families of line style for text typography to set. * @since 12 @@ -1521,7 +1521,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyl * @brief Sets the font size of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param double Indicates the font size of line style for text typography to set. * @since 12 * @version 1.0 @@ -1532,7 +1532,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontSize(OH_Drawing_TypographyStyle*, * @brief Sets the font height of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param double Indicates the font height of line style for text typography to set. * @since 12 * @version 1.0 @@ -1543,7 +1543,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontHeight(OH_Drawing_TypographyStyle* * @brief Sets the half leading of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param bool Indicates the half leading of line for text typography to set. * @since 12 * @version 1.0 @@ -1554,7 +1554,7 @@ void OH_Drawing_SetTypographyTextLineStyleHalfLeading(OH_Drawing_TypographyStyle * @brief Sets the spacing scale of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param double Indicates the space scale of line for text typography to set. * @since 12 * @version 1.0 @@ -1565,7 +1565,7 @@ void OH_Drawing_SetTypographyTextLineStyleSpacingScale(OH_Drawing_TypographyStyl * @brief Sets whether only line style is enabled for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object {@link OH_Drawing_TypographyStyle}. + * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. * @param bool Indicates the line style for text typography to set only. * @since 12 * @version 1.0 @@ -1576,17 +1576,17 @@ void OH_Drawing_SetTypographyTextLineStyleOnly(OH_Drawing_TypographyStyle*, bool * @brief Creates an OH_Drawing_TextShadow object. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @return Returns the pointer to the text shadow object created {@link OH_Drawing_TextShadow}. + * @return Returns the pointer to the text shadow object created OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ OH_Drawing_TextShadow* OH_Drawing_CreateTextShadow(void); /** - * @brief Releases the memory occupied by the text shadow object {@link OH_Drawing_TextShadow}. + * @brief Releases the memory occupied by the text shadow object OH_Drawing_TextShadow. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ @@ -1596,9 +1596,9 @@ void OH_Drawing_DestroyTextShadow(OH_Drawing_TextShadow*); * @brief Gets the vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. * @param int Indicates the number in vector to set. - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @return Returns the vector of TextShadow. * @since 12 * @version 1.0 @@ -1609,7 +1609,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadows(OH_Drawing_TextStyle*); * @brief Gets the size of vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. * @return Returns the size of vector. * @since 12 * @version 1.0 @@ -1620,8 +1620,8 @@ int OH_Drawing_TextStyleGetShadowCount(OH_Drawing_TextStyle*); * @brief Adds element in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. - * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. + * @param OH_Drawing_TextShadow Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ @@ -1631,7 +1631,7 @@ void OH_Drawing_TextStyleAddShadow(OH_Drawing_TextStyle*, const OH_Drawing_TextS * @brief clear elements in vector of TextShadow in TextStyle. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ @@ -1641,9 +1641,9 @@ void OH_Drawing_TextStyleClearShadows(OH_Drawing_TextStyle*); * @brief Gets element in vector of TextShadow with index. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_TextStyle Indicates the pointer to a text style object {@link OH_Drawing_TextStyle}. + * @param OH_Drawing_TextStyle Indicates the pointer to a text style object OH_Drawing_TextStyle. * @param int Indicates the index to set. - * @return Returns the pointer to element with the index in vector of the text style object {@link OH_Drawing_TextStyle}. + * @return Returns the pointer to element with the index in vector of the text style object OH_Drawing_TextStyle. * @since 12 * @version 1.0 */ @@ -1653,7 +1653,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextSty * @brief Set indents of the typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. * @param float Indicates the pointer to the indents to set. * @since 12 * @version 1.0 @@ -1664,7 +1664,7 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in * @brief Gets element with index in vector of Indents. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Typography Indicates the pointer to a typography object {@link OH_Drawing_Typography}. + * @param OH_Drawing_Typography Indicates the pointer to a typography object OH_Drawing_Typography. * @param int Indicates the index to set. * @return float Indicates the element with the index in vector of Indents. * @since 12 @@ -1673,10 +1673,10 @@ void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float in float OH_Drawing_TypographyGetIndentsWithIndex(OH_Drawing_Typography*, int); /** - * @brief Releases the memory occupied by vector with the text shadow object {@link OH_Drawing_TextShadow}. + * @brief Releases the memory occupied by vector with the text shadow object OH_Drawing_TextShadow. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param Indicates the pointer to the text shadow object {@link OH_Drawing_TextShadow}. + * @param Indicates the pointer to the text shadow object OH_Drawing_TextShadow. * @since 12 * @version 1.0 */ -- Gitee From a9ad897c340d42a13231a4618591c7df5ef4ac33 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Fri, 23 Feb 2024 08:19:52 +0000 Subject: [PATCH 30/32] 1 Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_text_typography.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 747130d76..200f109ad 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1514,8 +1514,7 @@ void OH_Drawing_SetTypographyTextLineStyleFontStyle(OH_Drawing_TypographyStyle*, * @since 12 * @version 1.0 */ -void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle*, - int /* fontFamiliesNumber */, const char* fontFamilies[]); +void OH_Drawing_SetTypographyTextLineStyleFontFamilies(OH_Drawing_TypographyStyle*, int, const char*); /** * @brief Sets the font size of line style for text typography. @@ -1658,7 +1657,7 @@ OH_Drawing_TextShadow* OH_Drawing_TextStyleGetShadowWithIndex(OH_Drawing_TextSty * @since 12 * @version 1.0 */ -void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float indents[]); +void OH_Drawing_TypographySetIndents(OH_Drawing_Typography*, int, const float); /** * @brief Gets element with index in vector of Indents. -- Gitee From 7a4769c391a61644c04b935debc33d6afb8fed31 Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sat, 24 Feb 2024 06:37:31 +0000 Subject: [PATCH 31/32] =?UTF-8?q?=E4=BF=AE=E6=94=B9Table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_font.h | 10 +++++----- .../native_drawing/drawing_text_typography.h | 15 ++++++--------- .../native_drawing/libnative_drawing.ndk.json | 16 ++++++++-------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index cbbec950c..16eae965d 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -144,11 +144,11 @@ void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText); void OH_Drawing_FontDestroy(OH_Drawing_Font*); /** - * @brief Defines a run, supplies storage for the metrics of an SkFont. - * - * @since 12 - * @version 1.0 - */ +* @brief Defines a run, supplies storage for the metrics of an SkFont. +* +* @since 12 +* @version 1.0 +*/ typedef struct OH_Drawing_Font_Metrics { /** Indicating which metrics are valid */ uint32_t flags; diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 200f109ad..3ceb0e0bc 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -337,7 +337,7 @@ typedef struct OH_Drawing_LineMetrics { double height; /** * The distance from the left end of the text to the left end of the container, - * aligned to 0, is the width of the container minus the width of the line of text + * aligned to 0, is the width of the container minus the width of the line of text */ double x; /** @@ -602,7 +602,7 @@ void OH_Drawing_SetTextStyleBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Br * @since 12 * @version 1.0 */ - void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); +void OH_Drawing_TextStyleGetBackgroundBrush(OH_Drawing_TextStyle*, OH_Drawing_Brush*); /** * @brief Sets the background pen style. @@ -833,10 +833,8 @@ bool OH_Drawing_TypographyDidExceedMaxLines(OH_Drawing_Typography*); * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. * @param size_t Indicates the start of range to set. * @param size_t Indicates the end of range to set. - * @param OH_Drawing_RectHeightStyle Indicates the height style to set. - * For details, see the enum OH_Drawing_RectHeightStyle. - * @param OH_Drawing_RectWidthStyle Indicates the width style to set. - * For details, see the enum OH_Drawing_RectWidthStyle. + * @param OH_Drawing_RectHeightStyle Indicates the height style to set. For details, see the enum OH_Drawing_RectHeightStyle. + * @param OH_Drawing_RectWidthStyle Indicates the width style to set. For details, see the enum OH_Drawing_RectWidthStyle. * @return Returns the rects for range. * @since 11 * @version 1.0 @@ -1026,8 +1024,7 @@ size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography*); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration style to set. - * For details, see the enum OH_Drawing_TextDecorationStyle. + * @param int Indicates the text decoration style to set. For details, see the enum OH_Drawing_TextDecorationStyle. * @since 11 * @version 1.0 */ @@ -1483,7 +1480,7 @@ void OH_Drawing_SetTypographyTextHalfLeading(OH_Drawing_TypographyStyle*, bool); void OH_Drawing_SetTypographyTextUseLineStyle(OH_Drawing_TypographyStyle*, bool); /** - * @brief Sets the font weight of line style for text typography. + * @brief Sets the font weight of line style for text typography. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TypographyStyle Indicates the pointer to a typography style object OH_Drawing_TypographyStyle. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3aaac45b8..f218e1b8a 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -204,35 +204,35 @@ "first_introduced": "12", "name": "OH_Drawing_TextStyleGetShadowWithIndex" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TypographyGetIndentsWithIndex" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TextStyleClearShadows" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TextStyleAddShadow" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TextStyleGetShadowCount" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TextStyleGetShadows" }, - { + { "first_introduced": "12", "name": "OH_Drawing_DestroyTextShadow" }, - { + { "first_introduced": "12", "name": "OH_Drawing_CreateTextShadow" }, - { + { "first_introduced": "12", "name": "OH_Drawing_TypographySetIndents" }, -- Gitee From 15b40898e80d94bd865c2d905ede49a1498fcf7d Mon Sep 17 00:00:00 2001 From: changleipeng Date: Sat, 24 Feb 2024 07:13:08 +0000 Subject: [PATCH 32/32] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: changleipeng --- graphic/graphic_2d/native_drawing/drawing_font.h | 10 +++++----- .../native_drawing/drawing_text_typography.h | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index 16eae965d..cbbec950c 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -144,11 +144,11 @@ void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText); void OH_Drawing_FontDestroy(OH_Drawing_Font*); /** -* @brief Defines a run, supplies storage for the metrics of an SkFont. -* -* @since 12 -* @version 1.0 -*/ + * @brief Defines a run, supplies storage for the metrics of an SkFont. + * + * @since 12 + * @version 1.0 + */ typedef struct OH_Drawing_Font_Metrics { /** Indicating which metrics are valid */ uint32_t flags; diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 3ceb0e0bc..f2b08fc8d 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -833,8 +833,10 @@ bool OH_Drawing_TypographyDidExceedMaxLines(OH_Drawing_Typography*); * @param OH_Drawing_Typography Indicates the pointer to an OH_Drawing_Typography object. * @param size_t Indicates the start of range to set. * @param size_t Indicates the end of range to set. - * @param OH_Drawing_RectHeightStyle Indicates the height style to set. For details, see the enum OH_Drawing_RectHeightStyle. - * @param OH_Drawing_RectWidthStyle Indicates the width style to set. For details, see the enum OH_Drawing_RectWidthStyle. + * @param OH_Drawing_RectHeightStyle Indicates the height style to set. + * For details, see the enum OH_Drawing_RectHeightStyle. + * @param OH_Drawing_RectWidthStyle Indicates the width style to set. + * For details, see the enum OH_Drawing_RectWidthStyle. * @return Returns the rects for range. * @since 11 * @version 1.0 @@ -1024,7 +1026,8 @@ size_t OH_Drawing_TypographyGetLineCount(OH_Drawing_Typography*); * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing * @param OH_Drawing_TextStyle Indicates the pointer to an OH_Drawing_TextStyle object. - * @param int Indicates the text decoration style to set. For details, see the enum OH_Drawing_TextDecorationStyle. + * @param int Indicates the text decoration style to set. + * For details, see the enum OH_Drawing_TextDecorationStyle. * @since 11 * @version 1.0 */ -- Gitee