Measure text accurately before laying it out and get font information from your App.
For RN prior to v0.57, use react-native-text-size v2.1.1
textTransform:uppercase
for specsForTextStyles in Android.lineInfoForLine
option, to get information for a given line.lineInfoForLine
and replaces v2.1.0flatHeights
better performace by avoiding multiple creation of NSTextStorage.Bump v2.0.0 :tada:
FontSize
constants.flatHeights
to calculate the height of multiple strings at once, much faster than measure
.capHeight
and xHeight
from the fontFromSpecs
result.usePreciseWidth
(default false
) request the most accurate calculation of the width (Android) and the value of lastWidth
(both), but its is a bit slower.specsForTextStyles
function returns fontSize amd letterSpacing with unscaled values, to allow the use with allowFontScaling
.Arguments.fromList
does not exists in RN 0.52, replaced with Arguments.fromArray
WARNING
The package id has changed, you must uninstall the previous version before using this one.
specsForTextStyles
, fontFromSpecs
, and fontFamilyNames
allowFontScaling
is handled in the native side, index.js was simplified a lot.com.github.amarcruz.rntextsize
for Android, and RNTextSize
for iOS.measure
now is the same as Android.Tested compilation for SDK 21