TextStyle

class TextStyle


Description of a text style for the androidx.glance.text.Text composable.

Summary

Public constructors

TextStyle(
    color: ColorProvider,
    fontSize: TextUnit?,
    fontWeight: FontWeight?,
    fontStyle: FontStyle?,
    textAlign: TextAlign?,
    textDecoration: TextDecoration?,
    fontFamily: FontFamily?
)

Public functions

TextStyle
copy(
    color: ColorProvider,
    fontSize: TextUnit?,
    fontWeight: FontWeight?,
    fontStyle: FontStyle?,
    textAlign: TextAlign?,
    textDecoration: TextDecoration?,
    fontFamily: FontFamily?
)
open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

ColorProvider

optionally specifies the color to use for the text, defaults to TextDefaults.defaultTextColor.

FontFamily?

optionally specifies which font family to use for the text, defaults to system when null.

TextUnit?

optionally specifies the size 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.

FontWeight?

optionally specifies the weight 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

Public constructors

TextStyle

Added in 1.0.0
TextStyle(
    color: ColorProvider = TextDefaults.defaultTextColor,
    fontSize: TextUnit? = null,
    fontWeight: FontWeight? = null,
    fontStyle: FontStyle? = null,
    textAlign: TextAlign? = null,
    textDecoration: TextDecoration? = null,
    fontFamily: FontFamily? = null
)
Parameters
color: ColorProvider = TextDefaults.defaultTextColor

optionally specifies the color to use for the text, defaults to TextDefaults.defaultTextColor.

fontSize: TextUnit? = null

optionally specifies the size to use for the text, defaults to system when null.

fontWeight: FontWeight? = null

optionally specifies the weight to use for the text, defaults to system when null.

fontStyle: FontStyle? = null

optionally specifies style (such as italics) to use for the text, defaults to system when null.

textAlign: TextAlign? = null

optionally specifies the alignment to use for the text, defaults to start when. null.

textDecoration: TextDecoration? = null

optionally specifies decorations (e.g. underline) to use for the text, defaults to none when null

fontFamily: FontFamily? = null

optionally specifies which font family to use for the text, defaults to system when null.

Public functions

copy

Added in 1.0.0
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

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

color

Added in 1.0.0
val colorColorProvider

optionally specifies the color to use for the text, defaults to TextDefaults.defaultTextColor.

fontFamily

Added in 1.0.0
val fontFamilyFontFamily?

optionally specifies which font family to use for the text, defaults to system when null.

fontSize

Added in 1.0.0
val fontSizeTextUnit?

optionally specifies the size to use for the text, defaults to system when null.

fontStyle

Added in 1.0.0
val fontStyleFontStyle?

optionally specifies style (such as italics) to use for the text, defaults to system when null.

fontWeight

Added in 1.0.0
val fontWeightFontWeight?

optionally specifies the weight to use for the text, defaults to system when null.

textAlign

Added in 1.0.0
val textAlignTextAlign?

optionally specifies the alignment to use for the text, defaults to start when. null.

textDecoration

Added in 1.0.0
val textDecorationTextDecoration?

optionally specifies decorations (e.g. underline) to use for the text, defaults to none when null