|  | Home · Overviews · Examples

# QTextCharFormat Class Reference
[com.trolltech.qt.gui module]

The `QTextCharFormat` class provides formatting information for characters in a `QTextDocument`. More...

Inherits `QTextFormat`.

Inherited by `QTextImageFormat`.

## Detailed Description

The `QTextCharFormat` class provides formatting information for characters in a `QTextDocument`.

The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.

The font used can be set by supplying a font to the `setFont` function, and each aspect of its appearance can be adjusted to give the desired effect. `setFontFamily` and `setFontPointSize` define the font's family (e.g. Times) and printed size; `setFontWeight` and `setFontItalic` provide control over the style of the font. `setFontUnderline`, `setFontOverline`, `setFontStrikeOut`, and `setFontFixedPitch` provide additional effects for text.

The color is set with `setForeground`. If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with `setAnchor`. The `setAnchorHref` and `setAnchorNames` functions are used to specify the information about the hyperlink's destination and the anchor's name.

See also `QTextFormat`, `QTextBlockFormat`, `QTextTableFormat`, and `QTextListFormat`.