FormattingStyle Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. Core. SDK
- Assembly
TXTextControl.Core. dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. Core. SDK TXTextControl.from the setup.dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
- Derived
- Inline
Style , ParagraphStyle
Description
The FormattingStyle class is the base class for the InlineStyle and ParagraphStyle classes. It implements the functionality common to all formatting styles.
Syntax
public class FormattingStylePublic Class FormattingStyleExamples
The following example creates a reusable emphasis style and adds it to the document.
FormattingStyle formattingStyle = new InlineStyle("Emphasis");
textControl.InlineStyles.Add((InlineStyle)formattingStyle);Dim formattingStyle As FormattingStyle = New InlineStyle("Emphasis")
textControl.InlineStyles.Add(DirectCast(formattingStyle, InlineStyle))Members
Properties
| Property | Description |
|---|---|
| AutoBaseline | 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. |
| Baseline | Gets or sets a user-defined baseline alignment, in twips, of the style. Positive values moves the baseline to superscript, negative values move the baseline to subscript. |
| BaseStyle | Gets the FormattingStyle which is the base style of this style. If this style is the TextControl's root style this property returns null. The property's value can be either a ParagraphStyle or an InlineStyle. |
| Bold | Gets or sets the bold attribute of the style. |
| Capitals | Gets or sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps). |
| CharacterScaling | Gets or sets the style's character scaling, in percent of the average character width. |
| CharacterSpacing | Gets or sets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended. |
| Culture | Gets or sets the style's culture. When this property is null, the style has the neutral culture. |
| FontName | Gets or sets the font of the style. |
| FontSize | Gets or sets the font's size of the style. |
| ForeColor | Gets or sets the style's color used to display the text. |
| Italic | Gets or sets the italic attribute of the style. |
| Name | Gets or sets the name of the style. |
| Strikeout | Gets or sets the strikeout attribute of the style. |
| TextBackColor | Gets or sets the style's text background color. |
| Underline | Gets or sets underlining styles for the style. |
Methods
| Method | Description |
|---|---|
| Apply | Applies all set attributes of the style to the current document. |