TextRenderingHint Enumeration

The TextRenderingHint enumeration specifies the process used to render text. The process affects the quality of the text.

Syntax

typedef enum TextRenderingHint {
  TextRenderingHintSystemDefault,
  TextRenderingHintSingleBitPerPixelGridFit,
  TextRenderingHintSingleBitPerPixel,
  TextRenderingHintAntiAliasGridFit,
  TextRenderingHintAntiAlias,
  TextRenderingHintClearTypeGridFit
} ;

Constants

TextRenderingHintSystemDefault Specifies that a character is drawn using the currently selected system font smoothing mode (also called a rendering hint).
TextRenderingHintSingleBitPerPixelGridFit Specifies that a character is drawn using its glyph bitmap and hinting to improve character appearance on stems and curvature.
TextRenderingHintSingleBitPerPixel Specifies that a character is drawn using its glyph bitmap and no hinting. This results in better performance at the expense of quality.
TextRenderingHintAntiAliasGridFit Specifies that a character is drawn using its antialiased glyph bitmap and hinting. This results in much better quality due to antialiasing at a higher performance cost.
TextRenderingHintAntiAlias Specifies that a character is drawn using its antialiased glyph bitmap and no hinting. Stem width differences may be noticeable because hinting is turned off.
TextRenderingHintClearTypeGridFit Specifies that a character is drawn using its glyph ClearType bitmap and hinting. This type of text rendering cannot be used along with CompositingModeSourceCopy.

Windows XP and Windows Server 2003 and later versions of Windows only: ClearType rendering is supported only on Windows XP and Windows Server 2003 and later versions of Windows. Therefore, TextRenderingHintClearTypeGridFit is ignored on other operating systems even though GDI+ is supported on those operating systems.

Remarks

The quality associated with each process varies according to the circumstances. TextRenderingHintClearTypeGridFit provides the best quality for most LCD monitors and relatively small font sizes. TextRenderingHintAntiAlias provides the best quality for rotated text. Generally, a process that produces higher quality text is slower than a process that produces lower quality text.

Requirements

   
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header gdiplusenums.h (include Gdiplus.h)

See Also

Antialiasing with Text

CompositingMode

DrawString Methods

Graphics::GetTextRenderingHint

Graphics::SetTextRenderingHint