TX Text Control .NET for WPF

AutoBaseline Property

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

Description

Gets or sets values specifying automatic sub- or superscripted text. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the Baseline property.

Syntax

public AutoBaseline AutoBaseline { get; set; }

Members

ValueDescription
NoneText is not sub- or superscripted.
SuperscriptText is moved above the baseline.
SubscriptText is moved below the baseline.
SuperscriptUpperEdgeText is scaled und moved above the baseline. The moved text does not extend above the upper edge of capital letters. This can be used for nominators of diagonal fractions.
SubscriptBaselineText is scaled, but is not moved below the baseline. This can be used for denominators of diagonal fractions.

Examples

The following example creates a reusable emphasis style and adds it to the document by using FormattingStyle.AutoBaseline.

FormattingStyle formattingStyle = new InlineStyle("Emphasis");

formattingStyle.AutoBaseline = AutoBaseline.Superscript;
Console.WriteLine($"Auto Baseline used by Formatting Style: {formattingStyle.AutoBaseline}");

textControl.InlineStyles.Add((InlineStyle)formattingStyle);