# rememberTextMeasurer

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/ui/text/rememberTextMeasurer.composable#rememberTextMeasurer(kotlin.Int)(cacheSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates and remembers a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. | Cmn |

## Functions

### rememberTextMeasurer

Cmn Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/TextMeasurerHelper.kt+function:rememberTextMeasurer) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0)

```
@Composable
fun rememberTextMeasurer(cacheSize: Int = DefaultCacheSize): TextMeasurer
```

Creates and remembers a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. All parameters that are required for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` except `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#rememberTextMeasurer(kotlin.Int)` are read from CompositionLocals. Created `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` carries an internal `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutCache` with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#rememberTextMeasurer(kotlin.Int)` capacity. Provide 0 for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#rememberTextMeasurer(kotlin.Int)` to opt-out from internal caching behavior.

| Parameters |
|---|---|
| `cacheSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultCacheSize` | Capacity of internal cache inside `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. Size unit is the number of unique text layout inputs that are measured. Value of this parameter highly depends on the consumer use case. Provide a cache size that is in line with how many distinct text layouts are going to be calculated by this measurer repeatedly. If you are animating font attributes, or any other layout affecting input, cache can be skipped because most repeated measure calls would miss the cache. |