Class
TextProperties

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:

cs-api-definition
public class TextProperties : PropertiesBase<TextProperties>

Inheritance: objectPropertiesBase<TextProperties>TextProperties

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

Constructors

TextProperties()

Initializes a new instance of the TextProperties class.

Declaration

cs-api-definition
public TextProperties()

Fields

BaselineAlignment

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.

Declaration

cs-api-definition
public BaselineAlignment BaselineAlignment

Field Value

BaselineAlignment

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

CharacterSpacing

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

Declaration

cs-api-definition
public double? CharacterSpacing

Field Value

double?

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

FontSize

Gets or sets the size of the font in points.

Declaration

cs-api-definition
public double FontSize

Field Value

double

A double value representing the font size in points.

HighlightColor

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

Declaration

cs-api-definition
public ColorBase HighlightColor

Field Value

ColorBase

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

HorizontalScaling

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.

Declaration

cs-api-definition
public double? HorizontalScaling

Field Value

double?

A nullable double value that specifies the horizontal scaling percentage.

RenderingMode

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.

Declaration

cs-api-definition
public RenderingMode RenderingMode

Field Value

RenderingMode

A RenderingMode enumeration value that determines how text is rendered.

StrikethroughColor

Gets or sets the color of the strikethrough decoration.

Declaration

cs-api-definition
public ColorBase StrikethroughColor

Field Value

ColorBase

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

StrikethroughPattern

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

Declaration

cs-api-definition
public StrikethroughPattern StrikethroughPattern

Field Value

StrikethroughPattern

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

UnderlineColor

Gets or sets the color of the underline decoration.

Declaration

cs-api-definition
public ColorBase UnderlineColor

Field Value

ColorBase

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

UnderlinePattern

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

Declaration

cs-api-definition
public UnderlinePattern UnderlinePattern

Field Value

UnderlinePattern

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

WordSpacing

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

Declaration

cs-api-definition
public double? WordSpacing

Field Value

double?

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

Properties

Font

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

Declaration

cs-api-definition
public FontBase Font { get; set; }

Property Value

FontBase

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

Exceptions

ArgumentNullException

Thrown when attempting to set the font to null.

Methods

CopyFrom(TextProperties)

Copies the text properties from other instance.

Declaration

cs-api-definition
public override void CopyFrom(TextProperties textProperties)

Parameters

textProperties

TextProperties

The text properties.

Overrides PropertiesBase<TextProperties>.CopyFrom(TextProperties)

TrySetFont(FontFamily)

Tries to set the current font.

Declaration

cs-api-definition
public bool TrySetFont(FontFamily fontFamily)

Parameters

fontFamily

FontFamily

The font family.

Returns

bool

True if succeeded.

TrySetFont(FontFamily, FontStyle, FontWeight)

Tries to set the current font.

Declaration

cs-api-definition
public bool TrySetFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight)

Parameters

fontFamily

FontFamily

The font family.

fontStyle

FontStyle

The font style.

fontWeight

FontWeight

The font weight.

Returns

bool

True if succeeded.