为什么一个字体可以在IE中使用,而另一个字体却不能?

3

HTML

<span style="font-family: 'blackjackregular'; font-size: 18pt;">My</span>
<span style="font-family: 'trajanpro'; font-size: 14pt;">WEST</span>

字体CSS:

@font-face {
    font-family: 'trajanpro';
    src: url('trajanpro-regular.eot');
    src: url('trajanpro-regular.eot?#iefix') format('embedded-opentype'),
         url('trajanpro-regular.woff') format('woff'),
         url('trajanpro-regular.ttf') format('truetype'),
         url('trajanpro-regular.svg#trajanpro_regular') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'blackjackregular';
    src: url('blackjar-webfont.eot');
    src: url('blackjar-webfont.eot?#iefix') format('embedded-opentype'),
         url('blackjar-webfont.woff') format('woff'),
         url('blackjar-webfont.ttf') format('truetype'),
         url('blackjar-webfont.svg#blackjackregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

IE显示:

enter image description here

FF和Chrome显示:

enter image description here

如你所见,无论在IE还是其他浏览器中,MY都是正确的,但为什么WEST在IE中不改变字体呢?


IE 的哪个版本? - enguerranws
问题是关于两种字体,其中一种可以使用而另一种不能,但并没有提供任何有关这两种字体的实际信息,只提供了您在CSS中分配给它们的名称。 - Jukka K. Korpela
1
同意,但在描述中我给出了代码,并解释了哪些是可用的,哪些不可用。 - SearchForKnowledge
2个回答

3
Trajan Pro是Adobe的专有字体,可能没有嵌入为web字体的许可证。使用@font-face嵌入它可能会违反最终用户许可协议(EULA)。要使用它,您需要使用像Typekit这样的服务。请在此处查看详细信息:https://typekit.com/fonts/trajan-pro-3 编辑:
经过更深入的挖掘,这里有一个有趣的链接,指出IE在EOT文件中实现了限制字体使用的标志。其他浏览器不实现此功能,或计划实现,因此行为上存在差异。

1
你是在说Chrome忽略了许可证,但IE没有吗? - Erik Funkenbusch
我有这种感觉,因为在一个网站上尝试转换时它不允许我,但另一个网站却可以。 - SearchForKnowledge
1
它可能违反了某些法律,但问题是:为什么它在其他浏览器中可以工作而在IE中不能? - enguerranws
正是我的问题。也许IE8有更好的许可证检查? - SearchForKnowledge
4
请参考此处链接:http://blog.themeforest.net/general/font-licensing-for-the-web/ 。引文如下:“微软使用.eot字体格式(嵌入式开放类型)来解决这个问题。EOT应该尊重字体文件中的嵌入标志,并且可以限制到特定的域名。然而,非IE浏览器并没有采用这项技术,也没有计划这样做。” - Jacek Glen
哦哦哦...好吧,我确实有这个字体的许可证,因为它是购买的,但似乎不适用于网络字体。感谢信息。已点赞并接受。 - SearchForKnowledge

2

据Jacek Glen所说,似乎是IE应用了字体上的EOT标志,而其他浏览器没有。

你应该寻找Trajan的免费替代品,比如Cinzel:http://www.google.com/fonts/specimen/Cinzel

我不确定,但可以试一下:

@font-face {
font-family: 'trajanpro';

src: url('trajanpro-regular.eot?#iefix') format('embedded-opentype'),
     url('trajanpro-regular.woff') format('woff'),
     url('trajanpro-regular.ttf') format('truetype'),
     url('trajanpro-regular.svg#trajanpro_regular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'blackjackregular';

src: url('blackjar-webfont.eot?#iefix') format('embedded-opentype'),
     url('blackjar-webfont.woff') format('woff'),
     url('blackjar-webfont.ttf') format('truetype'),
     url('blackjar-webfont.svg#blackjackregular') format('svg');
font-weight: normal;
font-style: normal;
}

我刚刚删除了第一个"src"属性,因为它不应该被重复指定。不知道为什么这对"My"有效而对"west"无效...


谢谢你的回答,但那并没有解决问题。我为你的尝试点了赞 :) - SearchForKnowledge
1
你应该寻找类似Trajan的免费字体,比如Cinzel: http://www.google.com/fonts/specimen/Cinzel - enguerranws
谢谢。不完全一样:/ - SearchForKnowledge
1
寻找另一个等价物吧,但我认为你无法让Trajan在IE8中工作(因为涉及法律问题 :)) - enguerranws
很不幸,我将不得不这样做。 - SearchForKnowledge

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接