Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS @font-face not working in ie

Tags:

html

css

xhtml

I have the following CSS that works within Firefox but not IE. Obviously, the fonts are within the directory. Any suggestions?

@font-face {
    font-family: "Futura";
    src: url("../fonts/Futura_Medium_BT.eot"); /* IE */
    src: local("Futura"), url( "../fonts/Futura_Medium_BT.ttf" ) format("truetype"); /* non-IE */  
}

body nav {
    font-family: Futura,  Verdana, Arial, sans-serif;
    font-size:1.2em;
    height: 40px;
}
like image 846
Shane Avatar asked Jun 21 '10 07:06

Shane


People also ask

Do Google fonts work in IE?

Google fonts are supported well on all modern browsers and IE9 and above.

How do I change the default font in Internet Explorer?

Change the font, formatting, and colors on pagesOpen Internet Explorer, select the Tools button and select Internet options. Select the General tab, and then, under Appearance, select Fonts. Select the fonts you want to use, select OK, and then select OK again.

What font does ie use?

For IE >=9 & all other browsers, use woff fonts, as it has the widest support and the best compression, since it was designed specifically for the web.

Why is my Internet Explorer font so small?

To use the Internet Explorer zoom feature press "Ctrl" and "+" to increase the zoom level and "Ctrl" "-" to decrease the level of zoom. To change the default Internet Explorer text size: a) Open the"Page"menu using your mouse or by pressing the "Alt" and "P" keys.


4 Answers

I read a lot of tutorials that suggested hacks, so I came up with this solution I think is better... It seems to work fine.

@font-face {      font-family: MyFont; src: url('myfont.ttf');  } @font-face{      font-family: MyFont_IE; src: url('myfont.eot');  } .my_font{      font-family: MyFont, MyFont_IE, Arial, Helvetica, sans-serif;  } 
like image 132
JD Isaacks Avatar answered Sep 23 '22 03:09

JD Isaacks


If you're still having troubles with this, here's your solution:

http://www.fontsquirrel.com/fontface/generator

It works far better/faster than any other font-generator and also gives an example for you to use.

like image 42
Aart den Braber Avatar answered Sep 22 '22 03:09

Aart den Braber


For IE > 9 you can use the following solution:

@font-face {
    font-family: OpenSansRegular;
    src: url('OpenSansRegular.ttf'), url('OpenSansRegular.eot');
}
like image 22
UbiQue Avatar answered Sep 23 '22 03:09

UbiQue


From http://readableweb.com/mo-bulletproofer-font-face-css-syntax/

Now that web fonts are supported in Firefox 3.5 and 3.6, Internet Explorer, Safari, Opera 10.5, and Chrome, web authors face new questions: How do these implementations differ? What CSS techniques will accommodate all? Firefox developer John Daggett recently posted a little roundup about these issues and the workarounds that are being explored. In response to that post, and in response to, particularly, Paul Irish’s work, I came up with the following @font-face CSS syntax. It’s been tested in all of the above named browsers including IE 8, 7, and 6. So far, so good. The following is a test page that declares the free Droid font as a complete font-family with Regular, Italic, Bold, and Bold Italic. View source for details. Alert: Be aware that Readable Web has released it’s first @font-face related software utility for creating natively compressed EOT files quickly and easily. It has it’s own web site and, in addition to the utility itself, the download package contains helpful documentation, a test font, and an EOT test page. It’s called EOTFAST If you’re working with @font-face, it’s a must-have.

Here’s The Mo’ Bulletproofer Code:

@font-face{ /* for IE */
    font-family:FishyFont;
    src:url(fishy.eot);
}
@font-face { /* for non-IE */
    font-family:FishyFont;
    src:url(http://:/) format("No-IE-404"),url(fishy.ttf) format("truetype");
}
like image 22
RoToRa Avatar answered Sep 23 '22 03:09

RoToRa