Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Sunday, September 23, 2012

[CSS] @fontface tools

Auto hinting TTF font with several options (now is better support for GDI ClearType)
http://www.freetype.org/ttfautohint/

ttf to eot (eot format work in IE6, IE7, IE8, Safari 3/4 and Firefox 3.1+)
http://eotfast.com/
EOTFAST-1 myFont.ttf
http://code.google.com/p/ttf2eot/
ttf2eot myFont.ttf

ttf to woff
http://people.mozilla.com/~jkew/woff/
sfnt2woff myFont.ttf

ttf to svg
http://xmlgraphics.apache.org/batik/index.html
java -jar batik-ttf2svg.jar myFont.ttf -l 32 -h 63616 -id MySVGFont -o myFont.svg

Various webfont for your site & webfont generator
http://www.fontsquirrel.com/

[JS] Easy way to detach browser

source code
// browser detection
$('html').removeClass('no-js');
$.each($.browser,function(a,b){
    if(a!='version'){
        if(a=='msie'){
            var v=Math.floor($.browser.version);
            $('html').addClass('ie ie'+v);
            for(var i=v;i<=10;i++)if(v<i)$('html').addClass('lt-ie'+i);
        }
        else $('html').addClass(a);
    }
});​

example (http://jsfiddle.net/NV5k6/)
<!-- before run js -->
<html class="no-js">
<head>....</head>
<body>....</body>
</html>​

<!-- after run js (running on ie8) -->
<html class="ie ie8 lt-ie9 lt-ie10">
<head>....</head>
<body>....</body>
</html>​