我已经创建了一个html布局并使用css3 @font-face。以下是我的代码
@font-face {
font-family: 'MyriadProRegular';
src: url('myriad.eot');
src: url('myriad.eot?#iefix') format('embedded-opentype'),
url('myriad.woff') format('woff'),
url('myriad.ttf') format('truetype'),
url('myriad.svg#MyriadProRegular') format('svg');
}我正在使用
font-family: 'MyriadProRegular';它可以在所有接受IE浏览器中工作。请帮帮忙。
发布于 2012-06-14 16:21:07
对于这个,我不能推荐Font Squirrel。只要运行他们的Font Face生成器,你就会得到可以在IE中工作的代码。如果你缺少一种字体文件类型,它甚至可以帮你找到它。它在过去为我节省了很多时间,我怎么推荐都不为过。
http://www.fontsquirrel.com/fontface/generator
这是来自Font Squirrel的,可以跨浏览器工作:
@font-face {
font-family: 'NimbusSanConD-Lig';
src: url('fonts/228BFB_1_0.eot');
src: url('fonts/228BFB_1_0.eot?#iefix') format('embedded-opentype'),
url('fonts/228BFB_0_0.woff') format('woff'),
url('fonts/228BFB_0_0.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}发布于 2012-06-14 16:30:56
svg、woff和eot是否支持字体类型?我很确定.svg不是,我从来没有听说过.woff和.eot..只需一个truetype就可以在所有浏览器中工作。(不过我对Macintosh不太确定)
对于我来说,font-face的方式总是有效的:
@font-face {
font-family:alba;
src:url(alba.ttf);
}所以这里没有使用引号。我建议在你的案例中也尝试这样做,
@font-face {
font-family:Myriad Pro Regular;/* note the whitespaces, I believe this is what the font itself is called (not the filename) */
src:url(myriad.ttf);
}一定要注意大小写字母之间的区别!如果在键入Myriad.ttf时字体文件名为myriad.ttf,则它可能在某些浏览器(版本)中不起作用。
https://stackoverflow.com/questions/11029181
复制相似问题