CharacterFormat¶
Represents the character formatting of text, such as font, size, color, and emphasis.
Capabilities¶
Text and Formatting¶
- CharacterFormat.AllCaps: When
true, lowercase letters are displayed as capital letters. - CharacterFormat.BackgroundColor: Gets or sets the text background (shading) color, as
#RRGGBB. - CharacterFormat.Bold: When
true, the text is bold. - CharacterFormat.DoubleStrikethrough: When
true, the text is crossed out with two lines. - CharacterFormat.FontColor: Gets or sets the text color, as
#RRGGBB. - CharacterFormat.FontName: Gets or sets the font name, such as
'Arial'. The font must be available on the server for PDF output; otherwise a substitute font is used. - CharacterFormat.Hidden: When
true, the text is hidden when the document is displayed. - CharacterFormat.HighlightColor: Gets or sets the highlight color. Highlighting supports a limited palette, such as yellow, green, cyan, and red; use BackgroundColor for any other color.
- CharacterFormat.Italic: When
true, the text is italic. - CharacterFormat.Kerning: Gets or sets the font size in points at and above which kerning is applied.
0turns kerning off. - CharacterFormat.Position: Gets or sets how far the text is raised (positive) or lowered (negative) from the baseline, in points.
- CharacterFormat.RightToLeft: When
true, the text is displayed right to left. - CharacterFormat.Scaling: Gets or sets the percentage by which each character is expanded or compressed when it is rendered in the document. Supported only in DOCX and DOC formats.
- CharacterFormat.Size: Gets or sets the font size in points.
- CharacterFormat.SmallCaps: When
true, lowercase letters are displayed as smaller capital letters. - CharacterFormat.Spacing: Gets or sets the extra space between characters in points. Negative values condense the text.
- CharacterFormat.Strikethrough: When
true, the text is crossed out with a single line. - CharacterFormat.Subscript: When
true, the text is smaller and lowered below the baseline. - CharacterFormat.Superscript: When
true, the text is smaller and raised above the baseline. - CharacterFormat.UnderlineColor: Gets or sets the underline color, as
#RRGGBB. - CharacterFormat.UnderlineStyle: Gets or sets the underline style.
- CharacterFormat.Clone: Creates a copy of the character format.
Methods¶
- CharacterFormat.ClearFormatting: Removes all direct formatting, so the element falls back to its style and the document defaults.