TX Text Control .NET Server

CharacterSpacing Property

Property|Introduced in 30.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets or sets a character spacing value, in twips, of the selected text. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended.

Syntax

public int CharacterSpacing { get; set; }

Examples

The following example formats the heading of a short document by using Selection.CharacterSpacing.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

selection.CharacterSpacing = 720;
Console.WriteLine($"Character Spacing used by Selection: {selection.CharacterSpacing}");

Remarks

The property's default value is 0.

The property returns its default value when the text selection contains multiple characters with mixed character spacing settings. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.