Web 字体嵌入与 sifr?
我想使用非标准网络字体来改善 HTML 的外观。
嵌入网络字体还是使用 sifr 之类的字体更好?
我的理解是 sifr 是一个基于 flash 的矢量字体查看器,但我一直不愿意尝试它,因为它看起来有点复杂。
关于网络字体嵌入似乎没有太多令人鼓舞的讨论(因为法律问题),所以也许 sifr 更像是执行此操作的标准方法?
对于任何反馈,我们都表示感谢。 谢谢。
I'd like to use a non-standard web font to improve the appearance of my HTML.
Is it preferable to embed a web font or use something like sifr?
My understanding is sifr is a flash-based viewer for vector fonts but I've been reluctant to try it because it seems somewhat complicated.
There does not seem to be a lot of encouraging talk about web font embedding (because of legal issues) so maybe sifr is more of a standard way to do this?
Any feedback would be appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Safari 3.1、即将推出的 Firefox 3.5 和即将推出的 Opera 10 都支持 Web 字体。自 IE4 以来,Internet Explore 就支持(不同的)格式。
此时,在 Safari、Firefox 和 Opera 中实现的最大问题是它们要求您将原始字体文件上传到您的网络服务器。 对于许多字体,这将违反您从字体铸造厂获得的许可。 因此,如果字体铸造厂未授予您使用网络字体的权限,那么目前网络字体并不是合适的解决方案。 但是,有免费许可的字体可用。
这给我们留下了大约三个其他选项:图像、Flash 和基于 JavaScript 的解决方案。 图像通常更受欢迎,因为它们对浏览器怪癖和性能的影响最小,但是 PHP 等中的动态图像生成通常看起来不如其他解决方案好。 您当然可以在 Photoshop 中手动创建图像,但这通常会达不到目的。
sIFR 使用 Flash 来呈现文本,并且非常灵活,您可以选择文本、动态更改文本,并对嵌套 HTML 元素的样式进行一些控制。 赫夫勒 Frere-Jones 已同意 sIFR,前提是您支付服务器许可证费用,并采取一切可能的措施将 sIFR Flash 电影限制在您的域名上。
Cufón 是一个纯粹的 JavaScript 解决方案,它实现了自己的渲染引擎,非常聪明。 目前它的灵活性不如 sIFR,而且其法律问题仍不清楚。
也就是说,图像、sIFR 和 Cufón 都是 hack,我们需要合适的网络字体昨天。
(免责声明:我是 sIFR 的首席开发人员,所以我可能有些偏见。)
Web fonts are supported in Safari 3.1, the upcoming Firefox 3.5 and the upcoming Opera 10. Internet Explore has supported a (different) format since IE4.
At this point, the biggest problems with the implementation in Safari, Firefox and Opera is that they require you to upload the original font file to your web server. For many fonts, this would constitute a violation of the license you received from the type foundry. Therefore, web fonts right now are not an appropriate solution if the type foundry has not given you permission to use them. However, there are freely licensed fonts available.
This leaves us with roughly three other options: images, Flash, and JavaScript-based solutions. Images are often preferable in that they have minimal impact with regards to browser quirks and performance, however dynamic image generation in, say, PHP often does not look as good as other solutions. You could of course manually create images in Photoshop, but that would usually defeat the purpose.
sIFR uses Flash to render the text, and is quite flexible in that you can select the text, change it dynamically, and have some control over the styling of nested HTML elements. Hoefler & Frere-Jones has given sIFR the OK, provided you pay for a server license and take all possible measures in limiting the sIFR Flash movie to your domain name.
Cufón is a purely JavaScript solution that has implemented its own rendering engine, which is insanely clever. At this point its not as flexible as sIFR, and its legal issues are still unclear.
That said, images, sIFR and Cufón are all hacks, and we need proper web fonts yesterday.
(Disclaimer: I'm the lead developer of sIFR, so I might be somewhat biased.)
您还可以考虑 JS 替代方案。 然而,为了获得最佳的跨浏览器兼容性,您最好使用图像,也许还可以使用背景图像和文本缩进 CSS 技巧来用图像替换静态文本。
我上面提到的技术(和其他技术)可以在这里阅读:http ://css-tricks.com/nine-techniques-for-css-image-replacement/
You could also consider the JS alternative(s). However, for best cross browser compatibility you're better off using images and perhaps a background-image and text-indent CSS trick to replace static text with your images.
The technique I mentioned above (and others) can be read here: http://css-tricks.com/nine-techniques-for-css-image-replacement/
需要考虑的事情:
对于每个看到您的“更好看”字体的访问者来说,也有同样多的访问者由于浏览器不兼容或禁用该功能而不会看到您的字体。 拥有正确的字体可能并不是您可以进行的最有价值的设计更改。
从我的移动浏览器编写,该浏览器不支持嵌入字体。
Something to consider:
For every visitor who sees your 'better looking' fonts, there are just as many who won't due to having an incompatible browser or disabling that feature. Having just the right font probably isn't the most valuable design change you could work on.
Written from my mobile browser which doesn't do embedded fonts.
请注意,定义字体嵌入的 CSS3 Web Fonts 模块仍然是工作草案。 事实上,字体嵌入的实际支持并不好。 我觉得最好再等2-3年。
Note that CSS3 Web Fonts module, which defines font embedding is still a Working Draft. Indeed, the practical support of font embedding isn't good. I'd say it's better to wait another 2-3 years.
同样毫无价值的是:TypeKit,该服务为您提供一行 JavaScript 来抽象所有这些。
Also worth nothing: TypeKit, a service that gives you a line of JavaScript to abstract all of this away.