The return of font embedding to the web?

Sadly, quite a bit of what I wrote in this arti­cle is based on out of date infor­ma­tion, and on my own test­ing that had a fatal flaw. I’ve left the arti­cle as it is, and added cor­rec­tions inline

Most web design­ers and devel­op­ers will be famil­iar with Image Replacement tech­niques, pio­neered by early CSS guru Todd Fahrner [1] (FIR or Fahrner Image Replacement tech­nique), and sub­se­quent attempts to address the usabil­ity, acces­si­bil­ity, and other con­cerns asso­ci­ated with it.

These tech­niques emerged to address a sig­nif­i­cant prob­lem with web design — it was not pos­si­ble to embed spe­cific fonts in a web page. So devel­op­ers you could either rely on a small num­ber of stan­dard fonts on var­i­ous plat­forms (and risk los­ing clients, or get­ting fired), or use images for text in some way. IR tech­niques def­i­nitely had advan­tages over using img ele­ments, but were, and remain, far from ideal.

What a lot of peo­ple prob­a­bly aren’t aware of is that even in Netscape 4 and Internet Explorer 4 there were ways of embed­ding fonts (or more strictly link­ing to font files online that browsers could then down­load and use for ren­der­ing the page.)

Uunfortunately, each browser had its own, pro­pri­etary for­mat for doing so. Then, when Netscape 6 went open source, it could not open source the TrueDoc code it used to man­age embed­ded fonts, and so font embed­ding, rarely used, was dropped in Netscape. While it per­sisted in Internet Explorer, devel­op­ers very rarely uti­lized it.

CSS3 (and even drafts of CSS2 in 1997 and 1998) have long promised a stan­dard­ized way of font embed­ding, using the @font-face rule. What many folks prob­a­bly don’t know is that this rule is already sup­ported in Opera 9.5, ship­ping ver­sions of Safari for the Mac, Windows and iPhone OS, and is promised for Firefox 3.1., and well as IE6 and later.

Sadly, while sup­port for @font-face was hinted at for Opera 9.5 and Firefox 3.1 (see my com­ments at #4 below) this is in fact not the case sadly.

There is a catch though. All the browsers other than IE sup­port link­ing to TrueType font files. Microsoft sup­ports only the pro­pri­etary EOT file for­mat. They are how­ever propos­ing to stan­dard­ize Embedded Open Type (EOT).

While the way in which you spec­ify fonts to embed in IE (using @font-face) is iden­ti­cal to how fonts are spec­i­fied for the other browsers men­tioned, Microsoft appears to be refus­ing to coun­te­nance sup­port­ing embed­ded fonts in for­mats other than EOT (specif­i­cally the extremely widely sup­ported TrueType for­mat, which the other browsers men­tioned do support.)

There’s a lot of dis­cus­sion (a lot of it heated and polem­i­cal, thank­fully some more ratio­nal even if pas­sion­ate) going on around these issues.

Bill Hill at the offi­cial IE Blog started the con­ver­sa­tion with the announce­ment of a rela­tion­ship between Microsoft and font foundry Ascender Corporation, and a dis­cus­sion of EOT, and tech­ni­cal and legal issues around embed­ding fonts (it might have been more politic to sep­a­rate the announce­ment from the dis­cus­sion). This post included the announce­ment of the Font Embedding com­mu­nity, which describes itself as

A resource for design­ers, devel­op­ers and type­face cre­ators on font usage, tech­nol­ogy and licens­ing issues

Joe Clarke, who’s spo­ken at a num­ber of our events, and is never one to leave folks guess­ing what he is think­ing, rather directly crit­i­cised the post (though the crit­i­cism is not entirely focussed on the issue of font embedding).

Chris Wilson, now plat­form archi­tect of Internet Explorer, long time IE devel­oper (and prior to that Mosaic devel­oper (prior as in 1994)), co-​​chair of the HTML Working Group, and long time cham­pion of web stan­dards also posted a detailed dis­cus­sion of the issues and his think­ing. He writes

I’ve been clear on this to the CSS WG, so I sup­pose I should be here too — we (Microsoft) should NOT sup­port direct TTF/​OTF embed­ding, unless 1) there is some check that the font intended that use to be allowed, which I don’t think there cur­rently is (as it needs to refer to the license agree­ment), AND 2) other browsers also imple­ment a sys­tem that actu­ally ENABLES com­mer­cial fonts — those that are allowed to be embed­ded, but can­not be legally placed directly on a server — to be used.

This is fol­lowed by a robust dis­cus­sion, again often polem­i­cal, but well worth read­ing to get a sense of the issues.

Mozilla devel­oper, Robert O’Callahan, recently posted on this issue, and dis­cusses some of the issues around intel­lec­tual prop­erty protection.

The fol­low­ing is not cor­rect, in the sense that it does not work for Opera 9.5 and Firefox 3.1 — only Safari 3.1 allows @font-face link­ing to TrueType files, and IE @font-face link­ing to EOT files. So the tech­nique out­lined should work, but only for those browsers.

But where do we stand as web devel­op­ers? I con­sider it very unlikely that we’ll see Internet Explorer sup­port for­mats other than some­thing like EOT (Wilson says at one point “I don’t per­son­ally even care that much if that sys­tem is EOT as it is today”). But, there is some good news in all this. At least the same stan­dard­ized approach to font embed­ding, using the @font-face rule works for all mod­ern browsers. While I think it will be no small time until Internet Explorer sup­ports direct font link­ing to for­mats like TrueType, all the major cur­rently released browsers (IE6, IE7, Firefox 3.1, Opera 9.5, Safari 3) cur­rently, or will shortly, sup­port font link­ing or embed­ding using the same @font-face rule.

While it appears to be a return to the bad old days of IE/​EOT ver­sus Netscape/​TrueDoc, is there in fact a way of using a sin­gle style sheet and serve embed­ded and linked fonts to all these browsers, so that each browser will use the intended font? Well, in fact there is. Here’s how.

@font-face rules spec­ify a name for a font (you then use this name in font-family prop­er­ties in the same style sheet) and a src where the font file can be found.

Instead of just using one @font-face state­ment, we’ll use two. The first will spec­ify a font with an EOT file for Internet Explorer to use, the sec­ond a TrueType file for the other browsers to use.

The first @font-face rule looks like this

@font-face {
    font-family:"Fenwick";
    src: url(fenwick.eot);
  }

We spec­ify a font-​​family name, in this case “Fenwick” (which hap­pens to be the name of the font — but you can use any name you like here, it is merely a way of iden­ti­fy­ing the resource in the src prop­erty of the @font-face rule), and a src — which is a rel­a­tive or absolute url to the font file.

(As an aside, I cre­ated these EOT fonts using the tool found at Font Embedding, and the fonts cre­ated are licensed to be used on web sites).

Next, we spec­ify a sec­ond @font-face rule, for browsers that sup­port TrueType file linking.

@font-face {
  font-family: "Matrix";
  src: url(http://www.westciv.com/CSS3Tests/matrix.ttf) ;
}

The font doesn’t look any­thing like Fenwick, I just hap­pened to have it online — it’s a free font in the style of the Matrix movie’s credits.

Now, we just need a state­ment in our style sheet to asso­ciate these fonts with, for exam­ple, para­graphs. It’s prob­a­bly one of the very first state­ments any­one uses in CSS

p {
    font-family: Fenwick, Matrix, san-serif;
}

When a browser comes to styling para­graphs with this CSS, it will first look for a font called “Fenwick”. Internet Explorer will use the font defined in the font-​​face rule, while the browsers which sup­port @font-face, but not EOT, will use Matrix. Browsers which don’t sup­port @font-face (Firefox 3 and ear­lier, Safari 2 and so on) will sim­ply show a san-​​serif font.

You can see this in action here.

Yes, it’s a lit­tle bit of extra work, but it’s def­i­nitely tech­ni­cally pos­si­ble (leav­ing aside licens­ing com­plex­i­ties) to now embed fonts for any con­tem­po­rary browser. To me this is extremely exciting.

Now what we really need is for font foundries to real­ize the poten­tial bonanza for them in licens­ing their fonts to be used like this, rather than focussing on the pos­si­ble losses of peo­ple mak­ing unli­censed copies of their fonts.

[1] Todd, an orig­i­nal CSS Samurai, CSS work­ing group invited expert, and designer with Verso, one of the early super star web design firms left the world of the web to run his own bike store in Portland Oregon. Plenty of times I envy him the wis­dom of that decision.

47 responses to “The return of font embedding to the web?”:

  1. Are you pos­i­tive that Opera 9.5 sup­ports the @font-face construct?

  2. Actually, I don’t believe any browser other than Safari sup­ports this currently.

    You fail to men­tion, btw, that the only part of IE’s font embed­ding that is pro­pri­etary has been the EOT for­mat itself — we use the CSS3 @font-face pro­posal to set it up. We have also con­tributed the EOT for­mat into the W3C, with sup­port from Adobe.

    And BTW — though I’ll talk about licens­ing in response to Robert’s post — I would explic­itly note again that the direct-​​TTF link­ing will only not vio­late license for a dis­tinct set of non-​​commercial fonts. In fact, very FEW fonts, because even most free­ware fonts want attri­bu­tion and their license to be deliv­ered with them.

  3. The prob­lem with @font-face is that it vio­lates the font man­u­fac­tur­ing license agree­ment with the end-​​user. Put sim­ply, it read­ily enables font piracy. Any font embed­ded this way can be down­loaded to the web viewer’s machine, and used as if he or she had paid for the font. Hacker skills are not required. The abil­ity to down­load embed­ded fonts is read­ily dis­cov­er­able to any com­pe­tent browser user.

    I’m sure this was not Håkon’s inten­tion (and it’s not some­thing we knew about when we pub­lished “CSS at Ten”) but I worry that a stan­dard for embed­ding typog­ra­phy on web pages was cre­ated seem­ingly with­out involv­ing peo­ple who make type­faces. Why weren’t typog­ra­phers con­sulted before the stan­dard was released? (If they were con­sulted, were they asleep? Were the tech­ni­cal ram­i­fi­ca­tions not explained to them?) These are ques­tions for Håkon, not you, and post-​​mortems don’t mat­ter any­way (except as a guide to what not to do next time). But how­ever we got to the spec we have, we have a problem.

    My col­leagues and I have been greatly con­cerned about this issue. We want to cre­ate web­sites that use fonts other than Georgia and Verdana and don’t require Flash and JavaScript to do so. We want to do it with web stan­dards that nat­u­rally extend the capa­bil­i­ties of CSS.

    I don’t know enough about Microsoft’s approach to endorse it whole­heart­edly. (That’s not a lack of endorse­ment; it’s “I haven’t had time to get to the bot­tom of this yet.”) But what sev­eral col­leagues and I like and appre­ci­ate about Microsoft’s approach is that it pre­vents font piracy — or at least makes font piracy extra­or­di­nar­ily difficult.

    People may resist EOT because it’s from Microsoft or because we already have a stan­dard; but that’s putting the W3C seal of approval cart before the “don’t put font design­ers out of busi­ness” horse.

  4. I have to take issue with this state­ment:
    “all the major cur­rently released browsers (IE6, IE7, Firefox 3.1, Opera 9.5, Safari 3) cur­rently, or will shortly, sup­port font link­ing or embed­ding using the same @font-face rule. ”

    Firstly, if Opera 9.5 sup­ports direct link­ing to TTF’s via the @font-face rule, it’s a well-​​kept secret because Opera’s own doc­u­men­ta­tion says it doesn’t and I’ve tested it. No font-​​face sup­port at all.
    Secondly, Firefox 3.1 does not sup­port @ font-​​face for direct link­ing to TTF’s or EOT’s either.
    Thirdly, what evi­dence do you have that Opera and FF will “shortly” sup­port it? Have you spo­ken with man­age­ment at Mozilla and Opera about it? Or is it sim­ply a psy­chic vision kind of thing?
    The evi­dence, so far, points in the oppo­site direc­tion. Hakon Wium Lie, the chief tech­nol­ogy guy at Opera has been hawk­ing the idea of directly link­ing to TTF’s for two years now, and Opera still has not done it.
    See these two arti­cles:
    Forgotten Monopoly
    The Next Big Thing
    I believe this is because there are seri­ous unre­solved legal issues involved. Lie him­self alludes to them in the arti­cles cited.
    Lastly, Internet Explorer has sup­ported the @font face CSS rule for EOT embed­ding for ten years. It does not, how­ever sup­port link­ing to TTF files directly and it’s been author­i­ta­tively stated that they don’t intend to.

  5. com­ment

  6. Zeldman stated:

    People may resist EOT because it’s from Microsoft or because we already have a standard […]

    Wilson stated:

    We have also con­tributed the EOT for­mat into the W3C, with sup­port from Adobe.

    Wilson’s state­ment was the first indi­ca­tion, that I am aware, that the CSS3 pro­posal has sup­port from a firm who is both a Microsoft com­peti­tor in Internet tech­nolo­gies and also a font foundry, i.e. Adobe. It says much.

  7. @chris

    it def­i­nitely wasn’t my inten­tion to be crit­i­cal when using the term “pro­pri­etary”, and it was def­i­nitely to draw atten­tion to both the pro­posed EOT stan­dard­iza­tion (as a W3 rec­om­men­da­tion, whose strong, lib­eral IP pol­icy is the best pos­si­ble place for it) and that the font lining/​embedding mech­a­nism was using @font-face — a (kinda only in the sense that it isn’t a pub­lished W3 rec) stan­dard­ized approach, as for other browsers

    @Richard and thacker

    As you’ll now see from my inline addi­tions, I made a cou­ple of errors that rein­forced one another in com­ing to the con­clu­sion of sup­port in FF3 and O9.5

    I’ve been track­ing reports of this for a while, and got a sense that this was com­ing from things like the following

    http://​www​.mind​fly​.com/​b​l​o​g​/​p​o​s​t​/​2​0​0​8​/​0​7​/​T​h​e​-​G​o​o​d​-​S​i​d​e​-​a​n​d​-​B​a​d​-​S​i​d​e​-​o​f​-​F​o​n​t​-​F​a​c​e​.​a​spx
    http://​css​.dzone​.com/​n​e​w​s​/​c​s​s​-​s​u​p​p​o​r​t​-​f​i​r​e​f​o​x​-​3​-​a​n​d​-​o​per
    http://​archivist​.incu​tio​.com/​v​i​e​w​l​i​s​t​/​c​s​s​-​d​i​s​c​u​s​s​/​9​3​353

    and else­where for both browsers — per­haps evi­dence of the echo cham­ber at work in a num­ber of cases

    Couple this with my test­ing error — I had at some time in the past installed the Matrix font on my sys­tem, and it is called Matrix — so it appeared to be sup­ported on my sys­tem for Opera 9.5 in testing :-(

    Thanks for point­ing this out

    john

  8. @thacker,

    the EOT pro­posed stan­dard includes sup­port from Microtype, who

    grants to the W3C a per­pet­ual, nonex­clu­sive, royalty-​​free, world-​​wide right and license under any Monotype Imaging copy­rights on this con­tri­bu­tion, to copy, pub­lish and dis­trib­ute the con­tri­bu­tion under the W3C doc­u­ment licenses.

    Additionally, should the Submission be used as a con­tri­bu­tion towards a W3C Activity, Monotype Imaging grants a right and license of the same scope to any deriv­a­tive works pre­pared by the W3C and based on, or incor­po­rat­ing all or part of, the con­tri­bu­tion. Monotype Imaging fur­ther agrees that any deriv­a­tive works of this con­tri­bu­tion pre­pared by the W3C shall be solely owned by the W3C.

    Chris, is there any more infor­ma­tion on the “sup­port from Adobe”?

    Thanks

    john

  9. Allsop–

    In my view, that was a rea­son­able oversight.

    Just from test­ing stand­points of an EOT is con­fus­ing … a font man­age­ment appli­ca­tion and bare min­i­mum device fonts within the Windows font folder are a neces­sity. And the WEFT tool can only cre­ate fonts that are present within the Windows font folder based upon my expe­ri­ence. Bottom line, it happens.

  10. Thanks for the ‘fess up. You’re a men­sch, I see.
    In dis­cussing “sup­port” for @font-face the devil is in the details — it’s impor­tant to dis­tin­guish between sup­port for link­ing directly to TTF’s and thereby encour­ag­ing font theft and the wrath of the font-​​making com­mu­nity (as Zeldman alludes to) in con­trast to link­ing to an EOT; a site spe­cific encoded and com­pressed for­mat which delib­er­ately tries to pre­serve the terms of the license for the font.

  11. @John I’ll have to look it up. Sorry, I’m on vaca­tion this week. :) I’ll look on Monday.

  12. @Richard,

    thanks — thanks good­ness this is blog­ging, where accu­racy is optional :-/

    I delib­er­ately left out any real dis­cus­sion of the legal/​ethical issues around this topic for the arti­cle as I wanted to focus on the tech­ni­cal side. Too often all these issues get mixed up, and I think sep­a­rat­ing them out might have some value.

    I do want to address the legal issues in an upcom­ing arti­cle. The prob­lem is that this issue seems to largely polar­ize, as the dis­cus­sions fol­low­ing sev­eral of the arti­cles linked above demonstrate.

    @Chris,

    thanks — enjoy your break. Here’s hop­ing we get a break­through in what has long been desired by web design­ers, and which will be par­tic­u­larly wel­come among east asian developers.

    @Jeffrey,

    As I men­tion in my reply to Richard, I steered clear of legal/​ethical issues in this arti­cle. That’s not to say they aren’t impor­tant (you’ll note my exam­ple uses a TT font for which the license allows link­ing, and specif­i­cally licensed fonts for the EOT example)

    I hope to put together some­thing that can­vasses this issues, and high­lights the sense in both major argu­ments around linking.

  13. @john re: legal issues per­tain­ing to Font Embedding in browsers
    I’ve looked into it quite a bit and the best roundup of the applic­a­ble case law and the main legal issues that I’ve found is:
    Sony Revisited
    A 27 page pdf (in read­ably large type) and thank­fully as free of legalese as it’s pos­si­ble to get with sub­ject mat­ter of this nature. (IMHO)

  14. Thanks Richard,

    my (non expert but not entirely untrained) opin­ion is that fol­low­ing the court’s rea­son­ing in SONY, browsers clearly have “sub­stan­tial non-​​infringing” uses. Even font link­ing to TT fonts has a sub­stan­tial non infring­ing use (for instance link­ing to TT fonts that are expressly licensed for such pur­pose, of which there are very many).

    And so, I doubt browsers imple­ment­ing sim­ple link­ing to TT fonts would be on any kind of shaky legal ground. Mind you, the cost of defend­ing (and indeed bring­ing) such a case would be extra­or­di­nary, par­tic­u­larly with such a strong prece­dent in SONY.

  15. I have to dis­agree with your assess­ment. I think the legal ground is very shaky and very, very dif­fi­cult to assess. Much has hap­pened since the Sony case — there’s been Napster, Grokster, Aimster, and other lower court deci­sions.
    How gray?
    Here’s a fic­ti­tious sce­nario quite easy for any­one to under­stand:
    Let’s say I, Richard Fink, am brows­ing using Safari. And in the course of doing so I go to a site set up by Joe Allsopp that is using a direct link to a TTF font file that you don’t have a license for. At that point I, too, am infring­ing by hav­ing gone to your web site and load­ing the font into the RAM in MY com­puter, at MY house. I have been induced to infringe, with­out my knowl­edge, by both Apple and you. And there is case law that strongly sug­gests that the copy­right holder of the font is enti­tled to dam­ages from Apple and/​or you.
    Maybe even the ser­vice provider has some lia­bil­ity. Maybe even me. (Product idea: “Phont-Protect” — a plug-​​in that fil­ters out fonts called with the @font-face rule to keep users on the right side of the law…)
    Anyway, the issues are com­plex and the case law vague.
    Here’s my bot­tom line ques­tion: Does Apple’s imple­men­ta­tion of @font-face, with it’s non-​​discriminating abil­ity to link directly to TTF font files encour­age piracy? My answer is: Yes, of course it does.
    I have no dog in this fight, I’m just very suprised that Apple would go ahead and poke Adobe, Microsoft, and the Font-​​Design com­mu­nity in the eye like this.
    What did they gain except ill-​​will?

  16. These are issues for the foundries, browser man­u­fac­tur­ers, etc. to mull over. What a foundry has to explore are —  what is hap­pen­ing within the mar­ket, how is that mar­ket chang­ing, what is our risk if the mar­ket change is not met and if it is met, what are the finance oppor­tu­ni­ties for meet­ing that change.

    I, as a con­sumer, do not give a damn about any EULA that accom­pa­nies either a font or a toaster. If I have a need to use that toaster to toast wheat bread and only white bread is allowed by an EULA, well .. enough said. That does not imply, as some have incor­rectly assumed, that it means that raw font link­ing is sup­ported. What it does mean, in part, is that a mar­ket need exists, that the mar­ket need is grow­ing and that Internet com­mu­ni­ca­tion is a vital part of busi­ness. Markets will find a way — good, bad or indif­fer­ent. It is the foundries’ choice to win or lose within that change.

  17. Richard,

    I cer­tainly think there is an argu­ment there around induce­ment to infringe. But it applies not merely to fonts — but any intel­lec­tual prop­erty — fonts them­selves are not priv­i­leged in any spe­cial way over other forms of IP (in fact, in some ways, they are less priv­i­leged than other IP).

    So, for a court to so decide opens up the pos­si­bil­ity that the owner of IP in code, text, images, and so on will bring sim­i­lar actions against browser devel­op­ers. The RIAA would have a field day with that.

    Here’s my bot­tom line ques­tion: Does Apple’s imple­men­ta­tion of @font-face, with it’s non-​​discriminating abil­ity to link directly to TTF font files encour­age piracy? My answer is: Yes, of course it does.”

    I’d argue that it no more encour­ages piracy than a browser being able to link to arbi­trary files served via http or ftp encour­ages piracy. It enables the copy­ing of font files to a local sys­tem by those who explic­itly decide to do so, in the same way that video recorders “enable piracy” by enabling copies of TV.

    But this is the heart of SONY — video recorders have a “sub­stan­tial non infring­ing use” — as clearly do browsers (even specif­i­cally with regard to lik­ing directly to for­mats like TT). The induce­ment aspect intro­duced in Grokster appears to specif­i­cally address a loop­hole in the SONY deci­sion that enabled file shar­ing ser­vices to argue SONY’s pro­tec­tion for devices with sub­stan­tial non infin­g­ing uses. In Grokster, the court’s rea­son­ing in very clear

    one who dis­trib­utes a device with the object of
    pro­mot­ing its use to infringe copy­right, as shown by clear
    expres­sion or other affir­ma­tive steps taken to fos­ter
    infringe­ment, is liable for the result­ing acts of infringe­ment by
    third parties.

    That sug­gests strongly intent to induce, as evi­denced by expres­sion or action is required.

    I can’t remotely guess why Apple has done this — but things seem to have started mov­ing on this front — per­haps that was their intention?

  18. @john
    All points well-​​taken. But then why did Napster lose?
    Ahh, the hell with it. My brain is fried.

    @thacker
    Yes, I think the font indus­try needs to get hip quick but I don’t have high hopes. They need some­one to do for them what Clive Davis did for the record busi­ness back in the late six­ties, early sev­en­ties. Re-​​examine the sense and pur­pose of tra­di­tional busi­ness prac­tices in light of the new real­i­ties. Based on what I’ve read, the indus­try is still focused on print media.
    Shortly before he died, famed Mafia leader Charlie “Lucky” Luciano (the “Capo De Tutti Capo” — Boss Of Bosses) gave a series of inter­views in which he, at one point, com­plains that too many of the local bosses can’t see the big pic­ture — “Can’t see their way past a bowl of pasta” was how he put it.
    Well, it’s time for the font indus­try to see past the pasta, or else.

  19. The “@font-face” ‘style’ worked like a charm in FF3.0.1. One ques­tion: how can I ‘call’ it to only one or another para­graph instead of EVERY para­graph? I really only want it for spe­cific Lines not even really para­graphs, more like head­ings I guess…
    Before I tried this, I had to take a cap­ture of what I wanted and insert the pic. (see site) But now that I know this lit­tle code will pull the font (click on the word “Welcome”) I need to con­strain the font to where I want it.
    Make any sense? John? Anybody?
    matthew

    • By:john
    • August 20th, 2008

    Matthew,

    If you want only spe­cific head­ing lev­els, you’d use a selec­tor like this

    h2 {}

    If you want spe­cific para­graphs, then there are a cou­ple of options. The most widely sup­ported is to use a class value on the para­graphs you want to style. For example

    Then use this selector

    p.introduction {}

    or you could use the nth-​​child selec­tor (sup­ported in all cur­rent browsers other than IE). for example

    p:nth-child(1) {} selects any para­graph which is the first child ele­ment of its par­ent element.

    Try our CSS guide for more details on all of these

    http://​west​civ​.com/​w​i​k​i​/​C​S​S​_​G​u​i​d​e​:​_​I​n​t​r​o​d​u​c​t​i​o​n​_​t​o​_​S​e​l​e​c​t​ors

    thanks, HTH

    john

  20. I think I just answered my own ques­tion…
    All I did was notate a num­ber after the ‘p’ in the ‘style’ code (p1) (p2) (p3) and so on… now I can use sev­eral dif­fer­ent fonts in dif­fer­ent places just by call­ing that at the open­ing of the para­graph sec­tion () instead of just ()
    THIS WORKS GREAT!!!!!!!!!!
    (I won­der, is it sup­posed to work like this?)
    (Have I dis­cov­ered an “Undocumented Functionality” that actu­ally is a pos­i­tive instead of a pain in the @ss!)
    matthew

  21. Sorry, didn’t read before post­ing, didn’t think any­one else would be up AND post­ing to this exact blog right now!
    But Thanks for the rapid response, although what I described DOES work in IE7…???
    And I think what you’ve listed there is just slightly dif­fer­ent than what I did. I think…

  22. […] and “embed­ding” (aka EOT). With Firefox about to imple­ment sup­port for link­ing à la Safari, John Allsopp has a sum­mary of the state of font tech­nolo­gies and an illus­tra­tion of just how easy it is to use these in […]

    • By:NM
    • August 27th, 2008

    Jeffrey Zeldman: “The prob­lem with @font-face is that it vio­lates the font man­u­fac­tur­ing license agree­ment with the end-​​user. Put sim­ply, it read­ily enables font piracy”

    The prob­lem with the IMG tag is that it vio­lates the photographer’s licence agree­ment with the end-​​user. Put sim­ply, you’re an idiot.

    Here’s how to pirate 9409545 fonts in a few min­utes:
    1. Install a BitTorrent client
    2. Go to thep​i​rate​bay​.org
    3. Clicketyclick.

    Notice some­thing about those 3 steps? None involve CSS3, @font-face or any­thing else.

    Automatic font down­load­ing is going to enable a new mar­ket for font design­ers; that is, as long as they’re not as retarded as the MAFIAAs. And why do I think that? Ask your­self, what hap­pens when some­one pirates a pic­ture /​ movie /​ mp3 and puts it on his web­site? Hm?

    • By:Jim
    • August 28th, 2008

    What is the point of EOT? How stu­pid is it for the browser to try to enforce basi­cally DRM rules for no rea­son.
    I mean we have copy­righted images, books, music, etc now that the browser can view with­out wor­ry­ing about the license… It’s the site-​​owner who has to obey by the license, not the browser view­ing the con­tent.
    EOT is just a headache any­way, it doesn’t pre­vent peo­ple from down­load­ing the font any­way, espe­cially if the font is there in TTF already to sup­port other browsers!

    It’s the web­site owner who has to know and obey the font license terms, not the visitors.

    • By:Cyrus
    • August 28th, 2008

    1) Font embed­ding is already avail­able in a vari­ety of tech­nolo­gies — word proces­sors, PDFs, etc. Why is this different?

    2) No other form of media cur­rently has DRM built into the browsers. Images, videos, etc. all have copy­right hold­ers with inter­ests in pre­vent­ing them from being dis­trib­uted over the inter­net, yet some­how the font peo­ple are suc­ceed­ing in their quest for DRM where the RIAA and MPAA have failed? Can some­one explain one dif­fer­ence between a font and a copy­righted image?

    3) The DRM in EOT is pretty triv­ial to crack.

    These “font foundries” need to real­ize that they have to approach the issue the same way other copy­right hold­ers do — make it clear when you license a font to some­one whether its ok for them to embed it in doc­u­ments, and if you find peo­ple infring­ing, issue take-​​down notices.

  23. […] Galbraith at Ajaxian recently posted again about using cus­tom fonts. He points to a cross-​​browser solu­tion by John Allsopp which serves EOT fonts and TTF fonts to both IE and non-​​IE browsers respec­tively is […]

  24. @john

    I got some infor­ma­tion from H Wium Lie regard­ing Opera’s imple­men­ta­tion of TTF/​OTF link­ing via @font-face.
    It is imple­mented in some­thing they call Wingogi, which is a stripped-​​down build they use as a test-​​bed.
    Available here:
    http://​labs​.opera​.com/​d​o​w​n​l​o​a​ds/
    However, whether or not sup­port for it will actu­ally be in the next release he did not say. (I find that con­spic­u­ous but just my hum­ble opin­ion.)
    As of Opera 9.2 TTF/​OTF link­ing is not supported.

    • By:john
    • September 1st, 2008

    Thanks Richard, most interesting,

    john

  25. […] Bu aralar yazı tipi gömme işleri üzer­ine bayağı bir çalışma var. Bence çok gecik­miş bir özel­lik umarım tüm tarayıcılar anlaşır­larda iş tatlıya bağlanır. Bağlantı  […]

  26. […] sup­ports @font-face, Firefox is not far behind in sup­port­ing that CSS spec. @font-face raises font licens­ing prob­lems, but we’ll dis­cuss those another time. The risk that con­cerns us here is when a browser […]

  27. […] there’s been a spat of edi­to­ri­als regard­ing cus­tom fonts for the web — with two com­pet­ing pro­pos­als (Microsoft’s EOT and embed­ding a TrueType font directly […]

  28. Well, I guess Mozilla’s gone and done it. The FireFox 3.1 Beta1 release supp­ports direct link­ing to ttf files.
    Safari, now FF, but still not Opera, inter­est­ingly, inso­far as they obvi­ously (see pre­vi­ous post) have had it all worked out for some time.

    When the inevitable piracy enabled by Apple and Mozilla’s deci­sion dis­plays, there is sim­ply no way that Adobe, Microsoft, and the rest of the font indus­try can let it stand legally. Their hand is being forced.

    Grab some popcorn!

    • By:john
    • October 16th, 2008

    Well spot­ted Richard. This makes things very interesting.

    But, just to ask the obvi­ous ques­tion, what makes fonts dif­fer­ent from words, images, soft­ware, music, and all the other IP that browsers enable folks to “pirate”?

  29. First, after a night’s sleep, let me amend my com­ment a bit while side­step­ping your ques­tion, for now:

    First, “Piracy” is a word with con­no­ta­tions unhelp­ful to the debate about what kind of Internet we want to have and I’m going to stop using it.
    For now, I’m going with “unlicensed”.

    Second, Apple/​Safari and now, Mozilla/​FireFox have put Microsoft, as a font ven­dor with a big invest­ment in fonts, in a weird posi­tion.
    Putting myself in their shoes, I ask what I would do if, for exam­ple, the Microsoft “C” fam­ily of fonts like Calibri, deliv­ered with MS Office, were to start appear­ing on web servers all over the place.
    Do you go down the legal road (because I assure you that a non-​​frivolous case for con­rib­u­tory infringe­ment can be made) or do you just sit tight and take it on the chin?
    I don’t know. We’ll see. That’s where the pop­corn comes in — it’ll be like watch­ing Court TV. Heck,keeping up with the MS-​​bashing blog posts alone could keep one occu­pied full-​​time.

    Let me be clear: I hope a prac­ti­cal and fair sys­tem for embed­ding fonts in web pages gets worked out and worked out as soon as possible.

    But beyond any IP issues, there are seri­ous prac­ti­cal issues that need to be thought about and addressed. @Font-Face isn’t a panacea.

    Fonts are referred to in CSS by name and there is absolutely noth­ing to pre­vent me or you or any­body else from sim­ply crack­ing open any TTF file we want and renam­ing it “Calibri” or even “Arial” and then con­fu­sion reigns, poten­tially.
    An extreme exam­ple, but you get my drift.

    There is also the prob­lem of poorly crafted fonts with miss­ing char­ac­ters and other defects. Caveat emptor.

    Then, there is the issue of file sizes. A full and com­plete font set can be huge. For an Asian lan­guage, my under­stand­ing is that it can be over a megabyte.

    One argu­ment in favor of EOT files is that EOT is a com­pressed for­mat.
    Frankly, since Microsoft has sub­mit­ted the EOT spec to the W3C and has announced that any­body can use it, no strings attached, I’m rather pissed that Safari and FF didn’t choose to sup­port that first, because we’d then be that much closer to what we all seem to want. With Internet Explorer already on board.

    I’ll pop back soon with a response to your actual question! ;)

  30. Also, I for­got what’s prob­a­bly the biggest prob­lem of all — how to rec­on­cile the design issues for browsers that don’t sup­port @font-face as opposed to those that do. If @font-face isn’t avail­able, what fonts get sub­sti­tuted and how? Which includes the need for some sort of sniff to see if @font-face is supported.

  31. According to the CSS2 (and CSS3, but not CSS2.1) specs, @font-face fonts fol­low the same fall­back scheme as any other font specified:

    @font-face {
            font-family: "Imported Font";
            src: url("http://site/fonts/imported.ttf");
          }
          h1 { font-family: "Imported Font", Verdana, sans-serif; }
    

    So, the sub­sti­tu­tion works fine. The only real issue here is that your imported font may have a much greater char­ac­ter width than any of the default fonts, mak­ing the design look quite dif­fer­ent if the browser can­not import the font.

  32. @guy
    Yes, but it’s not enough. For me, at least.
    Not just a mat­ter of the type­face look­ing dif­fer­ent, if you’re also using ems to size con­tain­ers it can look very, very, very dif­fer­ent. Not a lot of design­ers or their clients are com­fort­able with that. I’m assum­ing a tran­si­tional period where more in the way of cor­rec­tive action via script might need to be taken. If @font-face is not avail­able you might want to roll back to some pho­to­shop text or Flash, for instance.
    Plus MS, (and I don’t expect this to change) will not be sup­port­ing direct link­ing to TTF/​OTF files so you will most likely need a con­di­tion­ally com­mented style tag or link along with an equiv­a­lent EOT file for IE.
    (Once again, why did Webkit/​Safari/​Apple and FF/​Mozilla choose not to sup­port, as a first step, the file for­mat with prece­dent and the sup­port of the font-​​industry behind it? The file for­mat with an imple­men­ta­tion of ten years that’s cur­rently avail­able and ready to ben­e­fit at least three out of four peo­ple on the Internet? It IS those peo­ple we’re sup­posed to be serv­ing, isn’t it?)
    Instead of some­thing they know damned well IE isn’t going to sup­port and even if it did, in IE9, we’d still have to wait out the fall-​​off of IE6, IE7, and soon, IE8 to neg­li­gi­ble lev­els.
    Why even bother?
    Is some­body try­ing to prove a point? Is this some kind of ide­o­log­i­cal thing that I don’t get?

    • By:john
    • October 19th, 2008

    Richard,

    I can only spec­u­late as to why Safari and Firefox imple­mented embed­ding with non EOT fonts. But here are a few ideas

    1. From a tech­ni­cal point of view, I sup­port for EOT would be non triv­ial to imple­ment. Obviously, both browsers already sup­port TT fonts, so imple­ment­ing down­load­able TT fonts would clearly be far far less work.
    2. As open source projects, given the cur­rent sta­tus of the EOT spec­i­fi­ca­tion, under the licenses under which one or both of Mozilla and Webkit are released, it may not legally be pos­si­ble to have open source soft­ware that sup­ports EOT decod­ing. This has cer­tainly been the case with native sup­port for some audio and video for­mats in OSS.
    3. From a strate­gic legal POV, sup­port­ing DRM for fonts directly in the code base might be a slip­pery slope. Would it open the prospect that own­ers of other kinds of IP use sup­port for DRM with respect to fonts to argue that browsers should now natively sup­port DRM for all IP. Given the aggres­sive approach to both reac­tively and proac­tively defend­ing their prop­erty rights (real, and some­times imag­ined) of for instance the record­ing indus­try, do you want to give those folks an inch when it comes to dic­tat­ing the con­tent poli­cies of your browser?
    4. from a busi­ness strat­egy point of view, I imag­ine com­pa­nies on the whole don’t typ­i­cally sup­port the efforts of their com­peti­tors to cre­ate indus­try standards.

    Al as I said of these are spec­u­la­tion pure and simple.

    • By:john
    • October 19th, 2008

    Richard,

    Instead of some­thing they know damned well IE isn’t going to sup­port and even if it did, in IE9, we’d still have to wait out the fall-​​off of IE6, IE7, and soon, IE8 to neg­li­gi­ble lev­els.
    Why even bother?

    I guess a sim­i­lar ques­tion can be asked of inno­va­tions like border-​​radius, text-​​shadow, css tran­si­tions and really any browser innovations.

    Font embed­ding degrades grace­fully, and as I demon­strated in this arti­cle, the two forms (TT and EOT) can sit side by side. So, I’d argue that as of wide spread adop­tion of FF 3.1 (some time in the next 3 – 6 months given FF upgrade rates), you’ll have font embed­ding tech­nolo­gies in IE (any ver­sion), Firefox, Safari (includ­ing iPhone), and poten­tially, Chrome (it seems the webkit ver­sion of Chrome was forked off some time ago, so there’d be work to be done) — covering just about every browser on the planet.

  33. […] A cou­ple of months back, I sur­veyed the scene regard­ing a long cher­ished dream of web design­ers and devel­op­ers — font link­ing and embedding. […]

    • By:john
    • October 19th, 2008

    For those fol­low­ing this thread, I’ve just posted some more thoughts on font link­ing and embed­ding, in light of Mozilla’s upcom­ing Firefox 3.1 sup­port for @font-face link­ing to TrueType Fonts.

    • By:Nicholas
    • January 2nd, 2009

    I’m not sure if this will work as I don’t have Windows, but can you use the fact that IE doesn’t sup­port the for­mat() spec­i­fier to reduce the code required to sup­port both types of fonts to a sin­gle line?

    @font-face
    {
    font-​​family: Shiny;
    src: url(http://server.example/Shiny.eot);
    src: url(http://server.example/Shiny.ttf) format(truetype);
    }

    h1 { font-​​family: Shiny, sans-​​serif; }

    IE will parse the first line, under­stand it, and down­load the file. It will not under­stand the sec­ond line – it will try to down­load a file from “http://server.example/Shiny.ttf) format(truetype” – resulting in a 404, so the first file will get used.
    Safari will parse both lines, the sec­ond will over­ride the first, and thus be used.

    If this method doesn’t work, you can always use con­di­tional com­ments to pro­vide one src to IE and a dif­fer­ent one to other browsers. This way you don’t have to always have the same pair of font names in all your CSS.

  34. […] The return of font embed­ding to the web? | Web Directions […]

  35. […] font embed­ding becomes com­mon­place on sites cater­ing to cur­rent gen­er­a­tion browsers. There is a large col­lec­tion of blog arti­cles dis­cussing the obvi­ous ram­i­fi­ca­tions of embed­ding commercially-​​licensed […]

    • By:yeah
    • March 22nd, 2009

    Nicholas>
    it’s not work­ing
    only the last one is used
    even using !important

    try it your­self next time

  36. […] about the chal­lenges that arise when using @font-face. Font licens­ing is one (that many oth­ers have writ­ten about) and the file-​​size of included font-​​files is another, but this arti­cle is about browser […]

Your opinion:

XHTML: You're allowed to use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>