# ReusableTextStyleScope

> Mutable [TextStyleScope] implementation reused across layout and draw passes to avoid allocations.

## API Reference

> Source set: Common

```kotlin
public class ReusableTextStyleScope : TextStyleScope
```

Mutable [TextStyleScope](https://composables.com/jetpack-compose/androidx.compose.ui/ui-text/interfaces/TextStyleScope/api.md) implementation reused across layout and draw passes to avoid
allocations.

## Properties

### color

> Source set: Common

```kotlin
public var color: Color = Color.Unspecified
```

Color to apply to the text, or `Color.Unspecified` if not set.

### brush

> Source set: Common

```kotlin
public var brush: Brush? = null
```

`Brush` for painting the text, or `null` if not set.

### alpha

> Source set: Common

```kotlin
public var alpha: Float = Float.NaN
```

Opacity of the text (0.0 to 1.0) applied when `brush` is provided, or `Float.NaN` if not set.

### fontSize

> Source set: Common

```kotlin
public var fontSize: TextUnit = TextUnit.Unspecified
```

Size of glyphs to use when painting the text, or `TextUnit.Unspecified` if not set.

### fontWeight

> Source set: Common

```kotlin
public var fontWeight: FontWeight? = null
```

Typeface thickness to use when painting the text, or `null` if not set.

### fontStyle

> Source set: Common

```kotlin
public val fontStyle: FontStyle?
```

Typeface variant to use when drawing letters, or `null` if not set.

### fontSynthesis

> Source set: Common

```kotlin
public val fontSynthesis: FontSynthesis?
```

Font synthesis rules determining if and how bold/italic styles are synthesized when the font
family does not natively support them, or `null` if not set.

### fontFamily

> Source set: Common

```kotlin
public var fontFamily: FontFamily? = null
```

Font family used when rendering text, or `null` if not set.

### fontFeatureSettings

> Source set: Common

```kotlin
public var fontFeatureSettings: String? = null
```

Advanced typography settings in CSS format, or `null` if not set.

### letterSpacing

> Source set: Common

```kotlin
public var letterSpacing: TextUnit = TextUnit.Unspecified
```

Amount of space to add between letters, or `TextUnit.Unspecified` if not set.

### baselineShift

> Source set: Common

```kotlin
public var baselineShift: BaselineShift = BaselineShift.Unspecified
```

Vertical shift amount from the baseline, or `BaselineShift.Unspecified` if not set.

### textGeometricTransform

> Source set: Common

```kotlin
public var textGeometricTransform: TextGeometricTransform? = null
```

Geometric transformation to apply to the text, or `null` if not set.

### localeList

> Source set: Common

```kotlin
public var localeList: LocaleList? = null
```

Locale list used to select region-specific glyphs, or `null` if not set.

### background

> Source set: Common

```kotlin
public var background: Color = Color.Unspecified
```

Background color covering the entire line height from start to end, or `Color.Unspecified` if
not set.

### textDecoration

> Source set: Common

```kotlin
public var textDecoration: TextDecoration? = null
```

Decorations to paint on the text, or `null` if not set.

### shadow

> Source set: Common

```kotlin
public var shadow: Shadow? = null
```

Shadow effect applied to the text, or `null` if not set.

### drawStyle

> Source set: Common

```kotlin
public var drawStyle: DrawStyle? = null
```

Drawing style of the text (fill or stroke), or `null` if not set.

### textAlign

> Source set: Common

```kotlin
public val textAlign: TextAlign
```

Alignment of the text within lines of the paragraph, or `TextAlign.Unspecified` if not set.

### textDirection

> Source set: Common

```kotlin
public val textDirection: TextDirection
```

Algorithm used to resolve text direction, or `TextDirection.Unspecified` if not set.

### lineHeight

> Source set: Common

```kotlin
public var lineHeight: TextUnit = TextUnit.Unspecified
```

Line height for the paragraph, or `TextUnit.Unspecified` if not set.

### textIndent

> Source set: Common

```kotlin
public var textIndent: TextIndent? = null
```

Paragraph indentation, or `null` if not set.

### platformStyle

> Source set: Common

```kotlin
public var platformStyle: PlatformTextStyle? = null
```

Platform-specific text styling parameters, or `null` if not set.

### lineHeightStyle

> Source set: Common

```kotlin
public var lineHeightStyle: LineHeightStyle? = null
```

Line height distribution configuration, or `null` if not set.

### lineBreak

> Source set: Common

```kotlin
public val lineBreak: LineBreak
```

Line breaking configuration of the paragraph, or `LineBreak.Unspecified` if not set.

### hyphens

> Source set: Common

```kotlin
public val hyphens: Hyphens
```

Hyphenation configuration of the paragraph, or `Hyphens.Unspecified` if not set.

### textMotion

> Source set: Common

```kotlin
public var textMotion: TextMotion? = null
```

Text character placement optimization for animated or static text, or `null` if not set.

## Functions

### setTextStyle

> Source set: Common

```kotlin
override fun setTextStyle(style: TextStyle)
```

### setColor

> Source set: Common

```kotlin
override fun setColor(color: Color)
```

### setBrush

> Source set: Common

```kotlin
override fun setBrush(brush: Brush)
```

### setAlpha

> Source set: Common

```kotlin
override fun setAlpha(alpha: Float)
```

### setFontSize

> Source set: Common

```kotlin
override fun setFontSize(fontSize: TextUnit)
```

### setFontWeight

> Source set: Common

```kotlin
override fun setFontWeight(fontWeight: FontWeight)
```

### setFontStyle

> Source set: Common

```kotlin
override fun setFontStyle(fontStyle: FontStyle)
```

### setFontSynthesis

> Source set: Common

```kotlin
override fun setFontSynthesis(fontSynthesis: FontSynthesis)
```

### setFontFamily

> Source set: Common

```kotlin
override fun setFontFamily(fontFamily: FontFamily)
```

### setFontFeatureSettings

> Source set: Common

```kotlin
override fun setFontFeatureSettings(fontFeatureSettings: String)
```

### setLetterSpacing

> Source set: Common

```kotlin
override fun setLetterSpacing(letterSpacing: TextUnit)
```

### setBaselineShift

> Source set: Common

```kotlin
override fun setBaselineShift(baselineShift: BaselineShift)
```

### setTextGeometricTransform

> Source set: Common

```kotlin
override fun setTextGeometricTransform(textGeometricTransform: TextGeometricTransform)
```

### setLocaleList

> Source set: Common

```kotlin
override fun setLocaleList(localeList: LocaleList)
```

### setBackground

> Source set: Common

```kotlin
override fun setBackground(background: Color)
```

### setTextDecoration

> Source set: Common

```kotlin
override fun setTextDecoration(textDecoration: TextDecoration)
```

### setShadow

> Source set: Common

```kotlin
override fun setShadow(shadow: Shadow)
```

### setDrawStyle

> Source set: Common

```kotlin
override fun setDrawStyle(drawStyle: DrawStyle)
```

### setTextAlign

> Source set: Common

```kotlin
override fun setTextAlign(textAlign: TextAlign)
```

### setTextDirection

> Source set: Common

```kotlin
override fun setTextDirection(textDirection: TextDirection)
```

### setLineHeight

> Source set: Common

```kotlin
override fun setLineHeight(lineHeight: TextUnit)
```

### setTextIndent

> Source set: Common

```kotlin
override fun setTextIndent(textIndent: TextIndent)
```

### setPlatformStyle

> Source set: Common

```kotlin
override fun setPlatformStyle(platformStyle: PlatformTextStyle)
```

### setLineHeightStyle

> Source set: Common

```kotlin
override fun setLineHeightStyle(lineHeightStyle: LineHeightStyle)
```

### setLineBreak

> Source set: Common

```kotlin
override fun setLineBreak(lineBreak: LineBreak)
```

### setHyphens

> Source set: Common

```kotlin
override fun setHyphens(hyphens: Hyphens)
```

### setTextMotion

> Source set: Common

```kotlin
override fun setTextMotion(textMotion: TextMotion)
```

### reset

> Source set: Common

```kotlin
public fun reset()
```

Resets all text attributes to their initial unspecified values.

### hasSameLayoutAffectingAttributes

> Source set: Common

```kotlin
public fun hasSameLayoutAffectingAttributes(other: ReusableTextStyleScope): Boolean
```

Returns whether this scope and `other` have equivalent layout-affecting attributes.

#### Parameters

| | |
| --- | --- |
| other | style scope to compare against |

#### Return

`true` if all layout-affecting attributes match

### hasSameLayoutAffectingAttributes

> Source set: Common

```kotlin
public fun hasSameLayoutAffectingAttributes(style: TextStyle): Boolean
```

Returns whether this scope and `style` have equivalent layout-affecting attributes.

#### Parameters

| | |
| --- | --- |
| style | text style to compare against |

#### Return

`true` if all layout-affecting attributes match

### hasSameDrawAffectingAttributes

> Source set: Common

```kotlin
public fun hasSameDrawAffectingAttributes(other: ReusableTextStyleScope): Boolean
```

Returns whether this scope and `other` have equivalent draw-affecting attributes.

#### Parameters

| | |
| --- | --- |
| other | style scope to compare against |

#### Return

`true` if all draw-affecting attributes match

### hasSameDrawAffectingAttributes

> Source set: Common

```kotlin
public fun hasSameDrawAffectingAttributes(style: TextStyle): Boolean
```

Returns whether this scope and `style` have equivalent draw-affecting attributes.

#### Parameters

| | |
| --- | --- |
| style | text style to compare against |

#### Return

`true` if all draw-affecting attributes match

### copyFrom

> Source set: Common

```kotlin
public fun copyFrom(other: ReusableTextStyleScope)
```

Copies all attributes from `other` into this [ReusableTextStyleScope](https://composables.com/jetpack-compose/androidx.compose.ui/ui-text/classes/ReusableTextStyleScope/api.md).

#### Parameters

| | |
| --- | --- |
| other | source scope to copy attributes from |
