字体ttf文件无法与IE一起使用

时间:2016-05-19 20:50:48

标签: css asp.net-mvc-4 fonts font-face

我正在玩一个网站和ttf字体,但是因为某些原因,字体不想在IE中工作。

css很简单,它适用于chrome,但不适用于IE。

@font-face 
{
font-family: 'CAROBTN';



src: url('fonts/CAROBTN_.ttf');



}

有什么想法吗?

简单的游戏网站是 Digi notes

3 个答案:

答案 0 :(得分:4)

有些IE版本与ttf不兼容,请看这里:

What is the status of TTF support in Internet Explorer?

您可能需要一个.eot后备:

@font-face 
{
font-family: 'CAROBTN';

src: url('fonts/CAROBTN_.ttf'),
     url('fonts/CAROBTN_.eot');

}

您可以在此处转换字体文件:https://www.fontsquirrel.com/tools/webfont-generator

答案 1 :(得分:1)

IE需要.eot字体格式。您可以使用this在线转换器将现有的.ttf字体转换为.eot格式

答案 2 :(得分:0)

For IE you need to use .eot font format, so you need to convert your ttf file to eot, with a converter like http://www.fontsquirrel.com/ webfont generator.

For Cross-browser compatibility use all the font formats not just ttf.

@font-face {
    font-family: 'Example Font';
    src: url('fonts/Example-font.eot');
    src: url('fonts/Example-font.eot?#iefix') format('eot'),
         url('fonts/Example-font.woff') format('woff'),
         url('fonts/Example-font.ttf') format('truetype'),
         url('fonts/Example-font.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

And for some Chrome font rendering issue, the best solution is to put the svg format at the first position, because in that case the you get the best font rendering result.