我需要在html文件中包含一个字体(OpenSymbol),并且字体文件在本地文件夹中(我知道它的确切的绝对路径).如果我这样使用@ font-face:
@font-face {
font-family: "OpenSymbol";
src: url("/OpenSymbol.ttf") format("truetype");
}
它适用于Chrome,Opera和Safari,但不能在Firefox中都是IE9.其他@ font-face使用在所有浏览器中都能完美地运行.
Btw,在Chrome中,我发出警告:
Resource interpreted as Font but transferred with MIME type application/octet-stream
我可以做些什么来干净地包括一个本地存储的字体,这个字体是不是安装在操作系统上?
编辑:
我发现不同网址的列表似乎不起作用!如果我将[…] .ttf网址放在第一位,Chrome会加载字体,但如果它在别的地方,则加载字体
第二编辑:
我得到它除了firefox以外的所有浏览器工作:
@font-face {
font-family: 'OpenSymbol';
src: url('file:/openSymbol.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'OpenSymbolEOT';
src: url('file:/openSymbol.eot') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
...
接着
.element {
font-family: OpenType, OpenTypeEOT, [...];
}
无论如何,它在IE中工作,但不在eclipse中,它使用IE的渲染引擎… o.O
Btw,firefox有问题,因为安全问题:See here