---
title: "RemoteTextMeasurer"
description: "Measures remote text dimensions (width, height, size)."
type: "class"
lastmod: "2026-10-07"
---
## API Reference

> Source set: Android

```kotlin
public class RemoteTextMeasurer(internal val density: RemoteDensity)
```

Measures remote text dimensions (width, height, size).

Follows the `TextMeasurer` pattern from Compose UI.

#### Parameters

| | |
| --- | --- |
| density | density of the measurement environment, used for scaling fonts. |

## Functions

### measure

> Source set: Android

```kotlin
public fun measure(
        text: RemoteString,
        style: RemoteTextStyle = RemoteTextStyle.Default,
        fontSize: RemoteTextUnit? = null,
    ): RemoteTextLayoutResult
```

Measures the dimensions of [text](/jetpack-compose/androidx.compose.remote/remote-creation-compose/properties/text/api) and returns a [RemoteTextLayoutResult](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteTextLayoutResult/api).

If `fontSize` is not specified (null), the font size is taken from `RemoteTextStyle.fontSize`
on `style`, or defaults to 12.rsp if not specified in `style`.

#### Parameters

| | |
| --- | --- |
| text | the remote string to be measured. |
| style | the [RemoteTextStyle](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteTextStyle) to apply. Defaults to `RemoteTextStyle.Default`. |
| fontSize | optional font size override. If null, the font size is taken from [style](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Style), or defaults to 12.rsp. |
