Trollwut Trollwut - 4 months ago 8
CSS Question

How to get smooth Google fonts?

I formerly used the plugin WP Google Fonts, which hasn't got my requested feature, either.

For now I'm using Google fonts with an implemented feature in the currently used theme. The fonts are embedded without trouble and they are shown correctly.

For now there are plenty blogs with nicely readable smooth fonts for HD displays and I want those fonts, too. As seen in my WordPress, it is capable of showing them, example below:

enter image description here

There are no sharp edges, no pixels, etc. That's how I would like it.

I selected "Droid Sans" currently as the font for my articles. But this font shows up WITH sharp edges and pixelated. Example below:

enter image description here
(Please note that opening this picture in a new tab shows the issue much more clearly.)

Is there anything to make this look smooth and cool?


  • Is it just the wrong font? I'm not bound to it and tried some others fonts. They all seem to have those sharp edges. If you know a font for compare, please note it.

  • Is there a CSS snippet I have to add?

  • Is it a server-sided configuration?



How can I achieve smooth fonts in my articles page?

Answer

It can depend on what browser you are using.

I tend to use

 -webkit-font-smoothing: antialiased;

for webkit browsers.

Alternatively, you can add a text-shadow to make the text look smoother

 html, html a {
      text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
 }

I also recommend you try different font sizes as some custom fonts will only look good at certain sizes.

Other than that, there isn't much you can do apart from use another font. Google Chrome did just release an update for smoother fonts. It might also be useful to look at svg fonts

http://www.fontspring.com/demos/svg-vs-woff/