Partager via


ClearType Registry Settings

This topic provides an overview of the WPF Microsoft ClearType registry settings that are used by WPF applications.

This topic contains the following sections.

  • Technology Overview
  • Registry Settings
  • ClearType Level
  • Gamma Level
  • Pixel Structure
  • Text Contrast Level
  • Related Topics

Technology Overview

WPF applications that render text to a display device use ClearType features to provide an enhanced reading experience. ClearType is a software technology developed by Microsoft that improves the readability of text on existing LCDs (Liquid Crystal Displays), such as laptop screens, Pocket PC screens and flat panel monitors. ClearType works by accessing the individual vertical color stripe elements in every pixel of an LCD screen. For more information on ClearType, see ClearType Overview.

Text that is rendered with ClearType can appear significantly different when viewed on various display devices. For example, a small number of monitors implement the color stripe elements in blue, green, red order rather than the more common red, green, blue (RGB) order.

Text that is rendered with ClearType can also appear significantly different when viewed by individuals with varying levels of color sensitivity. Some individuals can detect slight differences in color better than others.

In each of these cases, ClearType features need to be modified in order to provide the best reading experience for each individual.

Registry Settings

WPF provides four registry settings for controlling ClearType features:

Setting Description

ClearType level

Describes the level of ClearType color clarity.

Gamma level

Describes the level of the pixel color component for a display device.

Pixel structure

Describes the arrangement of pixels for a display device.

Text contrast level

Describes the level of contrast for displayed text.

These settings can be accessed by any external configuration utility that knows how to reference the WPF ClearType registry settings. These settings can also be created or modified by accessing the values directly by using the Windows Registry Editor.

If the WPF ClearType registry settings are not available, the WPF application queries the Windows system parameters information for font smoothing settings. For more information, see ClearType Antialiasing and SystemParametersInfo.

ClearType Level

The ClearType level allows you to adjust the rendering of text based on the color sensitivity and perception of an individual. For some individuals, the rendering of text that uses ClearType at its highest level does not produce the best reading experience.

The ClearType level is an integer value that ranges from 0 to 100. The default level is 100, which means ClearType uses the maximum capability of the color stripe elements of the display device. However, a ClearType level of 0 renders text as gray scale. By setting the ClearType level somewhere between 0 and 100, you can create an intermediate level that is suitable to an individual's color sensitivity.

Registry Setting

The registry setting location for the ClearType level is an individual user setting that corresponds to a specific display device name:

HKEY_CURRENT_USER\SOFTWARE\Microsof\Avalon.Graphics\<displayName>

For each display device name for a user, a ClearTypeLevel DWORD value is defined. The following screenshot shows the Registry Editor setting for the ClearType level.

ClearType settings in the Registry Editor

NoteNote:

WPF applications render text in one of either two modes, with and without ClearType. When text is rendered without ClearType, it is referred to as gray scale rendering.

Gamma Level

The gamma level refers to the nonlinear relationship between a pixel value and luminance. The gamma level setting should correspond to the physical characteristics of the display device; otherwise, distortions in rendered output may occur. For example, test may appear too wide or too narrow, or color fringes may appear on the edges of vertical stems of glyphs.

The gamma level is an integer value that ranges from 1000 to 2200. The default level is 1900.

Registry Setting

The registry setting location for the gamma level is a local machine setting that corresponds to a specific display device name:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsof\Avalon.Graphics\<displayName>

For each display device name for a user, a GammaLevel DWORD value is defined. The following screenshot shows the Registry Editor setting for the gamma level.

ClearType settings in the Registry Editor

Pixel Structure

The pixel structure describes the type of pixels that make up a display device. The pixel structure is defined as one of three types:


Type Value Description

Flat

0

The display device has no pixel structure. This means that light sources for each color are spread equally on the pixel area—this is referred to as gray scale rendering. This is how a standard display device works. ClearType is never applied to the rendered text.

RGB

1

The display device has pixels that consist of three stripes in the following order: red, green, and blue. ClearType is applied to the rendered text.

BGR

2

The display device has pixels that consist of three stripes in the following order: blue, green, and red. ClearType is applied to the rendered text. Notice how the order is inverted from the RGB type.

The pixel structure corresponds to an integer value that ranges from 0 to 2. The default level is 0, which represents a flat pixel structure.

NoteNote:

For information on enumerating display device names, see EnumDisplayDevices.

Registry Setting

The registry setting location for the pixel structure is a local machine setting that corresponds to a specific display device name:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsof\Avalon.Graphics\<displayName>

For each display device name for a user, a PixelStructure DWORD value is defined. The following screenshot shows the Registry Editor setting for the pixel structure.

ClearType settings in the Registry Editor

Text Contrast Level

The text contrast level allows you to adjust the rendering of text based on the stem widths of glyphs. The text contrast level is an integer value that ranges from 0 to 6—the larger the integer value, the wider the stem. The default level is 1.

Registry Setting

The registry setting location for the text contrast level is an individual user setting that corresponds to a specific display device name:

HKEY_CURRENT_USER\Software\Microsof\Avalon.Graphics\<displayName>

For each display device name for a user, a TextContrastLevel DWORD value is defined. The following screenshot shows the Registry Editor setting for the text contrast level.

ClearType settings in the Registry Editor

See Also

Reference

ClearType Antialiasing

Concepts

ClearType Overview