# MultiParagraphIntrinsics

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/MultiParagraphIntrinsics.kt+class:androidx.compose.ui.text.MultiParagraphIntrinsics) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class MultiParagraphIntrinsics : ParagraphIntrinsics
  ```

*** ** * ** ***

Calculates and provides the intrinsic width and height of text that contains `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle#textDirection()` is not set, or any of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#placeholders()` crosses paragraph boundary. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` |   |

## Summary

| ### Public constructors |
|---|---|
| `[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver))( annotatedString: 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>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver )` **This function is deprecated.** Use an overload with \`softWrap\` instead | Cmn |
| `[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))( annotatedString: 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>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, resourceLoader: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader )` **This function is deprecated.** Font.ResourceLoader is deprecated, call with fontFamilyResolver | Cmn |
| `[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.Boolean))( annotatedString: 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>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** Use an overload with \`defaultLocaleList\` instead | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)( annotatedString: 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>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList )` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#annotatedString()` the text to be laid out | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#hasStaleResolvedFonts()` Any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` rendered using this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` will be measured and drawn using stale resolved fonts. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#maxIntrinsicWidth()` Returns the smallest width beyond which increasing the width never decreases the height. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#minIntrinsicWidth()` The width for text if all soft wrap opportunities were taken. | 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/MultiParagraphIntrinsics#placeholders()` a list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`s that specify ranges of text which will be skipped during layout and replaced with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`. | Cmn |

## Public constructors

### MultiParagraphIntrinsics

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

```
[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver))(
    annotatedString: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use an overload with \`softWrap\` instead, use this instead:
>
> ```kotlin
> MultiParagraphIntrinsics(annotatedString, style, placeholders, density, fontFamilyResolver, true)
> ```

### MultiParagraphIntrinsics

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)

```
[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))(
    annotatedString: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    density: Density,
    resourceLoader: Font.ResourceLoader
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Font.ResourceLoader is deprecated, call with fontFamilyResolver, use this instead:
>
> ```kotlin
> MultiParagraphIntrinsics(annotatedString, style, placeholders, density, createFontFamilyResolver(resourceLoader), true)
> ```

### MultiParagraphIntrinsics

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

```
[MultiParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#MultiParagraphIntrinsics(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.Boolean))(
    annotatedString: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    softWrap: Boolean
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use an overload with \`defaultLocaleList\` instead, use this instead:
>
> ```kotlin
> MultiParagraphIntrinsics(annotatedString, style, placeholders, density, fontFamilyResolver, softWrap, LocaleList.current)
> ```

### MultiParagraphIntrinsics

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

```
MultiParagraphIntrinsics(
    annotatedString: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    softWrap: Boolean,
    defaultLocaleList: LocaleList
)
```

| Parameters |
|---|---|
| `annotatedString: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | the text to be laid out |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to be applied to the whole text |
| `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>>` | a list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`s that specify ranges of text which will be skipped during layout and replaced with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`. It's required that the range of each `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` doesn't cross paragraph boundary, otherwise `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` is thrown. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | density of the device |
| `fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader` to be used to load the font given in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`s |
| `softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the text should break at soft line breaks. When the intention is to lay out text as a single line, setting `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics#(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)` to false enables optimizations that avoid certain expensive calculations |
| `defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | the default locale list to use for formatting. |

## Public properties

### annotatedString

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

```
val annotatedString: AnnotatedString
```

the text to be laid out

### hasStaleResolvedFonts

Cmn

```
open val hasStaleResolvedFonts: Boolean
```

Any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` rendered using this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` will be measured and drawn using stale resolved fonts.

If this is false, this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` is using the most current font resolution from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver`.

If this is true, recreating this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` will use new fonts from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` for both display and measurement. Recreating this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` and displaying the resulting `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` causes user-visible reflow of the displayed text.

Once true, this will never become false without recreating this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics`.

It is discouraged, but safe, to continue to use this object after this becomes true. The only impact of using this object after `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics#hasStaleResolvedFonts()` becomes true is stale resolutions of async fonts for measurement and display.

### maxIntrinsicWidth

Cmn

```
open val maxIntrinsicWidth: Float
```

Returns the smallest width beyond which increasing the width never decreases the height.

### minIntrinsicWidth

Cmn

```
open val minIntrinsicWidth: Float
```

The width for text if all soft wrap opportunities were taken.

### 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 that specify ranges of text which will be skipped during layout and replaced with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`. It's required that the range of each `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` doesn't cross paragraph boundary, otherwise `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` is thrown.