Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you detect if Cleartype is enabled on PC via javascript?

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

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

like image 349
dlrust Avatar asked Dec 01 '10 20:12

dlrust


1 Answers

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

Details here.

like image 80
Byron Whitlock Avatar answered Oct 08 '22 04:10

Byron Whitlock