Embedded fonts: font-face or base64

846 views Asked by At

when I need/want to include new font to website, I use base64 (and hope the base64 is cached with CSS file).

But I see a lot of pages without base, only different files was font-faced. In Firebug I don´t see a HTTP request for the font, how it works?

I thought the font without base64 is downloaded from server each time when I refresh the page, cca a year later I saw at many pages that the text disappeared for a moment (I thought the font is downloading from the server in that moment). NOw, no disappearing, better browser cache?

What´s better to use?

The second thing, if the .htaccess file forbid the access to /font/ directory, is there any way to download the TTF file from remote server?

1

There are 1 answers

1
Masoud Jaafari On

why dont't you use @font-face?

@font-face {
                font-family: 'baran';
                src: url('fonts/BBadr.eot?#') format('eot'),  /* IE6–8 */
                url('fonts/BBadr.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
                url('fonts/BBadr.ttf') format('truetype');  /* Saf3—5, Chrome4+, FF3.5, Opera 10+ */
            }

this is the best way to embed fonts in your pages.