Text
High level PICO design component to display text.
Its TextStyle uses LocalTextStyle provided by PICO design components.
For easy use, put some TextStyle's params here as it is.
Parameters
The text to be displayed.
Modifier to apply to this layout node.
Color to apply to the text. If Color.Unspecified, and style has no color set, this will be Color.Unspecified.
Enable auto sizing for this text composable. Finds the biggest font size that fits in the available space and lays the text out with this size. This performs multiple layout passes and can be slower than using a fixed font size. This takes precedence over sizes defined through fontSize and style. See TextAutoSize.
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). See TextStyle.fontStyle.
The typeface thickness to use when painting the text (e.g., FontWeight.Bold).
The font family to be used when rendering the text. See TextStyle.fontFamily.
The amount of space to add between each letter. See TextStyle.letterSpacing.
The decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration.
The alignment of the text within the lines of the paragraph. See TextStyle.textAlign.
Line height for the Paragraph in TextUnit units, e.g. SP or EM. See TextStyle.lineHeight.
How visual overflow should be handled.
Callback that is executed when a new text layout is calculated. A TextLayoutResult object that callback provides contains paragraph information, size of the text, baselines and other details. The callback can be used to add additional decoration or functionality to the text. For example, to draw selection around the text.
Style configuration for the text such as color, font, line height etc.
Samples
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.pico.spatial.ui.design.ProvideTextStyle
import com.pico.spatial.ui.design.Text
fun main() {
//sampleStart
ProvideTextStyle(TextStyle.Default) {
Text("Text sample", color = Color.White, fontSize = 30.sp)
}
//sampleEnd
}High level PICO design component to display text.
Its TextStyle uses LocalTextStyle provided by PICO design components.
For easy use, put some TextStyle's params here as it is.
Parameters
The text to be displayed.
Modifier to apply to this layout node.
Color to apply to the text. If Color.Unspecified, and style has no color set, this will be Color.Unspecified.
Vibrant to apply to the text. If Vibrant.Termination is provided, then no vibrant is applied. If Vibrant.Unspecified is provided, then it follows its ancestor's Vibrant effect. Default is LocalContentVibrant.
Enable auto sizing for this text composable. Finds the biggest font size that fits in the available space and lays the text out with this size. This performs multiple layout passes and can be slower than using a fixed font size. This takes precedence over sizes defined through fontSize and style. See TextAutoSize.
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). See TextStyle.fontStyle.
The typeface thickness to use when painting the text (e.g., FontWeight.Bold).
The font family to be used when rendering the text. See TextStyle.fontFamily.
The amount of space to add between each letter. See TextStyle.letterSpacing.
The decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration.
The alignment of the text within the lines of the paragraph. See TextStyle.textAlign.
Line height for the Paragraph in TextUnit units, e.g. SP or EM. See TextStyle.lineHeight.
How visual overflow should be handled.
Callback that is executed when a new text layout is calculated. A TextLayoutResult object that callback provides contains paragraph information, size of the text, baselines and other details. The callback can be used to add additional decoration or functionality to the text. For example, to draw selection around the text.
Style configuration for the text such as color, font, line height etc.
Samples
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.pico.spatial.ui.design.ProvideTextStyle
import com.pico.spatial.ui.design.Text
fun main() {
//sampleStart
ProvideTextStyle(TextStyle.Default) {
Text("Text sample", color = Color.White, fontSize = 30.sp)
}
//sampleEnd
}High level PICO design component to display text.
Its TextStyle uses LocalTextStyle provided by PICO design components.
For easy use, put some TextStyle's params here as it is.
Parameters
The text to be displayed.
Modifier to apply to this layout node.
Color to apply to the text. If Color.Unspecified, and style has no color set, this will be Color.Unspecified.
Enable auto sizing for this text composable. Finds the biggest font size that fits in the available space and lays the text out with this size. This performs multiple layout passes and can be slower than using a fixed font size. This takes precedence over sizes defined through fontSize and style. See TextAutoSize.
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). See TextStyle.fontStyle.
The typeface thickness to use when painting the text (e.g., FontWeight.Bold).
The font family to be used when rendering the text. See TextStyle.fontFamily.
The amount of space to add between each letter. See TextStyle.letterSpacing.
The decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration.
The alignment of the text within the lines of the paragraph. See TextStyle.textAlign.
Line height for the Paragraph in TextUnit units, e.g. SP or EM. See TextStyle.lineHeight.
How visual overflow should be handled.
A map store composables that replaces certain ranges of the text. It's used to insert composables into text layout. Check InlineTextContent for more information.
Callback that is executed when a new text layout is calculated. A TextLayoutResult object that callback provides contains paragraph information, size of the text, baselines and other details. The callback can be used to add additional decoration or functionality to the text. For example, to draw selection around the text.
Style configuration for the text such as color, font, line height etc.
Samples
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.pico.spatial.ui.design.ProvideTextStyle
import com.pico.spatial.ui.design.Text
fun main() {
//sampleStart
ProvideTextStyle(TextStyle.Default) {
Text("Text sample", color = Color.White, fontSize = 30.sp)
}
//sampleEnd
}