Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-browser base64 webfonts support

internet-explorer aborts the EOT file loading progress sometimes, so the font does not load correctly.

  1. There is a abstract solution with eotfast & mhtml, but it's not supported within IE7+8.

  2. The regular base64 method works pretty nice, but for IE9 only:

    src: url('data:font/eot;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAggg=='); /* IE 9 */

What's the common solution, to implement inline opentype webfonts for internet-explorer7+internet-explorer8?

like image 516
mate64 Avatar asked Jun 20 '12 18:06

mate64


2 Answers

Data URLs are not supported for Internet Explorer 7
More details on DataURL support

In this case, use conditional comments to serve non DataURL font to IE7 and lower:

<!--[if (lte IE 7)]>
    <link rel="stylesheet" media="screen" href="css/fontface-ielt8.css" />
<![endif]-->

Internet Explorer 8 has a DataURL size limit of 32KB

If your font doesn't show up in IE8, this may be the reason.
Then try to modify the font via fontsquirrel (expert mode) or another application to cut down the font size.

Hope this helps.

like image 104
doptrois Avatar answered Sep 30 '22 13:09

doptrois


Seeing that your issue is not problems implementing inline opentype webfonts for IE7+8 but rather the fact that Internet Explorer seems to abort the EOT file loading progress sometimes, I have to point out that fonts have to comply with cross-origin resource sharing.

like image 28
Oleg Avatar answered Sep 30 '22 11:09

Oleg