1

Curerntly, when you use a beautiful font, like for example the multiligual Calibri fotn (a win7 font), then it even downloads eventhough a user has the font already installed, when i use the following css:

@charset "utf-8";  
@font-face {
    font-family: Calibri;
    src: url('http://blabla.com/calibri.eot')
    }

However: this font is 400 kb gzipped, and i would like it to ONLY download, if the font is NOT present or installed by that name / family name, right?

Question: Is this possible to setup a neat conditional rule for this, for modern browsers (say IE8+, Firefox 3+ etc). How to implement it? Thanks for any and all clues!

3
  • 1
    Maybe this should be a question for Stack Overflow?
    – betamax
    Dec 15, 2010 at 10:10
  • Asper the FAQ this question belongs on Doctype
    – John Conde
    Dec 15, 2010 at 12:55
  • Silly John, why do you close off my interesting, on topic pro questions? Other people react upon and say INTERESTING (see below) I am answered below, fortunately before you closed me again. I demand a re-vote from ANOTHER moderator and hereby dismiss your domination as unjustice. This is a good question and received a good ansewr. You all the time cause me unhappyness by jealously closing off my interesting questions. Please go do something that is GOOD for the community, or else I will report this to the highest bosses about your unjustified, jealous activities against my little questions.
    – Sam
    Dec 15, 2010 at 15:13

1 Answer 1

5

You can do it like this:

@font-face {
    font-family: Calibri;
    src:
         local('Calibri'),
         url('http://blabla.com/calibri.eot');
}

Source and more detailed explanation.

2
  • 1
    Interesting... I had thought that if you omitted a local directive, it would simply search for the name given in font-family, and that's why you need to specify a smiley face for local if you wanted to force the browser to always use the online version. Dec 15, 2010 at 13:46
  • Thanks very much Betamax & Lèse majesté! I think that is it! This answer make my website much more pro. i guesse i have to call the fond then by font-family: "Calibri", Arial with double quotes around the fontname right?
    – Sam
    Dec 15, 2010 at 15:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.