Table of Contents

Interface ITextMeasurer

Namespace
PluginUI
Assembly
PluginUI.dll

Text measurement service (available during layout through TextMeasurer).

public interface ITextMeasurer

Methods

CaretX(string, TextStyle, int)

Horizontal position of the caret placed before character index (single line).

float CaretX(string text, TextStyle style, int index)

Parameters

text string
style TextStyle
index int

Returns

float

HitTest(string, TextStyle, float)

Index of the caret position closest to x (single line).

int HitTest(string text, TextStyle style, float x)

Parameters

text string
style TextStyle
x float

Returns

int

Measure(string, TextStyle, float)

Size of the laid-out text in DIPs.

Size Measure(string text, TextStyle style, float maxWidth = Infinity)

Parameters

text string
style TextStyle
maxWidth float

Returns

Size