ClearType 概述ClearType Overview

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

技术概述Technology Overview

ClearType 是由 Microsoft 开发的一种软件技术, 可提高现有 Lcd (液晶显示器上显示的文本) 的可读性, 如笔记本电脑屏幕、Pocket PC 屏幕和平板显示器。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 通过访问 LCD 屏幕的每个像素中的各个垂直色带元素来工作。ClearType works by accessing the individual vertical color stripe elements in every pixel of an LCD screen. 在 ClearType 之前, 计算机可以显示的最小细节级别为单个像素, 但在 LCD 监视器上运行 ClearType 时, 我们现在可以将文本的功能显示为小到宽度的一小部分。Before ClearType, the smallest level of detail that a computer could display was a single pixel, but with ClearType 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)可用的 cleartype 是最新一代的 cleartype, 它对 Microsoft Windows 图形设备接口 (GDI) 中找到的版本具有多项改进。The ClearType available in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) is the latest generation of ClearType which has several improvements over version found in Microsoft Windows Graphics Device Interface (GDI).

子像素定位Sub-pixel Positioning

对以前版本的 ClearType 的重大改进是使用子像素定位。A significant improvement over the previous version of ClearType is the use of sub-pixel positioning. 与在 GDI 中找到的 cleartype 实现不同, 中Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)找到的 cleartype 允许标志符号在像素内开始, 而不仅仅是像素的开始边界。Unlike the ClearType implementation found in GDI, the ClearType 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. 左侧的示例使用较早版本的 ClearType 呈现器呈现, 该版本不采用子像素定位。The example on the left is rendered using the earlier version of the ClearType renderer, which did not employ sub-pixel positioning. 右侧的示例使用新版本的 ClearType 呈现器呈现, 使用了子像素定位。The example on the right is rendered using the new version of the ClearType 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. 这种情况只能由 ClearType 中包含的复杂颜色筛选来实现。This is only possible because of sophisticated color filtering that is incorporated in ClearType.

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

以下两个示例将早期 ClearType 呈现器的输出与 ClearType 呈现器的新版本进行比较。The following two examples compare output from the earlier ClearType renderer with the new version of the ClearType 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. 子像素定位到文本屏幕整体外观的累积收益大大增加, 并代表 ClearType 技术的重大演变。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 ClearType 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) ClearType 的另一个改进是 y 方向抗锯齿。Another improvement of ClearType in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) is y-direction anti-aliasing. 无 y 方向抗锯齿的 GDI 中的 ClearType 在 x 轴上提供更好的分辨率, 而不是 y 轴。The ClearType in GDI 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

ClearType in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)提供 y 方向的抗锯齿功能, 以平滑任何交错边缘。ClearType 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)的 ClearType 可以利用硬件加速来提高性能, 并减少 CPU 负载和系统内存要求。ClearType 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. 通过使用图形卡的像素着色器和视频内存, ClearType 可以更快地呈现文本, 尤其是使用动画时。By using the pixel shaders and video memory of a graphics card, ClearType provides faster rendering of text, particularly when animation is used.

Cleartype in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)不会修改系统范围内的 cleartype 设置。ClearType in Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) does not modify the system-wide ClearType settings. 在 Windows 中禁用 ClearType Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)会将抗锯齿设置为灰度模式。Disabling ClearType in Windows sets Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) antialiasing to grayscale mode. 此外, 中Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)的 cleartype 不会修改cleartype 调谐器 PowerToy的设置。In addition, ClearType 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