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

问题描述 投票:1回答:3

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

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

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



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



}

有任何想法吗?

简单的游戏网站是Digi notes

css asp.net-mvc-4 fonts font-face
3个回答
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
投票

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


0
投票

对于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格式放在第一个位置,因为在这种情况下,您将获得最佳的字体渲染结果。

© www.soinside.com 2019 - 2024. All rights reserved.