Hacker News new | past | comments | ask | show | jobs | submit login
Google Code Blog: Introducing the Google Font API & Google Font Directory (googlecode.blogspot.com)
268 points by boundlessdreamz on May 19, 2010 | hide | past | web | favorite | 59 comments

Unfortunately their blog's "example" is just a static image (what are they thinking?). If you want to actually see samples of what the fonts look like go directly to the Font Directory: http://code.google.com/webfonts

Let's see what they looks like on a variety of browsers:


This is probably due to limitations in Blogspot, although that's just an excuse for an unfortunate compromise.

As the article mentioned, you can see the implementation in wild here: http://www.smashingmagazine.com/

You linked to a homepage but I guess you meant to post a specific URL.

No, the article headlines use it.

Ah, I did not notice it. Thanks for the clarification.

Kilimanjaro called it yesterday :) http://news.ycombinator.com/item?id=1357578

Thanks google, love ya guys ;-)

Now, what would be the benefit of calling:

which in turn serves the css that contains the real call to the font:

  @font-face { font-family: 'Inconsolata'; 
  src: url('http://themes.googleusercontent.com/font?kit=J_eeEGgHN8Gk3Eud0dz8jw') 
  format('truetype'); }
So, why two trips, instead of just one?

What I'd do is just call the font directly and teach developers to use @font-face

And shrink the url a bit:

Remember, once it gets widespread use it would be harder to change a single char

It is important to note as well that http://themes.googleusercontent.com/font?kit=J_eeEGgHN8Gk3Eu... doesn't return just the font but the font that works with the browser that requested it. In IE it gives the EOT font in Chrome it gives the TTF

Another very important advantage is that the browser can cache the stylesheet and the font, and can reuse them across multiple websites.

So if your website uses a font that is used by another website which the user has already visited, the browser doesn't need to download the font again. It doesn't even need to check the modification date on Googles server.

As many fonts add ~100 KB to the download size for a page, this really makes a difference.

I wish they'd serve everything from subdomains in google.com. I mean, seriously, why does Google keep registering new domains for projects (google<something>.com) when they could easily use <something>.google.com instead? What's wrong with fonts.google.com?

My guess is they don't want to send all the cookies stored on the google.com domain whenever someone loads a font.

Seems reasonable. It protects users too because they can't track the cookies across these domains even if they wanted to.

Yahoo does this as well for the same cookie reason. Lots of stuff is hosted on yahoo.net that's considered potentially unsafe.

It says “The API will generate the necessary CSS specific to the user's browser so you can use the font on your page.” If you change your user-agent, you’ll see it change.

I'm looking at a few other similar services which also include legal text in the CSS file, I wonder if this might be another reason.

I believe that it's handling the browser differences server-side.

Is there any specific benefit to doing this? Does it decrease the number of files loaded?

it decreases the size of the CSS file slightly since you don't have to repeat every browser's version

On my Windows 7 machine, they're really ugly (in IE, FF, Chrome and Safari). I double checked to make sure ClearType was enabled, and it is.

I don't think I'd use any of these in a project where I needed a polished look and feel.

I much prefer Smashing Magazine's non-Google font-ified header font.

Kudos to Google for taking on this project, though. As others have said, this could be a catalyst in getting the foundries to open up their fonts to the web.

Chrome, Firefox and Safari all render beautifully on my machine, with Safari experiencing some rendering errors; Firefox even does ligatures correctly, which is something I've had trouble with before with fontsquirrel and the like. Whereas on my Ubuntu box everything is sharp and jagged and ugly as sin, particularly in text sizes like 14 and 12 pt. I'm inclined to think that this may be a font rendering issue, like the known tendency for ClearType to cram everything to a pixel grid.

Could you share some screenshots? The browsershots link [1] posted earlier only contains Windows XP.

It's hard to tell exactly what the quality is in Windos because the browsershots images are low-res, but it looks like the edges are very noisy.

[1] http://browsershots.org/http://code.google.com/webfonts

Before I saw your request, I put this one together: http://imgur.com/pR1IL.png

It's Win7 FF on the left, Safari on Mac on the right. I'll try to get some more when I'm at work tomorrow.

Looks nice on Mac. According to the screenshots, they're antialiased in Ubuntu also.

Wow this looks great. Just include the stylesheet and use the font in your CSS.

Seems like the big type foundries are going to regret dragging their feet on agreeing to a reasonable scheme for web fonts. I know that these are probably inferior in some ways to commercial fonts, but it will be a steep hill to climb to get people to pay for fonts if this project gains traction.

They don't have many fonts available yet, but if there is something I've learned about Google is that they always think big. Maybe in a couple of days they will announce the buy out of one of the foundries?

Here's hoping...

To be honest, how many fonts do you need? This is the web, and it is not 1998, when a lot of people would want to use as many fonts on their page as possible. Show some restraint.

More choice doesn't mean more typefaces on a single page.

Even if you use only 3 typefaces on a page, it doesn't mean you don't want access a library of a thousand fonts so you can use the perfect 3-5 typefaces.

More than that - most are too stylized to be used for body copy. You'd be amazed at how many times art directors or clients have forced me to use images for large chunks of copy.

For the most part I agree with you and feel that font-size, letter-spacing and line-height applied to standard fonts is enough for good typography.

Why are you implying that less fonts is a good thing? Just because someone might misuse fonts, that doesn't mean we should force everyone to use just what you think is okay. Magazines use all kinds of fonts and they typically look a hell of a lot better than most websites.

Google will tell you that they do things like this to make the web more usable, or on a larger scale, to make information more accessible. I think it’s mostly a sincere sentiment; what’s good for the web is good for google.

I just tried it in IE7, and the JavaScript from Google causes an error. The font still renders, however.

I was just redesigning one of my sites and was thinking seriously about using Typekit. This makes me rethink my strategy and will probably be a hard hit on Typekit.

It seems Typekit and Google made a deal: https://code.google.com/apis/webfonts/docs/webfont_loader.ht... I suppose they plan on 'sharing' the API where Google will supply/host the free fonts, and Typekit the paid ones?

Does Typekit have any advantages over Google? Google has better infrastructure, a simpler impelentation (no signup required), and a budget to license a wider variety of fonts.

They sell non-free fonts that allow font-face embedding in their licenses. Google will only offer free fonts.

Yes, and typekit has a huge and varying library of fonts available: http://typekit.com/libraries/full

This is a very exciting development that will offer great long-term benefits to the web. Relying on cross-platform fonts when building web pages was always challenging and limiting. I'm looking forward to this expansion of the font directory.

I also hope this improves the web browsing experience on Linux out of the box.

Disappointing that the gallery doesn't render in the android browser, considering the mentions of droid fonts.

Nor on Mobile Safari.

Are these free for commercial-use like fontsquirrel.com?

Yes. In fact, nearly all of the fonts are also available on fontsquirrel.com.

The fonts render really ugly with Firefox 3.6.3 on Windows 7 (cleartype on). Anyone care to throw a few screenshots from Chrome?

On Windows 7 it looks the same (ugly aliased) everywhere (Firefox, Chrome, Opera, Safari, Explorer).

On Windows XP it's even uglier (according to BrowserShots screenshots linked upthread).

On Ubuntu, Chromium and Firefox are pretty, Opera didn't render anything.

I need to try it tomorrow then at work. So it seems that the fonts themselves aren't that bad, they are just incompatible with most browsers.

It's no better in chrome. Super aliased, looks like crap.

The descenders in the Droid sans headlines on Smashing are cropping for me in vista. The fonts are also aliased, but if I remember correctly, typekit also only produced aliased fonts in windows.

I am terrified that we're going to see a lot of people start using Droid Serif and Droid Sans. These are not hideous fonts, but I find them somewhat graceless and unappealing.

this currently doesn't support SVG which means no support for the iPhone and iPad

Doesn't work on opera.

One little thing that makes the web a happier and prettier place.

Thanks Google, we owe you big.

Google webfont previewer: http://code.google.com/webfonts/preview

can anyone shed some light on why some people are reporting aliased text (even with clear type)?

I'm looking at them on XP and they look stunning in all browsers.

It's not a bulletproof system. I tried looking at the sample page at work where we have a restrictive proxy filter and it was a no-go.

Yet another attempt by Google to control our words and by proxy, our minds. Once everyone depends on this font API to make their social mobisodes pretty, Google will do some clever pixel altering to insert favorable articles about itself into the New York Times. They'll change the Chinese government's website to say "we suck", and a virtual stop-hitting-yourself slapfight will spillover into real world bloodshed.


Nah, they just want to move people out of making graphics they can't crawl/translate/etc and instead encourage people to use a textual format that Google (and anyone else) can index.

Naturally, the most insightful comment so far is a reply to a massively-downvoted "wake up sheeple" post.


Registration is open for Startup School 2019. Classes start July 22nd.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact