AutoSizeText
Composable function that automatically adjusts the text size to fit within given constraints, considering the ratio of line spacing to text size.
Features:
Best performance: Utilizes a dichotomous binary search algorithm for swift and optimal text size determination without unnecessary iterations.
Alignment support: Supports six possible alignment values via the Alignment interface.
Material Design 3 support.
Font scaling support: User-initiated font scaling doesn't affect the visual rendering output.
Multiline Support with maxLines Parameter.
Limitations:
MinLine is set to 1 under the hood and cannot be changed.
Author
Reda El Madini - For support, contact gladiatorkilo@gmail.com or shatz.dan@gmail.com
Parameters
The text to be displayed.
The modifier for the text composable.
The suggested font sizes to choose from.
The minimum text size allowed.
The maximum text size allowed.
The step size for adjusting the text size.
The alignment of the text within its container.
The color of the text.
The font style of the text.
The font weight of the text.
The font family of the text.
The letter spacing of the text.
The text decoration style.
The ratio of line spacing to text size.
The maximum number of lines for the text.
Callback invoked when the text layout is available.
The base style to apply to the text.
Composable function that automatically adjusts the text size to fit within given constraints using AnnotatedString, considering the ratio of line spacing to text size.
Features: Similar to AutoSizeText(String), with support for AnnotatedString.