Class
RadTextMeasurer

Measures the layout of text using specified formatting and properties.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public static class RadTextMeasurer

Inheritance: objectRadTextMeasurer

Methods

Measure(string, Span, SubStringPosition)

Measures the layout of a specified text string within a given span and at a specified substring position.

Declaration

cs-api-definition
public static BoxMeasurementInfo Measure(string text, Span span, SubStringPosition subStringPosition = 0)

Parameters

text

string

The text string to be measured.

span

Span

The span in which the text is measured.

subStringPosition

SubStringPosition

The position within the substring to measure.

Returns

BoxMeasurementInfo

The calculated size of the measured text as a Size object.

Measure(string, double, FontFamily)

Measures the layout of a specified text string using the given measurement parameters.

Declaration

cs-api-definition
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily)

Parameters

text

string

The text string to measure.

fontSize

double

The current font size.

fontFamily

FontFamily

The font family that determines the rendering of the text.

Returns

BoxMeasurementInfo

A BoxMeasurementInfo object containing the measurement results.

Measure(string, double, FontFamily, FontWeight, FontStyle)

Measures the width of a given text string based on specified font properties and returns the measurement in pixels.

Declaration

cs-api-definition
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily, FontWeight fontWeight, FontStyle fontStyle)

Parameters

text

string

The text string to be measured.

fontSize

double

The font size of the text, measured in points.

fontFamily

FontFamily

The font family to be used for the text.

fontWeight

FontWeight

The weight of the font, which can affect the width of the text measurement.

fontStyle

FontStyle

The style of the font, such as italic or normal.

Returns

BoxMeasurementInfo

The width of the measured text in pixels.