
Web font preloading for HTML5 games - dwaxe
https://hacks.mozilla.org/2016/06/webfont-preloading-for-html5-games/
======
mozumder
Or just use Data URIs embedded in the CSS font face.

~~~
adiabatty
That must be less efficient than not base64ing, though. Wikipedia says
everything takes up 4/3 as much space in base64 if I'm reading it right. Is
that really such a good idea?

~~~
mozumder
If you're serving gzipped CSS, the size is recovered.

~~~
zx2c4
Unless you're comparing gzipped CSS (base64, I mean) to a gzipped font file,
in which case, the size isn't recovered.

    
    
        zx2c4@thinkpad ~ $ gzip Ovo-Regular.ttf 
        zx2c4@thinkpad ~ $ stat Ovo-Regular.ttf.gz 
          File: 'Ovo-Regular.ttf.gz'
          Size: 23903
    
        zx2c4@thinkpad ~ $ base64 Ovo-Regular.ttf  > Ovo-Regular.ttf.b64
        zx2c4@thinkpad ~ $ gzip Ovo-Regular.ttf.b64
        zx2c4@thinkpad ~ $ stat Ovo-Regular.ttf.b64.gz
          File: 'Ovo-Regular.ttf.b64.gz'
          Size: 34746

