Click or drag to resize
CharacterFormat Class
Represents a set of formatting properties which shall be applied to a document text.
Inheritance Hierarchy

Namespace:  GemBox.Document
Assembly:  GemBox.Document (in GemBox.Document.dll) Version: 25.3.30.1243
Syntax
public sealed class CharacterFormat : Format

The CharacterFormat type exposes the following members.

Constructors
  NameDescription
Public methodCharacterFormat
Initializes a new instance of the CharacterFormat class.
Top
Properties
  NameDescription
Public propertyAllCaps
Gets or sets a value indicating whether to display all characters as capital letters.
Public propertyBackgroundColor
Gets or sets the text background color. HighlightColor overrides BackgroundColor.
Public propertyBold
Gets or sets a value indicating whether all characters in the text of the run are bold.
Public propertyBorder
Gets or sets the border of the Run that has this CharacterFormat applied to it. Supported only in DOCX and DOC formats.
Public propertyDocument
Gets the owner document.
(Inherited from Format.)
Public propertyDoubleStrikethrough
Gets or sets a value indicating whether the text of the run shall be displayed with two horizontal lines through each character displayed on the line.
Public propertyFontColor
Gets or sets the color which shall be used to display the text of the run.
Public propertyFontName
Gets or sets the name of the font which shall be used to display the text of the run.
Public propertyHidden
Gets or sets a value indicating whether the text of the run shall be hidden from display at display time in a document.
Public propertyHighlightColor
Gets or sets a highlighting color which is applied as a background behind the text of the run. HighlightColor overrides BackgroundColor.
Public propertyItalic
Gets or sets a value indicating whether all characters in the text of the run are italic.
Public propertyKerning
Gets or sets the smallest font size which shall have its kerning automatically adjusted. If the Size is smaller than this value, then no font kerning shall be performed. Supported only in DOCX and DOC formats.
Public propertyLanguage
Gets or sets the language information.
Public propertyPosition
Gets or sets the the amount in points by which text shall be raised or lowered for the run in relation to the default baseline of the surrounding non-positioned text. Supported only in DOCX and DOC formats.
Public propertyRightToLeft
When true, the contents of this run shall have right-to-left reading order. Supported only in DOCX and DOC formats.
Public propertyScaling
Gets or sets the percentage by which each character shall be expanded or compressed when the character is rendered in the document. Supported only in DOCX and DOC formats.
Public propertySize
Gets or sets the font size (in points) which shall be applied to the text of the run when displayed.
Public propertySmallCaps
Gets or sets a value indicating whether all small letter characters in the text run shall be formatted for display only as their capital letter character equivalents in a font size two points smaller than the actual font size specified for the text.
Public propertySpacing
Gets or sets the amount of character pitch in points which shall be added or removed after each character in the run before the following character is rendered in the document. Supported only in DOCX and DOC formats.
Public propertyStrikethrough
Gets or sets a value indicating whether the text of the run shall be displayed with a single horizontal line through the center of the line.
Public propertyStyle
Gets or sets the character style.
Public propertySubscript
Gets or sets a value indicating whether the text of the run shall be repositioned as subscript.
Public propertySuperscript
Gets or sets a value indicating whether the text of the run shall be repositioned as superscript.
Public propertyUnderlineColor
Gets or sets the color for the underlining on the run.
Public propertyUnderlineStyle
Gets or sets the pattern which shall be used to create the underline applied beneath the text in the run.
Top
Methods
Operators
  NameDescription
Public operatorStatic memberEquality
Determines whether first and second CharacterFormats are equal.
Public operatorStatic memberInequality
Determines whether first and second CharacterFormats are not equal.
Top
Remarks

GemBox.Document supports a variety of text formatting options like font name, size and color; on / off properties like bold, italic, underline, strikethrough, subscript, superscript and many others.

CharacterFormat can be set on:

For more information about CharacterFormat properties, see character formatting sample.

For more information about formattings and styles in GemBox.Document, see formattings and styles samples.

See Also