RadTextMeasurer
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
Measures the width of a given text string based on specified font properties and returns the measurement in pixels.
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily, FontWeight fontWeight, FontStyle fontStyle)
The text string to be measured.
fontSizedoubleThe font size of the text, measured in points.
fontFamilyFontFamilyThe font family to be used for the text.
fontWeightFontWeightThe weight of the font, which can affect the width of the text measurement.
fontStyleFontStyleThe style of the font, such as italic or normal.
Returns:The width of the measured text in pixels.
Measures the layout of a specified text string using the given measurement parameters.
public static BoxMeasurementInfo Measure(string text, double fontSize, FontFamily fontFamily)
The text string to measure.
fontSizedoubleThe current font size.
fontFamilyFontFamilyThe font family that determines the rendering of the text.
Returns:A BoxMeasurementInfo object containing the measurement results.
Measures the layout of a specified text string within a given span and at a specified substring position.
public static BoxMeasurementInfo Measure(string text, Span span, SubStringPosition subStringPosition = 0)
The text string to be measured.
spanSpanThe span in which the text is measured.
subStringPositionSubStringPositionThe position within the substring to measure.
Returns:The calculated size of the measured text as a Size object.