1# drawing_text_run.h
2
3
4## Overview
5
6The **drawing_text_run.h** file declares the capabilities of runs, such as obtaining the typographic boundary and drawing.
7
8**File to include**: <native_drawing/drawing_text_run.h>
9
10**Library**: libnative_drawing.so
11
12**Since**: 14
13
14**Related module**: [Drawing](_drawing.md)
15
16
17## Summary
18
19
20### Functions
21
22| Name| Description|
23| -------- | -------- |
24| [OH_Drawing_Array](_drawing.md#oh_drawing_array) \* [OH_Drawing_GetRunStringIndices](_drawing.md#oh_drawing_getrunstringindices) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains character indices of glyphs within a specified range of a run, where the indices are offsets relative to the entire paragraph. |
25| uint64_t [OH_Drawing_GetRunStringIndicesByIndex](_drawing.md#oh_drawing_getrunstringindicesbyindex) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*stringIndices, size_t index) | Obtains character indices of glyphs in a run by index. |
26| void [OH_Drawing_DestroyRunStringIndices](_drawing.md#oh_drawing_destroyrunstringindices) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*stringIndices) | Releases the pointer to a character index array. |
27| void [OH_Drawing_GetRunStringRange](_drawing.md#oh_drawing_getrunstringrange) (OH_Drawing_Run \*run, uint64_t \*location, uint64_t \*length) | Obtains the range of glyphs generated by a run. |
28| float [OH_Drawing_GetRunTypographicBounds](_drawing.md#oh_drawing_getruntypographicbounds) (OH_Drawing_Run \*run, float \*ascent, float \*descent, float \*leading) | Obtains the typographic boundary of a run. The typographic boundary is related to the font and font size used for typography, but not the characters within the text. |
29| void [OH_Drawing_RunPaint](_drawing.md#oh_drawing_runpaint) ([OH_Drawing_Canvas](_drawing.md#oh_drawing_canvas) \*canvas, OH_Drawing_Run \*run, double x, double y) | Paints the text contained in a run on the canvas. |
30| [OH_Drawing_Rect](_drawing.md#oh_drawing_rect) \* [OH_Drawing_GetRunImageBounds](_drawing.md#oh_drawing_getrunimagebounds) (OH_Drawing_Run \*run) | Obtains the image boundary of a run. The image boundary is related to characters and is equivalent to the visual boundary. |
31| void [OH_Drawing_DestroyRunImageBounds](_drawing.md#oh_drawing_destroyrunimagebounds) ([OH_Drawing_Rect](_drawing.md#oh_drawing_rect) \*rect) | Releases the pointer to an image boundary object of a run. |
32| [OH_Drawing_Array](_drawing.md#oh_drawing_array) \* [OH_Drawing_GetRunGlyphs](_drawing.md#oh_drawing_getrunglyphs) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains an array of glyphs within the specified range of a run. |
33| uint16_t [OH_Drawing_GetRunGlyphsByIndex](_drawing.md#oh_drawing_getrunglyphsbyindex) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*glyphs, size_t index) | Obtains individual glyphs in a run by index. |
34| void [OH_Drawing_DestroyRunGlyphs](_drawing.md#oh_drawing_destroyrunglyphs) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*glyphs) | Releases the pointer to a glyph array in a run. |
35| [OH_Drawing_Array](_drawing.md#oh_drawing_array) \* [OH_Drawing_GetRunPositions](_drawing.md#oh_drawing_getrunpositions) (OH_Drawing_Run \*run, int64_t start, int64_t length) | Obtains the positions of glyphs within the specified range of a run. |
36| [OH_Drawing_Point](_drawing.md#oh_drawing_point) \* [OH_Drawing_GetRunPositionsByIndex](_drawing.md#oh_drawing_getrunpositionsbyindex) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*positions, size_t index) | Obtains the positions of individual glyphs in a run by index. |
37| void [OH_Drawing_DestroyRunPositions](_drawing.md#oh_drawing_destroyrunpositions) ([OH_Drawing_Array](_drawing.md#oh_drawing_array) \*positions) | Releases the pointer to a glyph position array in a run. |
38| uint32_t [OH_Drawing_GetRunGlyphCount](_drawing.md#oh_drawing_getrunglyphcount) (OH_Drawing_Run \*run) | Obtains the number of glyphs in a run. |
39