New to Telerik Document ProcessingStart a free 30-day trial

Text formatting state for runs—controls font, size, rendering mode, spacing, decorations, highlight, and baseline alignment used when drawing text. Configure before inserting text to affect subsequent layout and rendering.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.Editing

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

C#
public class TextProperties : PropertiesBase<TextProperties>

Inheritance: objectPropertiesBase<TextProperties>TextProperties

Inherited Members PropertiesBase<TextProperties>.Save()PropertiesBase<TextProperties>.Restore()

Constructors

Initializes a new instance of the TextProperties class.

C#
public TextProperties()

Fields

Gets or sets the baseline alignment which controls the vertical positioning of text relative to the baseline. This allows for creating subscripts, superscripts, or other vertical text alignments.

C#
public BaselineAlignment BaselineAlignment
Field Value:

A BaselineAlignment enumeration value that determines the vertical position of text relative to the baseline.

Gets or sets the spacing between characters, measured in device-independent units. Positive values increase spacing, while negative values decrease spacing.

C#
public double? CharacterSpacing
Field Value:

A nullable double value that specifies the additional space between characters.

Gets or sets the size of the font in points.

C#
public double FontSize
Field Value:

A double value representing the font size in points.

Gets or sets the color used for text highlighting (background color behind the text).

C#
public ColorBase HighlightColor
Field Value:

A ColorBase object that defines the background highlight color for the text.

Gets or sets the horizontal scaling of text as a percentage of normal width. Values above 100 stretch the text, while values below 100 compress it horizontally.

C#
public double? HorizontalScaling
Field Value:

A nullable double value that specifies the horizontal scaling percentage.

Gets or sets the text rendering mode which controls how text is visually rendered. This affects whether text is filled, stroked, or used as a clipping path.

C#
public RenderingMode RenderingMode
Field Value:

A RenderingMode enumeration value that determines how text is rendered.

Gets or sets the color of the strikethrough decoration.

C#
public ColorBase StrikethroughColor
Field Value:

A ColorBase object that defines the color of the strikethrough decoration.

Gets or sets the strikethrough pattern applied to text. This determines the visual style of the strikethrough decoration.

C#
public StrikethroughPattern StrikethroughPattern
Field Value:

A StrikethroughPattern enumeration value that defines the appearance of the strikethrough.

Gets or sets the color of the underline decoration.

C#
public ColorBase UnderlineColor
Field Value:

A ColorBase object that defines the color of the underline decoration.

Gets or sets the underline pattern applied to text. This determines the visual style of the underline decoration.

C#
public UnderlinePattern UnderlinePattern
Field Value:

An UnderlinePattern enumeration value that defines the appearance of the underline.

Gets or sets the additional spacing between words, measured in device-independent units. Positive values increase spacing, while negative values decrease spacing.

C#
public double? WordSpacing
Field Value:

A nullable double value that specifies the additional space between words.

Methods

Copies the text properties from other instance.

C#
public override void CopyFrom(TextProperties textProperties)
Parameters:textPropertiesTextProperties

The text properties.

Overrides: PropertiesBase<TextProperties>.CopyFrom(TextProperties)

Tries to set the current font.

C#
public bool TrySetFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight)
Parameters:fontFamilyFontFamily

The font family.

fontStyleFontStyle

The font style.

fontWeightFontWeight

The font weight.

Returns:

bool

True if succeeded.

Tries to set the current font.

C#
public bool TrySetFont(FontFamily fontFamily)
Parameters:fontFamilyFontFamily

The font family.

Returns:

bool

True if succeeded.

Properties

Gets or sets the font used for rendering text. This defines the typeface, style, and other font characteristics used when displaying text.

C#
public FontBase Font { get; set; }
Property Value:

A FontBase object that represents the font to be used for text rendering.

Exceptions:

ArgumentNullException

Thrown when attempting to set the font to null.