Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Created July 16, 2010 13:12
Show Gist options
  • Save jakearchibald/478344 to your computer and use it in GitHub Desktop.
Save jakearchibald/478344 to your computer and use it in GitHub Desktop.
<style>
@font-face {
font-family: 'foo';
/* this font only contains the glyphs 'f' & 'o' */
}
@font-face {
font-family: 'bar';
/* this font only contains the glyphs 'b', 'a' & 'r' */
}
.test {
font-family: 'foo', 'bar', sans-serif;
}
</style>
<p class="test">foo</p>
<!--
Firefox (3.6) and Opera (10.6) will load fonts 'foo' and 'bar', it sees that an element matches a style
with those fonts & loads them.
Webkit (chrome 5) is clevererer and only loads 'foo', it won't try and load 'bar' unless
chars are used that don't exist in the 'foo' font.
IE will load fonts 'foo' and 'bar' regardless of any usage on the page
-->
@jakearchibald
Copy link
Author

I'm not convinced the invisible text thing is the right way, I mean, I'd rather the user got the content as quickly as possible.

Maybe it should work in a similar way to CSS in Opera. As in, keep text invisible for 1-2 seconds (or until the font loads) then fall back to Firefox behaviour. That caters for people who are on a rubbish connection, or the server holding the font is a bit broken.

@paulirish
Copy link

Definitely agree with you wrt to text visibility.
Most webfonts people I talk to share the same POV too. It's just a matter of seeing the change land in browsers..

@jakearchibald
Copy link
Author

I've proposed some changes over at https://bugzilla.mozilla.org/show_bug.cgi?id=579916 - I've made a similar report in the trackers for Webkit, IE & Opera.

I looked at IE9 by the way, it behaves the same as Firefox & Opera in the case above. However, it also blocks page rendering worse than IE6-8. Hopefully they'll fix that along with the downloading-too-much issue you filed a report on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment