class RemoteTextMeasurer


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

Follows the TextMeasurer pattern from Compose UI.

Summary

Public constructors

Public functions

RemoteTextLayoutResult
measure(
    text: RemoteString,
    style: RemoteTextStyle,
    fontSize: RemoteTextUnit?
)

Measures the dimensions of text and returns a RemoteTextLayoutResult.

Public constructors

RemoteTextMeasurer

Added in 1.0.0-alpha21
RemoteTextMeasurer(density: RemoteDensity)
Parameters
density: RemoteDensity

density of the measurement environment, used for scaling fonts.

Public functions

measure

Added in 1.0.0-alpha21
fun measure(
    text: RemoteString,
    style: RemoteTextStyle = RemoteTextStyle.Default,
    fontSize: RemoteTextUnit? = null
): RemoteTextLayoutResult

Measures the dimensions of text and returns a RemoteTextLayoutResult.

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: RemoteString

the remote string to be measured.

style: RemoteTextStyle = RemoteTextStyle.Default

the RemoteTextStyle to apply. Defaults to RemoteTextStyle.Default.

fontSize: RemoteTextUnit? = null

optional font size override. If null, the font size is taken from style, or defaults to 12.rsp.