Source set: Android
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
public 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 | the remote string to be measured. |
| style | the RemoteTextStyle to apply. Defaults to RemoteTextStyle.Default. |
| fontSize | optional font size override. If null, the font size is taken from style, or defaults to 12.rsp. |