ClassRadTextMeasurer
Measures the layout of text using specified formatting and properties.
Definition
Namespace:Telerik.Windows.Documents.Layout
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
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
public static BoxMeasurementInfo Measure(string text, Span span, SubStringPosition subStringPosition = 0)
Parameters
text
The text string to be measured.
span
The span in which the text is measured.
subStringPosition
SubStringPosition
The position within the substring to measure.
Returns
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
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily)
Parameters
text
The text string to measure.
fontSize
The current font size.
fontFamily
FontFamily
The font family that determines the rendering of the text.
Returns
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
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily, FontWeight fontWeight, FontStyle fontStyle)
Parameters
text
The text string to be measured.
fontSize
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
The width of the measured text in pixels.