css - 为什么我的字体在 IE9 中看起来好多了?

标签 css internet-explorer fonts internet-explorer-9 cleartype

我使用 font-family: Myriad; font-size: 40px 对于一些文本。我简直不敢相信 IE 会以最好的质量显示字体!比 Opera、Firefox 和 Chrome 好得多。

怎么可能呢?如何使文本在其他浏览器中看起来与在 IE 中一样好?

这是一个演示:

http://jsfiddle.net/55Ruh/3/

在所有浏览器中尝试此链接。 IE(最新版本,9)显示最好和最优质的文本,不是吗?

最佳答案

简单的说:这是因为IE9引入了a new font rendering engine这主要基于在 WPF's ClearType implementation 中看到的内容.其增强的引擎在减少锯齿状边缘方面做得更好,使字体看起来更平滑、更好看,尤其是大字体时。

深入了解细节——我的意思是真正技术方面的——这种 ClearType 不同于 Windows 其余部分中看到的那种,也称为 GDI ClearType(用于 Windows 的 GDI 图形图书馆)。旧的 GDI ClearType 是大多数其他浏览器的 Windows 版本基于其字体渲染引擎的一种,这也是一种使字体在大尺寸时看起来真的锯齿状的。

第二个链接中的以下段落总结了其余大部分内容,很好地解释了为什么字体在 IE9 的新引擎中看起来更流畅:

A significant improvement over the previous version of ClearType is the use of sub-pixel positioning. Unlike the ClearType implementation found in GDI, the ClearType found in 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.

请特别参阅有关 Y-direction anti-aliasing 的部分有截图对比。另一个引用:

ClearType in Windows Presentation Foundation (WPF) provides antialiasing on the y-direction level to smooth out any jagged edges.

关于css - 为什么我的字体在 IE9 中看起来好多了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5794296/

相关文章:

html - 更改 Ruby on Rails 字体

Android:从css调用assets文件夹

html - 如何更改 Bootstrap 导航栏中的链接背景颜色

javascript - 更改 DOM 元素的代码行

javascript - 表单不在 IE 中提交

css - 在 JavaFX 中使用 Arial Unicode MS BOLD

css - 更改 Shiny 小部件的背景和字体颜色

html - 页面在 html 和 css 中没有一直滚动到底部

javascript - 在选择树时隐藏 Div 中除一个元素外的所有元素

html - 在 IE 中忽略 flex 容器最小高度