11

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

dlrust
  • 2,433
  • 19
  • 20
  • 1
    I don't know for sure, but I would be very surprised to learn that this is possible. – Pointy Dec 01 '10 at 20:08
  • 3
    What? Don't worry about it. There's probably a 75% chance that your website is loading on an LCD monitor running at a non-native resolution, so everything will look like crap anyway. – MooGoo Dec 01 '10 at 20:09
  • Sorry @MooGoo - One reason I'd like to see this in action - when using CSS3 font replacement, applying font smoothing on a custom font will make it look worse, if the system already has font smoothing enabled. By detecting this you can determine the best approach to how you would like your font to look. – Glycerine Dec 01 '10 at 20:23

1 Answers1

16

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.

Byron Whitlock
  • 52,691
  • 28
  • 123
  • 168