Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google webfonts render choppy in Chrome on Windows

I use the Google Webfonts service on my website and rely heavily on it. It renders fine on most browsers, but in Chrome on Windows it renders especially bad. Very choppy and pixelated.

What i have found out so far is that Chrome requires the .svg format font to be loaded first. The font i am using however, called Asap, was only available in .woff. I converted it to .svg using a free online service, but when i added that to my stylesheet (before the .woff), it didn't change anything.

I've also tried:

-webkit-font-smoothing: antialiased; text-shadow: 0px 0px 0px; 

Hoping that either would help the text render more smoothly.

Right now i've run out of ideas and i would hate to change fonts. Does anyone have an idea how i can solve this problem? I've been using the Adobe Browserlab to test the rendering, seeing as how i only own a mac. The link to the site is: www.symvoli.nl/about

Thanks in advance!

Edit April 11th, 2013:

Chrome 35 Beta seems to have finally solved this issue:

enter image description here

like image 572
Joey Avatar asked Jun 08 '12 16:06

Joey


People also ask

Why does my Google font look pixelated in Chrome?

Go to Control Panel > Appearance and Personalization > Display > Adjust ClearType text (on the left). Check the box entitled “Turn on ClearType.” After going through a short wizard, this will fix some of the text rendering issues in Chrome. Enable "Disable accelerated 2D Canvas" in Chrome.

Does Chrome use anti aliasing?

Chrome rendering engine does not allow antialiasing on fonts. This is pretty annoying, especially as Google provide a service to use webfonts!


2 Answers

Update August 2014

Google finally fixes this issue in Chrome 37 natively!!!. But for historical reasons I won't delete this answer.

Problem

The issue is created because chrome actually cannot render TrueType fonts with correct anti-aliasing. However, chrome still renders SVG files well. If you move the call for your svg file up in your syntax above the woff, chrome will download the svg and use it instead of the woff file. Some tricks like you propose work well, but only on certain font sizes.

But this bug is very well known to the Chrome developer team, and has been in fixing since July 2012. See the official bug report thread here: https://code.google.com/p/chromium/issues/detail?id=137692

Update Oct 2013 (Thanks to @Catch22)

Apparently some websites may experience intermittent spacing issues when rendering the svg. So there is a better way to skin it. If you call the svg with a media query specific to Chrome, the spacing issues disappear:

@media screen and (-webkit-min-device-pixel-ratio:0) {   @font-face {       font-family: 'MyWebFont';       src: url('webfont.svg#svgFontName') format('svg');   } } 

First approach solution:

The Fontspring bulletproof syntax modified to serve the svg first:

@font-face {     font-family: 'MyWebFont';     src: url('webfont.eot');      src: url('webfont.eot?#iefix') format('embedded-opentype'),          url('webfont.svg#svgFontName') format('svg'),          url('webfont.woff') format('woff'),          url('webfont.ttf')  format('truetype'); } 

Further reading:

  • CSS properties that affect type rendering
  • Smoother Web Font Rendering in Chrome for Windows
  • How to Bulletproof @font-face Web Fonts
like image 152
Tom Sarduy Avatar answered Sep 26 '22 02:09

Tom Sarduy


-webkit-text-stroke: 0.5px; 

use it only on large text, since it will affect your page performance.

like image 42
Daniel Sachs Avatar answered Sep 25 '22 02:09

Daniel Sachs