• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_Drawing_Font_Metrics
2
3
4## Overview
5
6The **OH_Drawing_Font_Metrics** struct describes the measurement information about a font.
7
8**Since**: 12
9
10**Related module**: [Drawing](_drawing.md)
11
12**Header file**: [drawing_font.h](drawing__font_8h.md)
13
14## Summary
15
16
17### Member Variables
18
19| Name| Description|
20| -------- | -------- |
21| uint32_t [flags](#flags) | Measurement information that is valid.|
22| float [top](#top) | Maximum distance from the baseline to the highest coordinate of a character.|
23| float [ascent](#ascent) | Recommended distance from the baseline to the highest coordinate of a character.|
24| float [descent](#descent) | Recommended distance from the baseline to the lowest coordinate of a character.|
25| float [bottom](#bottom) | Maximum distance from the baseline to the lowest coordinate of a character.|
26| float [leading](#leading) | Interline spacing.|
27| float [avgCharWidth](#avgcharwidth) | Average character width, or zero if unknown.|
28| float [maxCharWidth](#maxcharwidth) | Maximum character width, or zero if unknown.|
29| float [xMin](#xmin) | Maximum distance to the leftmost of the font bounding box. Generally, the value is a negative value. Variable fonts are not recommended.|
30| float [xMax](#xmax) | Maximum distance to the rightmost of the font bounding box. Generally, the value is a negative value. Variable fonts are not recommended.|
31| float [xHeight](#xheight) | Height of a lowercase letter, or zero if unknown. Generally, the value is a negative value.|
32| float [capHeight](#capheight) | Height of an uppercase letter, or zero if unknown. Generally, the value is a negative value.|
33| float [underlineThickness](#underlinethickness) | Thickness of the underline.|
34| float [underlinePosition](#underlineposition) | Position of the underline, that is, vertical distance from the baseline to the top of the underline. Generally, the value is a positive value.|
35| float [strikeoutThickness](#strikeoutthickness) | Thickness of the strikethrough.|
36| float [strikeoutPosition](#strikeoutposition) | Position of the strikethrough, that is, vertical distance from the baseline to the bottom of the strikethrough. Generally, the value is a negative value.|
37
38
39## Member Variable Description
40
41
42### ascent
43
44```
45float OH_Drawing_Font_Metrics::ascent
46```
47
48**Description**
49
50Recommended distance from the baseline to the highest coordinate of a character.
51
52
53### avgCharWidth
54
55```
56float OH_Drawing_Font_Metrics::avgCharWidth
57```
58
59**Description**
60
61Average character width, or zero if unknown.
62
63
64### bottom
65
66```
67float OH_Drawing_Font_Metrics::bottom
68```
69
70**Description**
71
72Maximum distance from the baseline to the lowest coordinate of a character.
73
74
75### capHeight
76
77```
78float OH_Drawing_Font_Metrics::capHeight
79```
80
81**Description**
82
83Height of an uppercase letter, or zero if unknown. Generally, the value is a negative value.
84
85
86### descent
87
88```
89float OH_Drawing_Font_Metrics::descent
90```
91
92**Description**
93
94Recommended distance from the baseline to the lowest coordinate of a character.
95
96
97### flags
98
99```
100uint32_t OH_Drawing_Font_Metrics::flags
101```
102
103**Description**
104
105Measurement information that is valid.
106
107
108### leading
109
110```
111float OH_Drawing_Font_Metrics::leading
112```
113
114**Description**
115
116Interline spacing.
117
118
119### maxCharWidth
120
121```
122float OH_Drawing_Font_Metrics::maxCharWidth
123```
124
125**Description**
126
127Maximum character width, or zero if unknown.
128
129
130### strikeoutPosition
131
132```
133float OH_Drawing_Font_Metrics::strikeoutPosition
134```
135
136**Description**
137
138Position of the strikethrough, that is, vertical distance from the baseline to the bottom of the strikethrough. Generally, the value is a negative value.
139
140
141### strikeoutThickness
142
143```
144float OH_Drawing_Font_Metrics::strikeoutThickness
145```
146
147**Description**
148
149Thickness of the strikethrough.
150
151
152### top
153
154```
155float OH_Drawing_Font_Metrics::top
156```
157
158**Description**
159
160Maximum distance from the baseline to the highest coordinate of a character.
161
162
163### underlinePosition
164
165```
166float OH_Drawing_Font_Metrics::underlinePosition
167```
168
169**Description**
170
171Position of the underline, that is, vertical distance from the baseline to the top of the underline. Generally, the value is a positive value.
172
173
174### underlineThickness
175
176```
177float OH_Drawing_Font_Metrics::underlineThickness
178```
179
180**Description**
181
182Thickness of the underline.
183
184
185### xHeight
186
187```
188float OH_Drawing_Font_Metrics::xHeight
189```
190
191**Description**
192
193Height of a lowercase letter, or zero if unknown. Generally, the value is a negative value.
194
195
196### xMax
197
198```
199float OH_Drawing_Font_Metrics::xMax
200```
201
202**Description**
203
204Maximum distance to the rightmost of the font bounding box. Generally, the value is a negative value. Variable fonts are not recommended.
205
206
207### xMin
208
209```
210float OH_Drawing_Font_Metrics::xMin
211```
212
213**Description**
214
215Maximum distance to the leftmost of the font bounding box. Generally, the value is a negative value. Variable fonts are not recommended.
216