Working with ClearType Fonts (Windows CE 5.0)

Send Feedback

Windows CE based devices include support for Microsoft ClearType® display technology equivalent to what has shipped in Windows XP. Because this ClearType support depends on the implementation of the display driver, not all OS designs support ClearType.

ClearType can be enabled system-wide or on a per-application basis. In addition to implementing ClearType, you can also improve the appearance of ClearType text by adjusting the gamma value. The gamma value controls the luminance generated on an LCD screen.

ClearType on Windows CE-based devices implements only a vertical striping algorithm. When the screen is rotated, it will still display ClearType using the vertical striping algorithm. ClearType is available in all orientations. Legibility is not compromised by using vertical striping on horizontal striped devices. For example, ClearType works well in the tablet PC devices.

ClearType uses characteristics of LCDs to make text seem less jagged and more like printed type on paper, increasing the readability of the text. ClearType increases the effective screen resolution on LCDs by taking advantage of the red, green, and blue subpixels that make up each pixel on a color screen. By mathematically adjusting the signal from these subpixels, ClearType creates text in which the letters have smoother edges.

Windows CE based devices support ClearType only for display devices with color depths of 8, 16, 24, or 32 bits per pixel (bpp). The implementation of ClearType on Windows CE based devices can use subpixels contained either in vertical stripes or in horizontal stripes to provide ClearType support even when the screen is rotated.

Windows CE based devices support standard ClearType text and ClearType text with compatible widths. Compatible widths produce text in which the letters have the same spacing as non-ClearType text.

To display text in a ClearType font, call the CreateFontIndirect function and pass into this function a LOGFONT structure with the lfQuality member set to either CLEARTYPE_QUALITY or CLEARTYPE_COMPAT_QUALITY. The CLEARTYPE_QUALITY value produces standard ClearType text, while the CLEARTYPE_COMPAT_QUALITY value produces ClearType text with compatible widths.

To retrieve the current gamma correction value, call the SystemParametersInfo function with the uiAction parameter set to SPI_GETFONTSMOOTHINGCONTRAST. To set the gamma correction value, call SystemParametersInfo with uiAction set to SPI_SETFONTSMOOTHINGCONTRAST and the pvParam parameter set to a pointer to an unsigned integer that contains the desired gamma correction value.

ClearType can work poorly for some TrueType fonts. Be sure to test the fonts that you use for legibility when you enable ClearType for your application.

See Also

Fonts Application Development | How to Implement ClearType

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.