2012-10-17 42 views
2

我想知道是否有人有这个问题 - @ font-face字体在Chrome中无法正确呈现,有时他们会这样做,有时候不会,这实际上是问题所在,因为我可以跟踪我自己的错误。在其他浏览器中,一切都很好。我使用Icomoon字体及其语法:@ font-face chrome rendering

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

/* Use the following CSS code if you want to use data attributes for inserting your icons */ 
[data-icon]:before { 
    font-family: 'entypo'; 
    content: attr(data-icon); 
    speak: none; 
    font-weight: normal; 
    -webkit-font-smoothing: antialiased; 
} 

/* Use the following CSS code if you want to have a class per icon */ 
[class^="icon-"]:before, [class*=" icon-"]:before { 
    font-family: 'entypo'; 
    font-style: normal; 
    speak: none; 
    font-weight: normal; 
    -webkit-font-smoothing: antialiased; 
    line-height:1; 
} 

的.htaccess中的字体文件夹:

AddType application/vnd.ms-fontobject .eot 
AddType font/ttf .ttf 
AddType font/otf .otf 
AddType application/x-font-woff .woff 

根的.htaccess具有相同的规则。

所以我不知道还有什么可能是错的,正在搞乱我的字体。 非常感谢您的帮助!

+0

您是否找到了解决方案? – Sergio

回答

0

看来chrome在渲染字体方面有一些问题,至少有一些规则,你可以查看这个post了解一些如何改善你的情况的技巧,以及从typekit这个页面了解更好的过程。

再见

+0

我想他可能会提到另一个问题:Icomoon有时不适用于Windows 7上的Chrome。 – djjeck

1

有一个在Windows上的Chrome一个known issue它不会呈现专用使用区域的Unicode字符。

如果您的项目中有text-rendering: optimizeLegibility;,请为图标类设置text-rendering: auto;,并且它们应该在Windows Chrome中呈现。

0

老问题,但同样的问题/错误确实倾向于使用Chrome坚持......

这可能是一些有帮助的。我使用@ font-face指定的字体从Chrome获得空白预览和打印效果,尽管其他浏览器完美运行。

事实证明,当从本地主机,而不是从我的实际服务器提供服务。

希望我尝试了很多很多小时前。