CSS: @font-face { font-family: "Graublau Sans Web"; src: url(GraublauWeb.otf) format("opentype"); //Correct path to your font folder } h1 { font-family: Graublau Sans Web, Lucida Grande, sans-serif; } Code (markup): More and other font formats: @font-face { font-family : "ChunkFive"; src : url("ChunkFive.eot"); src : url("chunkFive.svg#chunkFive") format("svg"), url("ChunkFive.ttf") format("truetype"), url("ChunkFive.woff") format("woff"); } h1 { font-family : ChunkFive; } Code (markup): .otf format font, correct use more browsers.
It seems alot more easy than it is. browsers are still converging on what font-format will be universal. 2 formats that are sure shots are : .ttf for mozilla and firefox, and .eot for IE and flock. My routine: 1. I find a font that works. normally its a .ttf font. 2. I use ttf2eot to convert the file : http://code.google.com/p/ttf2eot/downloads/list this leaves me with 2 files. a myFont.ttf and a myFont.eot 3. Move the font files to my web directory 4. Use a script to detect which browser, and output style sheet rules based on which browser. Firefox and Chrome take .ttf, IE and flock take .eot. for the @font-face rule. My browser detection script is php, but this may be done in a few other languages too.
Style sheet, you need to use these technique to use non standard fonts. @font-face { font-family: ‘Tangerine’; font-style: normal; font-weight: bold; src: local(’Tangerine Bold’), local(’Tangerine-Bold’), url(’../font/Tangerine.ttf’) format(’truetype’); } as you seen above that font must be store on your domain or you can give full path of any font. So after add this class on your css you can call “Tangerine†any where and all font changed as per new font style. h1, h2, { font-family: ‘Tangerine’, arial; font-size:40px; } So now your sites all h1, h2 will change.