自定义网页字体
我相信网站 http://www.habitat.co.uk/ 使用替换文本系统与画布元素,以便可以呈现自定义字体。
谁能帮我弄清楚他们是如何做到的?
I believe the website http://www.habitat.co.uk/ uses a system of replacing text with canvas elements so that custom fonts can be rendered.
Can anyone help me figure out how they do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看源代码时,您可以看到他们使用 cufon 字体替换来执行此操作。
http://cufon.shoqolate.com/generate/
这是一个很好的教程,可以帮助您入门-> http://net. tutsplus.com/articles/news/the-easiest-way-to-use-any-font-you-wish/
您还有其他方法,例如@font-face,在我看来,它更容易实现。
When looking at the source code you can see they used cufon font replacement to do this.
http://cufon.shoqolate.com/generate/
Here is a good tutorial that will get you started -> http://net.tutsplus.com/articles/news/the-easiest-way-to-use-any-font-you-wish/
You have also other methods like @font-face which in my opinion is much easier to implement.
他们正在使用 @font-face,这是来自 http://www.habitat.co.uk/ 的实际 css
They are using @font-face, and this is actual css from http://www.habitat.co.uk/