【发布时间】:2014-04-15 15:31:57
【问题描述】:
我有一个使用四种外部字体的网站正在开发中。 Trajan 和 Museo 通过 Typekit 运行良好,但我的另外两个(Marketing Script 和 Socialico)在 IE9-11 和 Firefox 中遇到了问题。我已经尝试了各种路径更改和技巧来让它们显示,但他们坚定不移地不会。
测试站点http://www.wwva.org.php53-14.ord1-1.websitetestlink.com/students(您可能需要全屏才能看到左侧栏中的 Socialico)。
我目前包含一个使用 CSS @import 的辅助样式表。我也尝试在 style.css 文件的顶部直接包含 @font-face 声明,结果相同。 @font-face 声明如下所示(已验证相对路径):
@font-face {
font-family: 'Socialico';
src: url('socialico-webfont.eot'); /* IE9 Compat Modes */
src: local("☺"),
url('socialico-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('socialico-webfont.woff') format('woff'), /* Modern Browsers */
url('socialico-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('socialico-webfont.svg#Socialico') format('svg'); /* Legacy iOS */
}
@font-face {
font-family: 'marketingScript';
src: url('marketingscript-webfont.eot');
src: local("☺"),
url('marketingscript-webfont.eot?#iefix') format('embedded-opentype'),
url('marketingscript-webfont.woff') format('woff'),
url('marketingscript-webfont.ttf') format('truetype'),
url('marketingscript-webfont.svg#marketingScript') format('svg');
font-weight: normal;
font-style: normal;
}
我已经对 StackOverflow 进行了一些挖掘,但我肯定有可能遗漏了什么。我没有对 Firefox 进行任何权限/配置更改,因为这只会在本地解决问题,而一旦网站上线,其他查看者将无法解决。
提前致谢!
【问题讨论】:
-
Socialico 对我来说很好。 (Fx 27.0.1/Win7。)在您使用
marketingScript的页面上找不到任何位置;我假设如果不使用,浏览器不会下载字体。 -
我确实在#flagText(横幅中的大词)上使用了marketingScript。就我而言,很好地抓住了 Socialico 错误。另外,请参阅我对自己问题的回答。我在我的 CSS 中实际调用 marketingScript 时犯了一个简单的语法错误(忘记了逗号)。感谢您花时间研究这个问题——很抱歉浪费您的时间!
标签: css internet-explorer firefox fonts font-face