在 IE9 中禁用 Cleartype(文本抗锯齿)
它有详细记录(例如 此处)表明 IE9 忽略了操作系统范围内的字体平滑设置(又名抗锯齿)。即使在 Windows 中禁用字体平滑和 ClearType,IE 仍然显示抗锯齿字体,这使得一些用户难以阅读,尤其是在小字体时。
如何在 IE9 中禁用所有字体抗锯齿功能(ClearType 或其他)?
更多详细信息:
我们公司构建了一个使用大量小字体的网络应用程序。随着 IE9 的发布,我们的一些用户抱怨 IE9 的默认抗锯齿功能使我们的小字体变得模糊或模糊。因此,我们需要帮助已安装 IE9 并想要关闭抗锯齿功能的用户。
另外,就我个人而言,我在阅读小的抗锯齿字体时遇到困难,因此我想要一个供我自己使用的解决方案,即使对于我无法控制的网站也是如此。
在 IE8 中,我可以取消选中“始终对 HTML 使用 ClearType”,然后在操作系统中禁用 ClearType,IE8 将显示所有别名字体。但在IE9中,缺少这个选项。
经过对这个问题的一些研究,我了解到:核心问题是 IE 依赖 DirectWrite 进行文本渲染,并且不支持任何较新的渲染选项,这些选项将在没有抗锯齿的情况下绘制文本并尊重用户的操作系统 -广泛的默认选择。
更糟糕的是,如果您在操作系统中禁用 ClearType,在某些情况下 IE 将回退到 DirectWrite 的默认非 ClearType 抗锯齿,该抗锯齿甚至比 ClearType 更模糊。
It's well documented (e.g. here) that IE9 ignores the OS-wide settings for font smoothing (aka anti-aliasing). Even if font-smoothing and ClearType are disabled in Windows, IE still shows anti-aliased fonts, which some users struggle to read, especially at small font sizes.
How can I disable all font anti-aliasing (ClearType or otherwise) in IE9?
More details:
Our company builds a web application which uses a lot of small fonts. With the release of IE9, some of our users have complained that IE9's default anti-aliasing makes our small fonts fuzzy or blurry. So we need to help our users who've installed IE9 and who want to turn off anti-aliasing.
Also, personally, I have trouble reading small, anti-aliased fonts, so I'd like a solution for my own use, even for sites I don't control.
In IE8 I could uncheck the "Always use ClearType for HTML" and then disable ClearType in the OS and IE8 would show all fonts aliased. But in IE9, this option is missing.
After some research about the problem, here's what I've learned: the core issue is that IE relies on DirectWrite for text rendering and does not support any of the newer rendering options which would draw text without anti-aliasing and respect the user's OS-wide default choices.
Making things worse, if you disable ClearType in the OS, in some cases IE will fall back to DirectWrite's default non-cleartype anti-aliasing which is even fuzzier than ClearType.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过几天的搜索,我发现了 MSDN 论坛帖子 为我指出了一个解决方案:http://www.softwareninjas.ca/dwrite-dll-wrapper
按照该页面上的说明进行操作并且您将从 IE9 中删除抗锯齿功能(至少是 32 位版本的 IE,这是默认的 IE,即使在 64 位 Windows 7 上也是如此)。到目前为止,我已经在 Win7 x64 笔记本电脑上对其进行了测试,并且运行完美。
非常感谢奥利维尔·达格奈 (Olivier Dagenais) 建造了这个。以下是他的解决方案如何工作的技术摘要。
这是一个两步过程。首先,您需要通过注册表项禁用 IE 中的 ClearType。这与以前版本的 IE 中可用的设置相同,但它已从 IE UI 中删除,因为它在 IE9 中停止工作。
其次,现在 ClearType 被禁用,Windows 将回退到非 ClearType 抗锯齿解决方案。现在还需要禁用后备抗锯齿功能。引用上面的线程:
这是一个非常酷的技巧。跨 Windows 和 DirectX 版本可能有些脆弱,但目前可以解决这个问题,直到 Microsoft 齐心协力修复 IE 本身的潜在“无法禁用抗锯齿”问题。
它还适用于使用 IE WebBrowser 控件(又名 MSHTML)的应用程序,因此您可以逐个应用程序控制抗锯齿功能。它也适用于 HTML 帮助查看器。
请注意,IE9 标准模式下的文本质量并不理想。具体来说,小字体的字母有时会排列在一起,而它们之间通常没有一像素的空间。如果您以兼容模式呈现同一页面(或者您的站点使用非严格 DTD 或其他非标准执行 DTD),那么它看起来很好。因此,如果某些网站想要获得最佳的别名文本呈现效果,则需要采取额外的步骤:只需按 IE 工具栏中的兼容性按钮即可以兼容模式查看网站。
After a few days of searching, I found an MSDN Forums thread which pointed me to a solution here: http://www.softwareninjas.ca/dwrite-dll-wrapper
Follow the instructions on that page and you'll remove anti-aliasing from IE9 (at least the 32-bit version of IE which is the default IE, even on 64-bit Windows 7). I've tested it so far on a Win7 x64 laptop and it worked flawlessly.
Big thanks to Olivier Dagenais who built this. Here's a technical summary of how his solution works.
It's a two-step process. First, you need to disable ClearType in IE via a registry key. This is the same setting which was available in previous versions of IE, but it was removed from the IE UI because it stopped working in IE9.
Second, now that ClearType is disabled, Windows will fall back to a non-cleartype anti-aliasing solution. Now that fallback anti-alising also needs to be disabled. Quoting from the thread above:
This was a pretty cool hack. Probably somewhat brittle across windows and DirectX releases, but will do the trick for now until Microsoft gets their act together to fix the underlying "can't disable anti-aliasing" problem in IE itself.
It also works for apps which use the IE WebBrowser control (aka MSHTML), so you can control anti-aliasing on an app-by-app basis. It also works for the HTML Help viewer.
Note that the text quality in IE9 standards mode isn't ideal. Specifically, small fonts sometimes have letters sometimes run together without the usual one-pixel space between them. If you render the same page in compatibility mode (or your site uses a non-strict DTD or other non-standards-enforcing DTD), then it looks fine. So there's an additional step for some sites if they want the best aliased text rendering: just view a site in compatibility mode by pressing the compatibility button in IE's toolbar.
直接回答你的问题:
因此,请尝试切换文档类型以使用Quirks 模式:
另一件事要考虑的是尽量避免基于点的字体大小。
有关 IE9 中的字体、模糊度和渲染的重要信息
MSDN 来源:
To answer your question directly:
So try switching your doctype to use Quirks mode:
The other thing to consider is to try avoid point based font sizes.
Important information regarding fonts, blurriness and rendering in IE9
MSDN sources:
这里的信息解决了两个问题:
1. 摆脱IE9中的cleartype和字体平滑
2. 在安装 IE10 或自动安装时摆脱 ClearType 和字体平滑功能
我做了一个注册 hack 来关闭 IE9 中的 ClearType:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
“使用清除类型”=“否”
并使用了一些免费软件来消除 IE9 中的字体平滑:
https://softwareninjas.kilnhg.com/Repo/Open-Source /Group/DWrite-dll-Wrapper
然后IE10自动安装,模糊类型又回来了。我尝试卸载 IE 10,不是通过添加/删除程序界面,而是通过已安装的更新界面——删除 IE10 更新。表面上,这让我回到了 IE9,但尽管注册表中 ClearType 的答案仍然是“否”,并且两个 .dll 文件仍然在我的 IE 程序文件夹中,但模糊的类型仍然存在。
所以,我决定卸载IE9并重新安装。这还涉及到检查已安装的更新界面并删除 IE9 更新。
我重新启动并预计必须重新安装该程序,但我的 IE 图标仍然存在。当我点击它时,IE9 以漂亮、清晰的字体打开。
The info here solves two problems:
1. Getting rid of cleartype and font smoothing in IE9
2. Getting rid of cleartype and font smoothing when IE10 is installed or installs itself automatically
I had done a registery hack to turn off cleartype in IE9:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"UseClearType"="no"
and used a little piece of freeware to get rid of font smoothing in IE9:
https://softwareninjas.kilnhg.com/Repo/Open-Source/Group/DWrite-dll-Wrapper
Then IE10 automatically installed itself and the blurry type was back. I tried uninstalling IE 10, which wasn't through the add/remove programs interface but rather through the installed updates interface--removing the IE10 update. That ostensibly took me back to IE9, but the blurry type remained in spite of the fact that "no" was still the answer for cleartype in the registry and the two .dll files were still in my IE program folder.
So, I decided to uninstall IE9 and reinstall it. That also involved going through the installed updates interface and removing the IE9 update.
I rebooted and expected to have to reinstall the program, but my IE icon was still there. When I clicked it, IE9 opened with nice, sharp type.