80

I'm trying to figure out a decent solution (especially from the SEO side) for embedding fonts in web pages. So far I have seen the W3C solution, which doesn't even work on Firefox, and this pretty cool solution. The second solution is for titles only. Is there a solution available for full text? I'm tired of the standard fonts for web pages.

Thanks!

jeromej
  • 6,918
  • 2
  • 36
  • 52
Dan Rosenstark
  • 64,546
  • 54
  • 267
  • 405

6 Answers6

135

Things have changed since this question was originally asked and answered. There's been a large amount of work done on getting cross-browser font embedding for body text to work using @font-face embedding.

Paul Irish put together Bulletproof @font-face syntax combining attempts from multiple other people. If you actually go through the entire article (not just the top) it allows a single @font-face statement to cover IE, Firefox, Safari, Opera, Chrome and possibly others. Basically this can feed out OTF, EOT, SVG and WOFF in ways that don't break anything.

Snipped from his article:

@font-face {
  font-family: 'Graublau Web';
  src: url('GraublauWeb.eot');
  src: local('Graublau Web Regular'), local('Graublau Web'),
    url("GraublauWeb.woff") format("woff"),
    url("GraublauWeb.otf") format("opentype"),
    url("GraublauWeb.svg#grablau") format("svg");
}

Working from that base, Font Squirrel put together a variety of useful tools including the @font-face Generator which allows you to upload a TTF or OTF file and get auto-converted font files for the other types, along with pre-built CSS and a demo HTML page. Font Squirrel also has Hundreds of @font-face kits.

Soma Design also put together the FontFriend Bookmarklet, which redefines fonts on a page on the fly so you can try things out. It includes drag-and-drop @font-face support in FireFox 3.6+.

More recently, Google has started to provide the Google Web Fonts, an assortment of fonts available under an Open Source license and served from Google's servers.

License Restrictions

Finally, WebFonts.info has put together a nice wiki'd list of Fonts available for @font-face embedding based on licenses. It doesn't claim to be an exhaustive list, but fonts on it should be available (possibly with conditions such as an attribution in the CSS file) for embedding/linking. It's important to read the licenses, because there are some limitations that aren't pushed forward obviously on the font downloads.

d-k-bo
  • 141
  • 2
  • 9
fencepost
  • 1,688
  • 1
  • 12
  • 9
  • 11
    I think it is worthy to emphasize that you are not automatically allowed to take a font and @font-face-ize it even if you have bought a license of that font legally and for a lot of money. You need to check the font's license for whether that kind of electronic re-distribution is allowed or not. Infringements are so easy to detect and trawl for that there may easily be trouble otherwise, especially if you are a company situated in the right jurisdiction. – Pekka Dec 27 '09 at 22:34
  • FontSquirrel makes a clear point of this both on its pre-built font kits and in its generator (which requires you to verify that the fonts are actually licensed for such use). There are other conversion tools out there, but I don't know which ones make a point of discussing licensing. – fencepost Dec 28 '09 at 02:16
  • Fascinating stuff. Out of curiosity, how did you get to this post? There was more than one answer on the same day, and several comments on your answer. +1... – Dan Rosenstark Dec 28 '09 at 17:33
  • 1
    I don't remember how I ended up on it - search for HTML font perhaps, but I responded because I was working on just this for a client just before Christmas so the information was fresh. I assume Pekka saw it as new activity on an old post; I don't know if the system flags attempts to post multiple links (I know it blocked initially) but I figured it might be a case of "check this to be sure it's not someone spamming". – fencepost Dec 28 '09 at 21:05
  • @Pekka "infringements are so easy to detect and trawl for"... can you englighten me a bit, please... how would this detection and trawling be done, and under what circumstances would it happen? – Dan Rosenstark Feb 21 '12 at 00:07
  • It wouldn't be trivial to look at a site or page and determine whether it was infringing, but if you're a font designer I suspect you could search for the standard filename or font face name of your font and locate usages. – fencepost Feb 22 '12 at 03:01
  • @fencepost so they'd be relying on the name, filenames and other metadata to detect infringements? I realize this is all hypothetical. – Dan Rosenstark Aug 22 '12 at 23:27
  • That's my suspicion for automated searches - assuming that none of the search engines are actually indexing the actual copyright strings within the files themselves, it's probably filename and font name based. Of course, font-oriented people might look at the page and say "Hey, I know that font!" Since it's not just the filename, modifying the font file to change the names then using your tweaked file seems like stealing for the sake of stealing - if you're putting in that much effort, find a comparable free font elsewhere. It's like water-cooling Celerons, it's not for performance. – fencepost Aug 30 '12 at 15:53
  • @fencepost : Now I understand why mediawiki allow full style attribute but no style tags :-). – user2284570 Oct 31 '14 at 20:33
9

Try Facetype.js, you convert your .TTF font into a Javascript file. Full SEO compatible, supports FF, IE6 and Safari and degrades gracefully on other browsers.

Ajeet Ganga
  • 7,592
  • 10
  • 53
  • 72
Martin Meixger
  • 2,059
  • 21
  • 23
6

No, there isn't a decent solution for body type, unless you're willing to cater only to those with bleeding-edge browsers.

Microsoft has WEFT, their own proprietary font-embedding technology, but I haven't heard it talked about in years, and I know no one who uses it.

I get by with sIFR for display type (headlines, titles of blog posts, etc.) and using one of the less-worn-out web-safe fonts for body type (like Trebuchet MS). If you're bored with all the web-safe fonts, you're probably defining the term too narrowly — look at this matrix of stock fonts that ship with major OSes and chances are you'll be able to find a font cascade that will catch nearly all web users.

For instance: font-family: "Lucida Grande", "Verdana", sans-serif is a common font cascade; OS X comes with Lucida Grande, but those with Windows will get Verdana, a web-safe font with letters of similar size and shape to Lucida Grande. Linux users will also get Verdana if they've installed the web-safe fonts package that exists in most distros' package managers, or else they'll fall back to an ordinary sans-serif.

savetheclocktower
  • 1,333
  • 6
  • 10
  • 2
    Let me also stand on the soapbox for a minute: though I wish Windows had more "good" fonts (OS X has the greatest hits of typography history: Futura, Helvetica, Gill Sans, etc.), it's a good thing that we have to restrain ourselves when picking fonts. Freedom can be used for evil, too. – savetheclocktower Oct 20 '08 at 23:22
  • No comment on your comment, but thanks for the answer. That's great. Is there a list of cascades somewhere? Thanks again. – Dan Rosenstark Oct 20 '08 at 23:27
  • Here's one list: (http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html). It's conservative, only listing fonts that are identical (or nearly so) across platforms. You might have to do a comparison to see which "safe" font is most like your "risky" font. – savetheclocktower Oct 20 '08 at 23:44
  • (Oh, also: always specify a general fallback — sans-serif, serif, or monospace. That way, it'll at least be in the ballpark, should the user have *none* of your requested fonts.) – savetheclocktower Oct 20 '08 at 23:44
  • Excellent. Thanks again. Although now that I think about it I can just steal the cascades from sites I like. – Dan Rosenstark Oct 21 '08 at 00:09
  • If by bleeding edge you mean Safari 3.1 -- which has been out for 6 or 7 months -- as well as Opera 9.2 (which i believe is when Opera added ttf support), then yes, bleeding edge is an appropriate description, but most people would not consider something to be bleeding edge many months after release – olliej Oct 21 '08 at 03:52
  • 1
    Most users that come to the sites I work on still use IE6 (those bastards) So from that point of view I consider the latest major versions to be bleeding edge. – Gene Oct 21 '08 at 06:42
4

And it's unlikely too -- EOT is a fairly restrictive format that is supported only by IE. Both Safari 3.1 and Firefox 3.1 (well the current alpha) and possibly Opera 9.6 support true type font (ttf) embedding, and at least Safari supports SVG fonts through the same mechanism. A list apart had a good discussion about this a while back.

olliej
  • 32,789
  • 8
  • 55
  • 54
3

Check out Typekit, a commercial option (they have a free package available too).

It uses different techniques depending on which browser is being used (@font-face vs. EOT format), and they take care of all the font licensing issues for you also. It supports everything down to IE6.

Here's some more info about how Typekit works:

philfreo
  • 36,787
  • 25
  • 119
  • 140
2

I asked this a while back. The answer is basically that it doesn't work. :(

Community
  • 1
  • 1
Marcus Downing
  • 9,558
  • 9
  • 58
  • 79