@font-face 现在可以使用吗?
我必须在项目中使用精美的字体,但我真的很想避免 sifr 和其他丑陋的替代品,所以我正在考虑@font-face。
然而,我真的很困惑几个博客/网站对其可用性提供了不同的看法。准备好了吗?现在哪些浏览器支持它?
谢谢
I have to use a fancy font in a project but I'd really like to avoid sifr and other ugly alternatives so I'm looking at @font-face.
However, I'm really confused with several blog/sites offering different views on its usability. Is is ready yet? Which browsers support it today?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在几乎每个浏览器都实现了它。唯一真正的问题是 Internet Explorer 需要其自己的 OTF 格式的字体文件,并且无法理解 TTF 格式。许多提供与 @font-face 一起使用的字体的网站都会为您提供两种格式以及它们在 Internet Explorer 和其他浏览器中显示所需的 CSS。
查看 http://www.fontsquirrel.com/,了解免费字体库的一个很好的示例附带预制的 @font-face 下载(文件格式和相关 CSS)。
Just about every browser implements it now. The only real catch is that Internet Explorer requires font files in its own OTF format and will not understand TTF format. Many sites that provide fonts for use with @font-face will provide you with both formats and the CSS necessary for them to display in both Internet Explorer and other browsers.
Take a look at http://www.fontsquirrel.com/ for a good example of a free library of fonts that come with pre-made @font-face downloads (both file formats and the relevant CSS.)
Paul Irish 概述了 @font-face 的当前状态。这是一个幻灯片和在波士顿举行的一次小型聚会回顾这一切:
http://paulirish.com/squeeze/
http://www.ustream.tv/recorded/4828154
快速回答是 95% A+ 浏览器使用它(FF 3.0 是例外)。许可可能很棘手,但有几个工具可以提供帮助,例如 FontSquirrel、FontDeck 和 FontSpring。
实现过程中最困难的部分可能是处理加载时出现 FOUT(“无样式文本闪烁”)的 Firefox,尽管有多种解决方法,包括:
http://paulirish.com/2009/fighting-the-font-face-fout/
http://inspiringpixel.com/articles/web-design/fight-the-fout/240/
http://www.stevesouders.com/博客/2009/10/13/font-face-and-performance/
Paul Irish has outlined the current state of @font-face. Here's a slideshow and a small gathering in Boston reviewing it all:
http://paulirish.com/squeeze/
http://www.ustream.tv/recorded/4828154
The quick answer is 95% of A+ browsers utilize it (FF 3.0 is the exception). Licensing can be tricky, but several tools are of aid, such as FontSquirrel, FontDeck, and FontSpring.
Probably the hardest part of implementation is dealing with Firefox which has a FOUT ("flash of unstyled text") on load, though there are several workarounds, including:
http://paulirish.com/2009/fighting-the-font-face-fout/
http://inspiringpixel.com/articles/web-design/fight-the-fout/240/
http://www.stevesouders.com/blog/2009/10/13/font-face-and-performance/