TextStyle
Class
Android
class TextStyle(
val color: ColorProvider = TextDefaults.defaultTextColor,
val fontSize: TextUnit? = null,
val fontWeight: FontWeight? = null,
val fontStyle: FontStyle? = null,
val textAlign: TextAlign? = null,
val textDecoration: TextDecoration? = null,
val fontFamily: FontFamily? = null,
)
Description of a text style for the androidx.glance.text.Text
composable.
Parameters
color | optionally specifies the color to use for the text, defaults to TextDefaults.defaultTextColor . |
fontSize | optionally specifies the size to use for the text, defaults to system when null. |
fontWeight | optionally specifies the weight to use for the text, defaults to system when null. |
fontStyle | optionally specifies style (such as italics) to use for the text, defaults to system when null. |
textAlign | optionally specifies the alignment to use for the text, defaults to start when. null. |
textDecoration | optionally specifies decorations (e.g. underline) to use for the text, defaults to none when null |
fontFamily | optionally specifies which font family to use for the text, defaults to system when null. |
Functions
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(
color = color,
fontSize = fontSize,
fontWeight = fontWeight,
fontStyle = fontStyle,
textAlign = textAlign,
textDecoration = textDecoration,
fontFamily = fontFamily,
)