2012-03-09 87 views
8

我下载了一些otf字体,然后将它们转换为eot使用:https://onlinefontconverter.com但是当我在IE8中查看网站时,字体不显示(它们显示在Chrome,Firefox,Opera和Android中)。我的代码或eot一定有问题。有谁知道什么是错的?为什么IE8不能加载我的eot文件?

(这里下载的Roboto:http://www.fontsquirrel.com/fonts/roboto

(在这里将它转换:https://onlinefontconverter.com

styles.css的

@font-face 
{ 
    font-family: RobotoCondensed; 
    src: url("Roboto-Condensed.eot"); 
} 

@font-face 
{ 
    font-family: RobotoCondensed; 
    src: url("Roboto-Condensed.ttf"); 
} 

.myDiv 
{ 
    font-family: RobotoCondensed, Arial, Helvetica; 
    font-size: 10px; 
    color: #e8e8e8; 
} 

的index.html(相关代码)

<div class="myDiv">Some font in here that shows incorrectly as Arial!</div> 

样式表和字体位于同一个文件夹中。

+0

为什么没有'FONT-FAMILY =的Roboto-Condensed'? – elclanrs 2012-03-09 02:06:11

+0

你可以任意命名。 – 2012-03-09 02:13:55

+4

您是否尝试过在字体松鼠中使用字体生成器? http://www.fontsquirrel.com/fontface/generator - 为您提供所有浏览器所需的所有字体和CSS。 – 2012-03-09 04:42:15

回答

4

感谢所有帮助。看起来问题是字体转换器。 eot文件不被IE识别为有效。感谢“乔尔Eckroth”建议我尝试其他转换器。

3

试试这个

 @font-face 
    { 
     font-family: 'RobotoCondensed'; 
     src: url('Roboto-Condensed.eot'); 
    src: url('Roboto-Condensed.eot?#iefix') format('embedded-opentype'), 
     url('Roboto-Condensed.woff') format('woff'), 
     url('Roboto-Condensed.ttf') format('truetype'), 
     url('Roboto-Condensed.svg#') format('svg'); 

} 

    .myDiv 
    { 
     font-family: RobotoCondensed, Arial, Helvetica; 
     font-size: 10px; 
     color: #e8e8e8; 
    } 
0

尝试

font-family: "RobotoCondensed", Arial, Helvetica; 

的报价应该强迫它作为您的第一选择

+4

不可以。不论您是否使用引号,对选择哪种字体都无任何影响。引号可以帮助解析器(和随机阅读器)确定字体名称的准确性,但是一旦解析了名称,它们的使用方式就没有什么区别。 – 2012-03-09 07:48:26

+0

此外,这是一个IE问题的家伙....和IE不玩对... grrr – SamStar 2012-03-09 14:34:53

1

我有一个问题,没有扭捏和网络研究的量有助于
直到我编辑标签包括

 

<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
</head>


的meta标签解决的问题,每变异工作!

变化1

 

<style type="text/css">
@font-face
{
font-family: 'SolaimanLipi';
src: url('SolaimanLipi.eot');
src: local('SolaimanLipi'),url('SolaimanLipi.ttf') format('truetype');
}
@font-face
{
font-family: 'Yogesh';
src: url('CDACOTYGN.eot');
src: url('CDACOTYGN.ttf') format('truetype');
}
</style>


变化2

 

<style type="text/css">
@font-face{
font-family: 'solaimanlipi';
src: url('cdacotygn-webfont.eot');
src: url('cdacotygn-webfont?#iefix') format('embedded-opentype'),
url('solaimanlipi-webfont.woff') format('woff'),
url('solaimanlipi-webfont.ttf') format('truetype'),
url('solaimanlipi-webfont.svg#webfont') format('svg');
}
@font-face {
font-family: 'cdacotygn';
src: url('cdacotygn-webfont.eot');
src: url('cdacotygn-webfont.eot?#iefix') format('embedded-opentype'),
url('cdacotygn-webfont.woff') format('woff'),
url('cdacotygn-webfont.ttf') format('truetype'),
url('cdacotygn-webfont.svg#svgFontName') format('svg');
}
</style>

我们认为,复杂的,但往往是大海捞针在别处标签

你可以试试,并查看源
http://www.weloveseppa.com/jnc/jncTryBangla.html
http://www.weloveseppa.com/jnc/try1/jncTryBangla.html

作品在所有的浏览器,包括旧IE8

相关问题