你能通过javascript检测PC上是否启用了Cleartype吗? [英] Can you detect if Cleartype is enabled on PC via javascript?

查看:49
本文介绍了你能通过javascript检测PC上是否启用了Cleartype吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些@ font-face字体在非cleartype设置下效果不佳(边缘变得非常不稳定)

Some @font-face fonts don't play nice with non-cleartype settings (gets really choppy on the edges)

有没有办法检测到这一点如果cleartype关闭,我可以在body上做一个modernizr风格的类添加,所以我可以在我的CSS中使用它

Is there a way to detect this via javascript so that I can do a modernizr-style class addition to the body if cleartype is off so I can use this in my CSS

推荐答案

在IE 6+中,您可以检查 screen.fontSmoothingEnabled 属性。否则你需要使用html 5画布来检查这一点。

In IE 6+ you can check the screen.fontSmoothingEnabled property. Otherwise you need to use an html 5 canvas to check for this.

详细信息

这篇关于你能通过javascript检测PC上是否启用了Cleartype吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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