开发者

Custom web fonts

开发者 https://www.devze.com 2023-02-02 19:42 出处:网络
I believe the website http://www.habitat.co.uk/ uses a sys开发者_开发技巧tem of replacing text with canvas elements so that custom fonts can be rendered.

I believe the website http://www.habitat.co.uk/ uses a sys开发者_开发技巧tem of replacing text with canvas elements so that custom fonts can be rendered.

Can anyone help me figure out how they do it?


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.


They are using @font-face, and this is actual css from http://www.habitat.co.uk/

@font-face{
    font-family:'DINHabitatBold';
    src:url('dinhabbd-webfont.eot');
    src:local('?'),url('dinhabbd-webfont.woff') format('woff'),url('dinhabbd-webfont.ttf') format('truetype'),url('dinhabbd-webfont.svg#webfontuqLLqO9I') format('svg');
    font-weight:normal;
    font-style:normal;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消