本文介绍了使用 css 强制抗锯齿:这是一个神话吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近有客户抱怨在 IE6 中出现系统字体.基本上问题是 IE6 不支持字体平滑/抗锯齿(我知道你可以在操作系统设置或其他东西中打开它).但是有人扔掉了这个宝石:

Recently a client has complained about the appearance of a system font in IE6. Basically th issue is that IE6 doesn't support font-smoothing/anti-aliasing (I know you can turn it on in an OS setting or something). But someone threw out this gem:

您可以通过使用 pt 而不是 px 来强制 css 中的字体抗锯齿."

"You can force font anti-alias in css by using pt instead of px."

我在各种浏览器中做了一个快速的 POC,并没有发现任何区别.我在网上找到了一个参考,在这个论坛上的最后一个帖子:

I did a quick POC in various browsers and saw no difference. I found one reference to it online, last post on this forum:

http://www.webmasterworld.com/css/3280638.htm

这听起来相当于网络开发者的都市神话,我的感觉是 BS.有没有人遇到过?

This sounds like the equivalent of a web developer urban myth, my feeling is it's BS. Has anyone ever encountered it?

推荐答案

不,作为 Web 开发人员,实际上没有任何方法可以控制它.

No, there's not really any way to control this as a web developer.

小的例外是,您可以通过 sIFR,并且某些浏览器不会对位图/像素字体进行抗锯齿处理(因为它们不应该,更多信息:抗锯齿/抗锯齿).

Small exceptions are that you can do some fake forcing of anti-aliasing by using Flash through sIFR, and some browsers won't anti-alias bitmap/pixel fonts (as they shouldn't, more info: Anti-Aliasing / Anti-Anti-Aliasing).

此外,正如 Daniel 所说,对所有字体使用 em 单位是理想的,请参阅 不可思议的 Em &使用 CSS 的弹性布局了解更多信息.

Also, as Daniel mentioned, it's ideal to be using em units for all fonts, see The Incredible Em & Elastic Layouts with CSS for more information about this.

这篇关于使用 css 强制抗锯齿:这是一个神话吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 09:23