It all started with an email from a client: Do these fonts look funky to you? The title is prickly.
The font in question was Port Lligat Sans from Google Web Fonts.
Turns out that several @font-face selections do not contain hinting to make them buttery smooth on Windows even though Mac and Linux are fine. Even those at Font Squirrel and Google Fonts. This led to http://stackoverflow.com/questions/3451541/css-font-face-anti-aliasing.
##CSS3 font-smooth
- Source: http://www.w3.org/TR/WD-font/#font-smooth
- Idea: Use a baked in tag to make the browser's rendering engine handle the dirty work
Code:
font-smooth: always;
##A Little Twist
- Source: http://willmoyer.com/plato/
- Idea: Give the font a slight CSS3 tilt to rotate jagged edges away from pixels
Code:
transform: rotate(-0.0000000001deg)
##Force Subpixel Anti-Aliasing
- Source: http://maxvoltar.com/archive/-webkit-font-smoothing
- Idea: Use a vendor specific tag to force webkit browsers to smooth things out
Code:
-webkit-font-smoothing: subpixel-antialiased;
##Use text-shadow to Hide Aliasing
- Source: http://www.elfboy.com/blog/text-shadow_anti-aliasing/
- Idea: Add an alpha faded 'fuzziness' with text-shadow to hide jagged edges
Code:
text-shadow: 0 0 1px rgba(0,0,0,0.3);
#Verdict
On Windows 7 with IE9, FF10, and Chrome16 the winner is...text-shadow
. None of the other options worked to any degree with font-smooth
completely unsupported, transform
not being consistent, and the -webkit-font-smoothing
being a vendor specific tag (and it still didn't work).
The trick now is only applying this property to Windows browsers. jQuery to the rescue.
TO BE CONTINUED