diff --git a/graphic/graphic_2d/native_drawing/drawing_text_typography.h b/graphic/graphic_2d/native_drawing/drawing_text_typography.h index 90c0ebb964acfeefceb261dc2d170995ffbbd781..296044b877bf02fa088d28d715e517e4ac59e50a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_typography.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_typography.h @@ -1943,6 +1943,28 @@ bool OH_Drawing_TextStyleGetHalfLeading(OH_Drawing_TextStyle*); */ const char* OH_Drawing_TextStyleGetLocale(OH_Drawing_TextStyle*); +/* @brief Getting all font metrics from target row. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Typography Indicates a pointer to a typesetting object. + * @param lineNumber Indicates specifies the number of rows. + * @param fontMetricsSize Indicates the return size of font metrics struct from current line. + * @return Returns all character measures for the current row. + * @since 12 + * @version 1.0 + */ +OH_Drawing_Font_Metrics* OH_Drawing_TypographyGetLineFontMetrics(OH_Drawing_Typography*, + size_t lineNumber, size_t* fontMetricsSize); + +/** + * @brief Free up all the space taken up by the lineFontMetric. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Font_Metrics Indicates the first address of the lineFontMetric gather to be destroyed. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_TypographyDestroyLineFontMetrics(OH_Drawing_Font_Metrics*); #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 b0ed71fce71647195f16c80b7b7b71d7bbb9ffe2..4ba8eb1f87fc0834e88f95226091fd6f85517980 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -897,5 +897,13 @@ { "first_introduced": "12", "name": "OH_Drawing_TextStyleGetLocale" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyGetLineFontMetrics" + }, + { + "first_introduced": "12", + "name": "OH_Drawing_TypographyDestroyLineFontMetrics" } ] \ No newline at end of file