我已成功使用两种字体的字体声明,它适用于除IE8及以下版本的所有浏览器。我正在使用http://www.fontspring.com/blog/further-hardening-of-the-bulletproof-syntax中的代码。奇怪的是在IE8上,一种字体正在工作而另一种字体不工作。 这是CSS:
@font-face {
font-family: 'FreestyleScriptRegular';
src: url('freescpt.eot'); /* IE9 Compat Modes */
src: url('freescpt.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('freescpt.woff') format('woff'), /* Modern Browsers */
url('freescpt.ttf') format('truetype'), /* Safari, Android, iOS */
url('freescpt.svg#FreestyleScriptRegular') format('svg'); /* Legacy iOS */
}
@font-face {
font-family: 'GillSansMTCondensed';
src:url(Gill_Sans_MT_Condensed.eot);/* IE9 Compat Modes */
src: url('Gill_Sans_MT_Condensed.eot?#iefix') format('embedded-opentype'),
url('Gill_Sans_MT_Condensed.woff') format('woff'),
url('Gill_Sans_MT_Condensed.ttf') format('truetype'),
url('Gill_Sans_MT_Condensed.svg#GillSansMTCondensed') format('svg');
}
FreestyleScriptRegular无法正确渲染,但GillSansMTCondensed是。我已经尝试了我能想到的一切以及我能想到的每一个黑客。我甚至使用不同的应用程序重新生成了相关字体的eot文件,但它没有任何区别。
IE8有什么特别之处可以防止第二种字体工作吗? 有什么想法吗?
由于
答案 0 :(得分:1)
Gill Sans MT字体受版权保护,不允许通过@font-face
使用可下载字体。有些浏览器在技术上强制执行此法律限制。
考虑尝试找一个合适的免费字体,或者是一种可以获得预定用途费用的字体。
答案 1 :(得分:0)
这可能会使您的CSS无法正常呈现:
url('freescpt.ttf') format('truetype'), /* Safari, Android, iOS */
url('freescpt.ttf')和格式之间有一个额外的空格(。尝试删除它,看看会发生什么。不要忘记清空所有缓存。
答案 2 :(得分:0)
只是查看您发布的代码,以下内容没有单引号:
src:url(Gill_Sans_MT_Condensed.eot);/* IE9 Compat Modes */
虽然你的代码在这里:
src: url('freescpt.eot'); /* IE9 Compat Modes */
尝试删除引文,使其读取为:
src: url(freescpt.eot); /*IE9 Compat Modes */
希望这有助于您解决问题。