什么mime类型应该作为WOFF字体?
我服务truetype(ttf)字体as font/truetype和opentype(otf)as font/opentype,但我找不到WOFF字体的正确格式.
我曾尝试font/woff,font/webopen和font/webopentype,但Chrome仍然会抱怨:
"资源被解释为字体,但使用MIME类型application/octet-stream进行传输."
有人知道吗?
这真让我抓狂.
只是在IE9上测试一个网站,发现'live'版本正在渲染一个我使用的小字体,而不是开发版本.
以下是一系列屏幕抓取:

我正在使用Font Squirrel @ font-face工具包.正如您所看到的,在查看本地版本的网站时,Firefox,Chrome甚至IE9都可以.
本地版本和实时版本之间的唯一区别是该字体是从实际站点上的不同域加载的(我已正确设置了跨域策略,如其在Firefox和Chrome上运行的事实所示).
我不记得它在IE8中的样子(微软,再次,没有想到开发人员,已经在IE8的顶部安装了IE9而无法同时运行它们)
该网站位于http://enplanner.com,因此您可以查看来源.
任何有关这方面的帮助将非常感激 - 谢谢你提前.
编辑:我已经删除了IE9并发现它在本地和IE8中看起来完全相同.看来IE8有一个优秀的渲染引擎,比IE9更接近FF/Chrome.这是一个令人沮丧的发现.
让IE 10显示自定义字体绝对没有成功.还有其他人为此解决方案吗?我可以在网上看到一些其他人在IE 10中遇到麻烦的问题,但没有找到解决方案或确认的漏洞.
任何具有相同经验或解决方案的人?
这就是我现在所拥有的,它在10之前的IE,Chrome和Safari中运行良好:
@font-face {
font-family: "LCD";
src: url('http://www.somedomain.xxx/Public/Fonts/Quartz_Regular.ttf');
}
<!--[if IE]>
<style type="text/css">
@font-face {
font-family: "LCD";
src: url('http://www.somedomain.xxx/Public/Fonts/Quartz_Regular.eot');
}
</style>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
我试图用其他格式woff,ott等替换字体文件,但没有运气.
暗示font-squirrel的答案使其成功.现在工作标记(对于IE 10)是:
@font-face {
font-family: "LCD";
src: url('/Public/Fonts/quartz_regular-webfont.eot');
src: url('/Public/Fonts/quartz_regular-webfont.eot?#iefix') format('embedded-opentype'),
url('/Public/Fonts/quartz_regular-webfont.woff') format('woff'),
url('/Public/Fonts/quartz_regular-webfont.ttf') format('truetype'),
url('/Public/Fonts/quartz_regular-webfont.svg#quartzregular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud) 我设法使用自定义字体,该字体适用于每个值得称为"浏览器"的浏览器.以及一如既往的酷的东西并不适用于IE浏览器(在这种情况下,IE9).
我尝试了以下方法:
@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');}
Run Code Online (Sandbox Code Playgroud)
经过一些提示,我在google上找到了这个,我尝试过:
@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');
src: url('../fonts/roboto/Roboto-Regular.ttf#') format('truetype');
font-weight: normal;
font-style: normal;}
Run Code Online (Sandbox Code Playgroud)
仍然没有成功.正如我所知,根据经验,这个问题不会有"好"的解决办法,但也许有人发现另一个坏的,即黑客让我脱离另一个即痛苦.
我有以下代码来为我的页面设置字体样式,但不知何故@ font-face在mozilla中工作但在IE中没有.有谁知道这里发生了什么,我该如何解决这个问题?
@font-face {
font-family: 'TrashHand';
src: url('../fonts/TrashHand.ttf');
}
@font-face {
font-family: 'BebasNeue';
src: url('../fonts/BebasNeue.otf');
}
.tab_g
{
background:url(../images/ss_tab_0.png) no-repeat;
width:176px;
height:42px;
font: 25px 'TrashHand',Arial, Helvetica, sans-serif;
font-weight:50;
text-transform:uppercase;
color:#ffffff;
padding-top:10px;
text-align:center;
margin-bottom:-15px;
}
Run Code Online (Sandbox Code Playgroud) 在网站上http://hanling.focusww.com
与Firefox,Chrome或Safari相比,h2标记中的标题文本在IE 9中非常庞大。
我正在寻找解决此问题的建议。
这是一个WordPress站点。
(此帖子是从Wordpress Stack交易所迁移的)
建议的答案:如果您要迁移,请检查此内容以获得可能的答案。
似乎IE9并非在所有字体上都能很好地发挥作用,因此您可能希望为IE9提供自己的字体以进行阅读,请参见此处https://github.com/twitter/bootstrap/issues/3116,此处@ font-face在IE8中有效,但不能IE9
似乎是字体粗细问题
回应:我们没有嵌入任何字体。