禁用IE9中的Cleartype(文本抗锯齿) [英] Disable Cleartype (text anti-aliasing) in IE9

查看:145
本文介绍了禁用IE9中的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.

如何禁用IE9中的所有字体抗锯齿功能(ClearType或其他方式)?

How can I disable all font anti-aliasing (ClearType or otherwise) in IE9?

更多详细信息:

我们公司构建了一个使用许多小字体的Web应用程序.随着IE9的发布,我们的一些用户抱怨IE9的默认抗锯齿功能使我们的小字体变得模糊或模糊.因此,我们需要帮助已经安装IE9并希望关闭抗锯齿功能的用户.

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.

在IE8中,我可以取消选中始终对HTML使用ClearType",然后在操作系统中禁用ClearType,并且IE8将显示所有别名的字体.但是在IE9中,缺少此选项.

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.

在对问题进行了一些研究之后,这是我所学到的:核心问题是IE依赖DirectWrite进行文本呈现,并且不支持任何新的呈现选项,这些选项将在不使用抗锯齿和尊重字体的情况下绘制文本.用户的操作系统范围内的默认选择.

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.

更糟的是,如果在操作系统中禁用ClearType,则在某些情况下IE会退回到DirectWrite的默认非cleartype抗锯齿功能,这比ClearType模糊得多.

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.

推荐答案

经过几天的搜索,我发现了

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

按照该页面上的说明进行操作,您将从IE9(即使是64位Windows 7上也至少是32位版本的IE,它是默认IE)上删除了抗锯齿.到目前为止,我已经在Win7 x64笔记本电脑上对其进行了测试,并且可以完美地工作.

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.

非常感谢奥利维尔·达格奈(Olivier Dagenais)建造了这个建筑.这是他的解决方案工作原理的技术摘要.

Big thanks to Olivier Dagenais who built this. Here's a technical summary of how his solution works.

这是一个两步过程.首先,您需要通过注册表项在IE中禁用ClearType.此设置与以前版本的IE中可用的设置相同,但由于它已在IE9中停止工作,因此已从IE UI中删除.

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.

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"UseClearType"="no"

第二,既然ClearType被禁用,Windows将退回到非cleartype抗锯齿解决方案.现在,还需要禁用后备抗叠叠功能.从上面的线程引用:

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:

剩下的就是字体平滑 (又称亚像素渲染),即 您仍然看到的模糊效果" 关闭cleartype之后.

What is left is the font smoothing (aka sub-pixel rendering), and that is the "blurring effect" you still see after turning cleartype off.

如果您想知道,有一个 也可以关闭它.

In case you were wondering, there is a way to turn that off too.

我用来关闭 亚像素奇迹是要建立一个简单的 dwrite.dll的包装器 拦截并将呼叫转发给 真正的dwrite.dll,禁用字体 在此过程中进行平滑处理.

The method i used to turn off the sub-pixel wonder is to build a simple wrapper for dwrite.dll which intercepts and forwards calls to the real dwrite.dll, disabling font smoothing in the process.

您可以从以下网站下载: http://www.softwareninjas.ca/dwrite-dll-包装器

You can download it from: http://www.softwareninjas.ca/dwrite-dll-wrapper

您可以在以下位置找到代码 https://softwareninjas.kilnhg.com/Repo/Open-Source/Group/DWrite-dll-Wrapper

You can find the code at https://softwareninjas.kilnhg.com/Repo/Open-Source/Group/DWrite-dll-Wrapper

这是一个很酷的技巧.在Windows和DirectX发行版之间可能有些脆弱,但是直到Microsoft共同采取行动解决IE本身的潜在无法禁用抗锯齿"问题之前,这种方法将立即解决.

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.

它也适用于使用IE WebBrowser控件(又名MSHTML)的应用程序,因此您可以逐个应用程序控制抗锯齿.它也适用于HTML帮助查看器.

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.

请注意,IE9标准模式下的文本质量并不理想.具体来说,小字体有时带有字母,有时字母之间没有通常的一像素间距.如果您以兼容模式呈现同一页面(或您的站点使用非严格DTD或其他非标准强制DTD),则看起来不错.因此,如果某些站点希望获得最佳的别名文本呈现,则需要采取另外的步骤:只需按IE工具栏中的兼容性"按钮,即可在兼容模式下查看站点.

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.

这篇关于禁用IE9中的Cleartype(文本抗锯齿)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆