字体 ttf 文件不适用于 IE

Font ttf file not working with IE

我正在使用网站和 ttf 字体,但出于某种原因,该字体不想在 IE 中工作。

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

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



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



}

有什么想法吗?

简单的播放网站是 Digi notes

某些 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

IE 需要 .eot 字体格式。您可以使用 this 在线转换器

将现有的 .ttf 字体转换为 .eot 格式

对于 IE,您需要使用 .eot 字体格式,因此您需要使用 http://www.fontsquirrel.com/ webfont 生成器之类的转换器将 ttf 文件转换为 eot。

为了跨浏览器兼容性,请使用所有字体格式,而不仅仅是 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;
}

对于一些Chrome字体渲染问题,最好的解决办法是把svg格式放在第一位,因为那样的话你会得到最好的字体渲染效果。