# TextLayoutInput

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/TextLayoutResult.kt+class:androidx.compose.ui.text.TextLayoutInput) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class TextLayoutInput
  ```

*** ** * ** ***

Holds parameters used to compute text layout.

## Summary

| ### Public constructors |
|---|---|
| `[TextLayoutInput](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#TextLayoutInput(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.unit.Constraints))( text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints )` **This function is deprecated.** Pass a default locale list | Cmn |
| `[TextLayoutInput](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#TextLayoutInput(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.Font.ResourceLoader,androidx.compose.ui.unit.Constraints))( text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, resourceLoader: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints )` **This function is deprecated.** Font.ResourceLoader is replaced with FontFamily.Resolver | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#TextLayoutInput(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,androidx.compose.ui.unit.Constraints)( text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput` | `[copy](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#copy(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.Font.ResourceLoader,androidx.compose.ui.unit.Constraints))( text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, resourceLoader: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints )` **This function is deprecated.** Font.ResourceLoader is deprecated | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#constraints()` The minimum width provided while calculating this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#defaultLocaleList()` The default locale list used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#density()` The density param used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#fontFamilyResolver()` The font resolver used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#layoutDirection()` The layout direction used for computing this text layout. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#maxLines()` The maxLines param used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#overflow()` The overflow param used for computing this text layout | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()` A list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`s inserted into text layout that reserves space to embed icons or custom emojis. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#resourceLoader()` **This property is deprecated.** Replaced with FontFamily.Resolver | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#softWrap()` The maxLines param used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#style()` The text layout used for computing this text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#text()` The text used for computing text layout. | Cmn |

## Public constructors

### TextLayoutInput

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
[TextLayoutInput](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#TextLayoutInput(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.unit.Constraints))(
    text: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    softWrap: Boolean,
    overflow: TextOverflow,
    density: Density,
    layoutDirection: LayoutDirection,
    fontFamilyResolver: FontFamily.Resolver,
    constraints: Constraints
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Pass a default locale list

### TextLayoutInput

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0) Deprecated in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
[TextLayoutInput](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#TextLayoutInput(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.Font.ResourceLoader,androidx.compose.ui.unit.Constraints))(
    text: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    softWrap: Boolean,
    overflow: TextOverflow,
    density: Density,
    layoutDirection: LayoutDirection,
    resourceLoader: Font.ResourceLoader,
    constraints: Constraints
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Font.ResourceLoader is replaced with FontFamily.Resolver, use this instead:
>
> ```kotlin
> TextLayoutInput(text, style, placeholders, maxLines, softWrap, overflow, density, layoutDirection, fontFamilyResolver, constraints)
> ```

### TextLayoutInput

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
TextLayoutInput(
    text: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    maxLines: Int,
    softWrap: Boolean,
    overflow: TextOverflow,
    density: Density,
    layoutDirection: LayoutDirection,
    fontFamilyResolver: FontFamily.Resolver,
    defaultLocaleList: LocaleList,
    constraints: Constraints
)
```

## Public functions

### copy

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0) Deprecated in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun [copy](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#copy(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.Int,kotlin.Boolean,androidx.compose.ui.text.style.TextOverflow,androidx.compose.ui.unit.Density,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.text.font.Font.ResourceLoader,androidx.compose.ui.unit.Constraints))(
    text: AnnotatedString = this.text,
    style: TextStyle = this.style,
    placeholders: List<AnnotatedString.Range<Placeholder>> = this.placeholders,
    maxLines: Int = this.maxLines,
    softWrap: Boolean = this.softWrap,
    overflow: TextOverflow = this.overflow,
    density: Density = this.density,
    layoutDirection: LayoutDirection = this.layoutDirection,
    resourceLoader: Font.ResourceLoader = this.resourceLoader,
    constraints: Constraints = this.constraints
): TextLayoutInput
```

> [!CAUTION]
> **This function is deprecated.**   
> Font.ResourceLoader is deprecated, use this instead:
>
> ```kotlin
> TextLayoutInput(text, style, placeholders, maxLines, softWrap, overFlow, density, layoutDirection, fontFamilyResolver, constraints)
> ```

### equals

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

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

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### constraints

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val constraints: Constraints
```

The minimum width provided while calculating this text layout.

### defaultLocaleList

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val defaultLocaleList: LocaleList
```

The default locale list used for computing this text layout. This locale is used for operations like line breaking and capitalization when no locale list is specified in the text styles.

### density

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val density: Density
```

The density param used for computing this text layout.

### fontFamilyResolver

Cmn Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val fontFamilyResolver: FontFamily.Resolver
```

The font resolver used for computing this text layout.

### layoutDirection

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val layoutDirection: LayoutDirection
```

The layout direction used for computing this text layout.

### maxLines

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val maxLines: Int
```

The maxLines param used for computing this text layout.

### overflow

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val overflow: TextOverflow
```

The overflow param used for computing this text layout

### placeholders

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val placeholders: List<AnnotatedString.Range<Placeholder>>
```

A list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`s inserted into text layout that reserves space to embed icons or custom emojis. A list of bounding boxes will be returned in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#placeholderRects()` that corresponds to this input.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#placeholderRects()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics` |   |

### resourceLoader

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val resourceLoader: Font.ResourceLoader
```

> [!CAUTION]
> **This property is deprecated.**   
> Replaced with FontFamily.Resolver, use this instead:
>
> ```kotlin
> fontFamilyResolver
> ```

### softWrap

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val softWrap: Boolean
```

The maxLines param used for computing this text layout.

### style

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val style: TextStyle
```

The text layout used for computing this text layout.

### text

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val text: AnnotatedString
```

The text used for computing text layout.