ClearType 概述ClearType Overview

本主题对 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 Microsoft ClearTypeMicrosoft ClearType 技术进行了概述。This topic provides an overview of the Microsoft ClearTypeMicrosoft ClearType technology found in the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF).

技术概述Technology Overview

ClearTypeClearType 是一种由 MicrosoftMicrosoft 开发的软件技术,可提高现有 LCD(液晶显示器,如笔记本电脑屏幕、Pocket PC 屏幕和平板显示器)上文本的可读性。 is a software technology developed by MicrosoftMicrosoft that improves the readability of text on existing LCDs (Liquid Crystal Displays), such as laptop screens, Pocket PC screens and flat panel monitors. ClearTypeClearType 在工作时访问 LCD 屏幕中每个像素的各个垂直色条元素。 works by accessing the individual vertical color stripe elements in every pixel of an LCD screen. ClearTypeClearType 之前,计算机可以显示的最小级别的细节是一个像素,但是有了在 LCD 显示器上运行的 ClearTypeClearType,我们现在显示的文本特征可以小到一个像素宽度的一部分。Before ClearTypeClearType, the smallest level of detail that a computer could display was a single pixel, but with ClearTypeClearType running on an LCD monitor, we can now display features of text as small as a fraction of a pixel in width. 超高的分辨率增加了文本显示中细节的清晰度,使其更便于长时间阅读。The extra resolution increases the sharpness of the tiny details in text display, making it much easier to read over long durations.

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中提供的 ClearTypeClearType 是最新一代的 ClearTypeClearType,该版本相对于 Microsoft Windows 图形设备接口 (GDI)Microsoft Windows Graphics Device Interface (GDI) 中提供的版本有了若干项改进。The ClearTypeClearType available in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) is the latest generation of ClearTypeClearType which has several improvements over version found in Microsoft Windows 图形设备接口 (GDI)Microsoft Windows Graphics Device Interface (GDI).

子像素定位Sub-pixel Positioning

与之前的 ClearTypeClearType 版本相比,该版本的一项重大改进是使用了子像素定位。A significant improvement over the previous version of ClearTypeClearType is the use of sub-pixel positioning. GDIGDI 中找到的 ClearTypeClearType 实现不同,Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中找到的 ClearTypeClearType 允许字形在像素内启动,而不仅仅是像素的起始边界。Unlike the ClearTypeClearType implementation found in GDIGDI, the ClearTypeClearType found in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) allows glyphs to start within the pixel and not just the beginning boundary of the pixel. 由于在定位字形时的这种超高的分辨率,字形的间距和比例更加精确和一致。Because of this extra resolution in positioning glyphs, the spacing and proportions of the glyphs is more precise and consistent.

以下两个示例演示了使用子像素定位时,字形如何从任意子像素边界处开始。The following two examples show how glyphs may begin on any sub-pixel boundary when sub-pixel positioning is used. 左侧示例使用的是较早版本的 ClearTypeClearType 呈现器,该呈现器没有采用子像素定位。The example on the left is rendered using the earlier version of the ClearTypeClearType renderer, which did not employ sub-pixel positioning. 右侧示例使用的是新版本的 ClearTypeClearType 呈现器,该呈现器使用了子像素定位。The example on the right is rendered using the new version of the ClearTypeClearType renderer, using sub-pixel positioning. 请注意右侧图像中的每个 el 的呈现方式稍有不同,因为每一个字母都开始于一个不同的子像素。Note how each e and l in the right-hand image is rendered slightly differently because each starts on a different sub-pixel. 在屏幕上以正常尺寸查看文本时,由于字形图像的高对比度,这种差异并不明显。When viewing the text at its normal size on the screen, this difference is not noticeable because of the high contrast of the glyph image. 因为 ClearTypeClearType 中采用了复杂的颜色筛选,所以才能看出此差异。This is only possible because of sophisticated color filtering that is incorporated in ClearTypeClearType.

使用两个版本的 ClearType 显示的文本Text displayed with two versions of ClearType
使用较早和较晚版本的 ClearType 显示的文本Text displayed with earlier and later versions of ClearType

以下两个示例将较早的 ClearTypeClearType 呈现器与新版本的 ClearTypeClearType 呈现器的输出进行比较。The following two examples compare output from the earlier ClearTypeClearType renderer with the new version of the ClearTypeClearType renderer. 右侧显示的子像素定位显著改善了屏幕上的字体间距,尤其是在较小尺寸处,子像素与整个像素之间的差异在很大程度上代表了字形宽度。The subpixel positioning, shown on the right, greatly improves the spacing of type on screen, especially at small sizes where the difference between a sub-pixel and a whole pixel represents a significant proportion of glyph width. 请注意,第二张图中字母之间的间距更均匀。Note that spacing between the letters is more even in the second image. 子像素定位不断提升文本屏幕的整体外观效果,代表了 ClearTypeClearType 技术的重大进步。The cumulative benefit of sub-pixel positioning to the overall appearance of a screen of text is greatly increased, and represents a significant evolution in ClearTypeClearType technology.

使用早期版本的 ClearType 显示的文本Text displayed with earlier version of ClearType
使用较早和较晚版本的 ClearType 显示的文本Text with earlier and later versions of ClearType

Y 方向抗锯齿功能Y-Direction Antialiasing

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 ClearTypeClearType 的另一个改进是 y 方向抗锯齿功能。Another improvement of ClearTypeClearType in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) is y-direction anti-aliasing. GDIGDI 中的 ClearTypeClearType 没有 y 方向抗锯齿功能,它能在 x 轴方向提供更好的分辨率,但在 y 轴方向不行。The ClearTypeClearType in GDIGDI without y-direction anti-aliasing provides better resolution on the x-axis but not the y-axis. 在平缓曲线的顶部和底部,锯齿状边缘会降低其可读性。On the tops and bottoms of shallow curves, the jagged edges detract from its readability.

以下示例演示了没有 y 方向抗锯齿功能的效果。The following example shows the effect of having no y-direction antialiasing. 在这个示例中,字母顶部和底部的锯齿状边缘非常明显。In this case, the jagged edges on the top and bottom of the letter are apparent.

平缓曲线上有粗糙边缘的文本Text with jagged edges on shallow curves
平缓曲线上有粗糙边缘的文本Text with jagged edges on shallow curves

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 ClearTypeClearType 提供 y 方向的抗锯齿功能,可以使任何锯齿状边缘变得平滑。 in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) provides antialiasing on the y-direction level to smooth out any jagged edges. 这对于提高东亚语言的可读性特别重要,在东亚语言中,表意文字的水平和垂直平缓曲线几乎同样多。This is particularly important for improving the readability of East Asian languages where ideographs have an almost equal amount of horizontal and vertical shallow curves.

以下示例演示了 y 方向抗锯齿功能的效果。The following example shows the effect of y-direction antialiasing. 在这个示例中,字母顶部和底部对曲线较为平滑。In this case, the top and bottom of the letter show a smooth curve.

文本与 ClearType y-反方向-别名Text with ClearType y-direction anti-aliasing
采用 ClearType y 向抗锯齿的文本Text with ClearType y-direction antialiasing

硬件加速Hardware Acceleration

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 ClearTypeClearType 可以利用硬件加速来提高性能,并减少 CPU 负载和系统内存需求。 in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) can take advantage of hardware acceleration for better performance and to reduce CPU load and system memory requirements. 通过使用像素着色器和图形卡的视频内存,ClearTypeClearType 可以更快呈现文本,特别是使用动画时。By using the pixel shaders and video memory of a graphics card, ClearTypeClearType provides faster rendering of text, particularly when animation is used.

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 ClearTypeClearType 不会修改系统范围的 ClearTypeClearType 设置。 in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) does not modify the system-wide ClearTypeClearType settings. WindowsWindows 中禁用 ClearTypeClearType 会将 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 抗锯齿功能设置为灰度模式。Disabling ClearTypeClearType in WindowsWindows sets Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) antialiasing to grayscale mode. 此外,Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 中的 ClearTypeClearType 不会修改 ClearType 调谐器 PowerToy 的设置。In addition, ClearTypeClearType in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) does not modify the settings of the ClearType Tuner PowerToy.

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 体系结构设计决策之一是让不依赖于分辨率的布局更好地支持较高分辨率的 DPI 显示器,这种显示器正在日益普及。One of the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) architectural design decisions is to have resolution independent layout better support higher resolution DPI monitors, which are becoming more widespread. 此决策的后果是 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 不支持某些东亚字体中抗锯齿的文本呈现或位图,因为它们都依赖于分辨率。This has the consequence of Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) not supporting aliased text rendering or the bitmaps in some East Asian fonts because they are both resolution dependent.

其他信息Further Information

ClearType 信息ClearType Information

ClearType 调谐器 PowerToyClearType Tuner PowerToy

请参阅See Also

ClearType 注册表设置ClearType Registry Settings