Tuesday 2 October 2012

Cross Browser Font Style Using CSS3

Sometimes on our website, we want to use several even more different and particular font that doesn't installed on the operating system. The solution that usually we use for solve that problem is we use static image to display the character which use that font. But after being supported CSS3 by many browser then we could use better option by using inclusion of a particular font on the server side and accessed via css web pages.

So here's the example for call a particular font that stored on the server command with CSS3 :
@font-face {
    font-family: MyFontName;
    src: url("path/to/font.ttf")
}

Next for for, calling that fonts we could do as usual.
.style1 {
    font-family: MyFontName, Arial, Tahoma, Verdana;
}

Note : for internet explorer, font that could be used not TTF (TrueType Font) but use EOT (Embedded OpenType) format. To change font a TTF become an EOT we could use ttf2eot application that provided by google or other application. 

Reference :
  1. http://batikpress.com/2012/02/cross-browser-font-style-menggunakan-css3.html 
Copyright © 2012 Clighter | Powered by Blogger