Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@font-face anti-aliasing on windows and mac

I've used http://www.fontsquirrel.com/ to create a @font-face kit.
It works fine, but the result on windows is different from the result on mac.
On windows the font seems to have a wrong anti-aliasing:
Font face on Mac this is the result on Mac with FF, Chrome or Safari (all updated to last version).
Font face on Windows this is the result on Windows with FF or Chrome.

As you can see, the result is not the same. On Windows the font is thicker and rougher.
How can I solve this?

like image 580
pasine Avatar asked Oct 30 '10 20:10

pasine


People also ask

Does Windows have anti-aliasing?

The Options for text anti-aliasing (Smooth edges of screen fonts) and ClearType are located in different locations, in Windows. This tool lets you configure your options easily from one place. You can enable or disable smooth edges for screen fonts and/or enable or disable the use of ClearType.

How do I turn on anti-aliasing in Windows?

Try using ClearType, not Standard font smoothing. It's in Display properties, Appearance, Effects.

What is font anti-aliasing?

Sometimes abbreviated as AA, anti-aliasing is a term used to describe the software process of making the edges of graphics objects or fonts smoother. Accomplished by adding additional pixels in-between the edges of an object and its background.

Is font face deprecated?

This feature is deprecated/obsolete and should not be used.


2 Answers

I too have been plagued with this on Chrome and I think I've just found the answer!

Chrome didn't like the default fontsquirrel.com generated CSS.

@font-face {     font-family: 'HLC';     src: url('/_styles/hlc/hl-webfont.eot');     src: url('/_styles/hlc/hl-webfont.eot?#iefix') format('embedded-opentype'),          url('/_styles/hlc/hl-webfont.woff') format('woff'),          url('/_styles/hlc/hl-webfont.ttf') format('truetype'),          url('/_styles/hlc/hl-webfont.svg#HLC') format('svg');     font-weight: normal;     font-style: normal; } 

To fix, i moved the SVG line:

url('/_styles/hlc/hl-webfont.svg#HLC') format('svg') 

to the top of the list. Now I see anti-alias fonts! I guess Chrome wants to be first...

/* THIS WORKS FOR ME */ @font-face {     font-family: 'HLC';     src: url('/_styles/hlc/hl-webfont.eot');     src: url('/_styles/hlc/hl-webfont.svg#HLC') format('svg'),          url('/_styles/hlc/hl-webfont.eot?#iefix') format('embedded-opentype'),          url('/_styles/hlc/hl-webfont.woff') format('woff'),          url('/_styles/hlc/hl-webfont.ttf') format('truetype');     font-weight: normal;     font-style: normal; } 

Hope it works for you too. Enjoy!

like image 130
maximo Avatar answered Oct 01 '22 09:10

maximo


I'm surprised no one mentioned this. Applying a slight -webkit-text-stroke does the trick for me whatever the format (extension) of the font you are using. Some recommend a -webkit-text-stroke: 1px but to me it alters the font look too much (make it too strong). But a 0.5px one makes the stroke almost unnoticeable and it turns on the antialiasing:

-webkit-text-stroke: 0.5px; 

Put it in your css definition for html tag and you're done!

like image 42
Pere Avatar answered Oct 01 '22 08:10

Pere