CrocoDillon / font-store

Base64 encodes web fonts to cache in LocalStorage for high performance.
39 stars 7 forks source link

I wonder about browser support :-) #6

Closed serapath closed 9 years ago

serapath commented 9 years ago

I'm pretty new to care so much about fonts. After a long search, I finally found font-store and webfont-dl They booth seem to roughly do the same thing as such, but while yours is creating a json file, the other one is downloading fonts and generating a css file.

I like the json approach, because it enables me: font-store "http://fonts.googleapis.com/css?family=Dosis" and then...

var font = require('./fonts.1ead6978247a3574579977d98131b150.woff.json');

function insertFont(value) {
  var style = document.createElement('style');
  style.innerHTML = value;
  document.head.appendChild(style);
}
insertFont(font.value);

then i use browserify index.js > bundle.j and include it in my index.html like: <script src="bundle.js"></script>

Question

What is the browser support of the generated css, because there are some javascript libraries that generate a shitload of different @font-face variations for all kinds of scenarios and maybe they might get even browser prefixed or i dont know what :-) Would be nice to know.

serapath commented 9 years ago

Ah, just read "http://crocodillon.com/blog/non-blocking-web-fonts-using-localstorage", so everything beside IE8 is supported? Thats fine. By the way, awesome library :-)

CrocoDillon commented 9 years ago

Hey, browser support is basically limited by whether there is WOFF support or not. So not just IE8- is left out, sadly. http://caniuse.com/#feat=woff

Thanks :smile: