# TextStyle

Artifact: [androidx.glance:glance](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/text/TextStyle.kt+class:androidx.glance.text.TextStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)


```
class TextStyle
```

<br />

*** ** * ** ***

Description of a text style for the `https://developer.android.com/reference/kotlin/androidx/glance/text/Text.composable#Text(kotlin.String,androidx.glance.GlanceModifier,androidx.glance.text.TextStyle,kotlin.Int)` composable.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#TextStyle(androidx.glance.unit.ColorProvider,androidx.compose.ui.unit.TextUnit,androidx.glance.text.FontWeight,androidx.glance.text.FontStyle,androidx.glance.text.TextAlign,androidx.glance.text.TextDecoration,androidx.glance.text.FontFamily)( color: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider, fontSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit?, fontWeight: https://developer.android.com/reference/kotlin/androidx/glance/text/FontWeight?, fontStyle: https://developer.android.com/reference/kotlin/androidx/glance/text/FontStyle?, textAlign: https://developer.android.com/reference/kotlin/androidx/glance/text/TextAlign?, textDecoration: https://developer.android.com/reference/kotlin/androidx/glance/text/TextDecoration?, fontFamily: https://developer.android.com/reference/kotlin/androidx/glance/text/FontFamily? )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#copy(androidx.glance.unit.ColorProvider,androidx.compose.ui.unit.TextUnit,androidx.glance.text.FontWeight,androidx.glance.text.FontStyle,androidx.glance.text.TextAlign,androidx.glance.text.TextDecoration,androidx.glance.text.FontFamily)( color: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider, fontSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit?, fontWeight: https://developer.android.com/reference/kotlin/androidx/glance/text/FontWeight?, fontStyle: https://developer.android.com/reference/kotlin/androidx/glance/text/FontStyle?, textAlign: https://developer.android.com/reference/kotlin/androidx/glance/text/TextAlign?, textDecoration: https://developer.android.com/reference/kotlin/androidx/glance/text/TextDecoration?, fontFamily: https://developer.android.com/reference/kotlin/androidx/glance/text/FontFamily? )` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#color()` optionally specifies the color to use for the text, defaults to `https://developer.android.com/reference/kotlin/androidx/glance/text/TextDefaults#defaultTextColor()`. |
| `https://developer.android.com/reference/kotlin/androidx/glance/text/FontFamily?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#fontFamily()` optionally specifies which font family to use for the text, defaults to system when null. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#fontSize()` optionally specifies the size to use for the text, defaults to system when null. |
| `https://developer.android.com/reference/kotlin/androidx/glance/text/FontStyle?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#fontStyle()` optionally specifies style (such as italics) to use for the text, defaults to system when null. |
| `https://developer.android.com/reference/kotlin/androidx/glance/text/FontWeight?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#fontWeight()` optionally specifies the weight to use for the text, defaults to system when null. |
| `https://developer.android.com/reference/kotlin/androidx/glance/text/TextAlign?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#textAlign()` optionally specifies the alignment to use for the text, defaults to start when. null. |
| `https://developer.android.com/reference/kotlin/androidx/glance/text/TextDecoration?` | `https://developer.android.com/reference/kotlin/androidx/glance/text/TextStyle#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](https://developer.android.com/jetpack/androidx/releases/glance#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: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider = TextDefaults.defaultTextColor` | optionally specifies the color to use for the text, defaults to `https://developer.android.com/reference/kotlin/androidx/glance/text/TextDefaults#defaultTextColor()`. |
| `fontSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit? = null` | optionally specifies the size to use for the text, defaults to system when null. |
| `fontWeight: https://developer.android.com/reference/kotlin/androidx/glance/text/FontWeight? = null` | optionally specifies the weight to use for the text, defaults to system when null. |
| `fontStyle: https://developer.android.com/reference/kotlin/androidx/glance/text/FontStyle? = null` | optionally specifies style (such as italics) to use for the text, defaults to system when null. |
| `textAlign: https://developer.android.com/reference/kotlin/androidx/glance/text/TextAlign? = null` | optionally specifies the alignment to use for the text, defaults to start when. null. |
| `textDecoration: https://developer.android.com/reference/kotlin/androidx/glance/text/TextDecoration? = null` | optionally specifies decorations (e.g. underline) to use for the text, defaults to none when null |
| `fontFamily: https://developer.android.com/reference/kotlin/androidx/glance/text/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](https://developer.android.com/jetpack/androidx/releases/glance#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](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val color: ColorProvider
```

optionally specifies the color to use for the text, defaults to `https://developer.android.com/reference/kotlin/androidx/glance/text/TextDefaults#defaultTextColor()`.

### fontFamily

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val fontFamily: FontFamily?
```

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

### fontSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val fontSize: TextUnit?
```

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

### fontStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val fontStyle: FontStyle?
```

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

### fontWeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val fontWeight: FontWeight?
```

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

### textAlign

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val textAlign: TextAlign?
```

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

### textDecoration

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val textDecoration: TextDecoration?
```

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