Text
Basic text component that integrates with Wild's content color system.
The default style uses the LocalTextStyle provided by parent components. If you are setting your own style, consider first retrieving LocalTextStyle and using TextStyle.copy to keep any inherited attributes, only modifying the specific attributes you want to override.
For ease of use, commonly used parameters from TextStyle are also present here. The order of precedence is:
If a parameter is explicitly set here (i.e., it is not
nullor TextUnit.Unspecified), then this parameter will always be used.If a parameter is not set, then the corresponding value from style will be used instead.
For color, if color is not set, and style does not have a color, then LocalContentColor will be used.
Since
0.6.0
Parameters
The text to display.
Modifier to apply to the text.
The color of the text. If Color.Unspecified, and style has no color set, this will be LocalContentColor.
The size of glyphs to use when painting the text. See TextStyle.fontSize.
The typeface variant to use when drawing the letters (e.g., italic).
The typeface thickness to use when painting the text (e.g., FontWeight.Bold).
The font family to be used when rendering the text.
The amount of space to add between each letter.
The decorations to paint on the text (e.g., an underline).
The alignment of the text within the lines of the paragraph.
Line height for the text in TextUnit unit, e.g. SP or EM.
How visual overflow should be handled.
Whether the text should break at soft line breaks.
Maximum number of lines for the text to span.
Minimum number of lines for the text to span.
Callback invoked when the text layout is calculated.
Style configuration for the text such as color, font, line height etc.
Basic text component that displays AnnotatedString content with support for inline styling, spans, and links.
Integrates with Wild's content color system via LocalContentColor and supports typography inheritance via LocalTextStyle.
Since
0.6.0
Parameters
The AnnotatedString to display.
Modifier to apply to the text.
The color of the text. If Color.Unspecified, and style has no color set, this will be LocalContentColor.
The size of glyphs to use when painting the text.
The typeface variant to use when drawing the letters.
The typeface thickness to use when painting the text.
The font family to be used when rendering the text.
The amount of space to add between each letter.
The decorations to paint on the text.
The alignment of the text within the lines of the paragraph.
Line height for the text.
How visual overflow should be handled.
Whether the text should break at soft line breaks.
Maximum number of lines for the text to span.
Minimum number of lines for the text to span.
Callback invoked when the text layout is calculated.
Style configuration for the text.