You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,13 @@ In both functions, the text to be measured is required, but the rest of the para
23
23
-`fontSize`
24
24
-`fontWeight`
25
25
-`fontStyle`
26
+
-`lineHeight`
27
+
-`numberOfLines`
26
28
-`fontVariant` (iOS)
27
29
-`includeFontPadding` (Android)
28
30
-`textBreakStrategy` (Android)
29
31
-`letterSpacing`
30
32
-`allowFontScaling`
31
-
-`numberOfLines`
32
33
-`width`: Constraint for automatic line-break based on text-break strategy.
33
34
34
35
In addition, the library includes functions to obtain information about the fonts visible to the App.
@@ -96,12 +97,13 @@ fontFamily | string | OS dependent | The default is the same applied by
96
97
fontWeight | string | 'normal' | On android, numeric ranges has no granularity and '500' to '900' becomes 'bold', but you can use a `fontFamily` of specific weight ("sans-serif-thin", "sans-serif-medium", etc).
97
98
fontSize | number | 14 | The default font size comes from RN.
98
99
fontStyle | string | 'normal' | One of "normal" or "italic".
100
+
lineHeight | number | (none) | The line height of each line. Defaults to the font size.
101
+
numberOfLines | number | (none) | Limit the number of lines the text can render on
99
102
fontVariant | array | (none) | _iOS only_
100
103
allowFontScaling | boolean | true | To respect the user' setting of large fonts (i.e. use SP units).
101
104
letterSpacing | number | (none) | Additional spacing between characters (aka `tracking`).<br>**Note:** In iOS a zero cancels automatic kerning.<br>_All iOS, Android with API 21+_
102
105
includeFontPadding | boolean | true | Include additional top and bottom padding, to avoid clipping certain characters.<br>_Android only_
103
106
textBreakStrategy | string | 'highQuality' | One of 'simple', 'balanced', or 'highQuality'.<br>_Android only, with API 23+_
104
-
numberOfLines | number | (none) | Limit the number of lines the text can render on
105
107
width | number | MAX_INT | Restrict the width. The resulting height will vary depending on the automatic flow of the text.
106
108
usePreciseWidth | boolean | false | If `true`, the result will include an exact `width` and the `lastLineWidth` property.<br>You can see the effect of this flag in the [sample App][sample-app].
107
109
lineInfoForLine | number | (none) | If `>=0`, the result will include a [lineInfo](#lineinfo) property with information for the required line number.
0 commit comments