TextStyle

Class

Android
public class TextStyle(
    public val color: ColorProvider = TextDefaults.defaultTextColor,
    public val fontSize: TextUnit? = null,
    public val fontWeight: FontWeight? = null,
    public val fontStyle: FontStyle? = null,
    public val textAlign: TextAlign? = null,
    public val textDecoration: TextDecoration? = null,
    public val fontFamily: FontFamily? = null,
)

Description of a text style for the Text composable.

Parameters

coloroptionally specifies the color to use for the text, defaults to TextDefaults.defaultTextColor.
fontSizeoptionally specifies the size to use for the text, defaults to system when null.
fontWeightoptionally specifies the weight to use for the text, defaults to system when null.
fontStyleoptionally specifies style (such as italics) to use for the text, defaults to system when null.
textAlignoptionally specifies the alignment to use for the text, defaults to start when. null.
textDecorationoptionally specifies decorations (e.g. underline) to use for the text, defaults to none when null
fontFamilyoptionally specifies which font family to use for the text, defaults to system when null.

Functions

public fun copy(
        color: ColorProvider = this.color,
        fontSize: TextUnit? = this.fontSize,
        fontWeight: FontWeight? = this.fontWeight,
        fontStyle: FontStyle? = this.fontStyle,
        textAlign: TextAlign? = this.textAlign,
        textDecoration: TextDecoration? = this.textDecoration,
        fontFamily: FontFamily? = this.fontFamily,
    ): TextStyle