Hi i used the following CSS code to use a font family other than the one in the control panel of the system, but in vain. Can any one help me whats wrong with the following. <head> <style> @font-face {font-family:myfont; src:url('./fonts/myfont.ttf');} </style> </head> <body> <P style="font-family:myfont;font-size:18pt"></P> </body> thanks in advance, deva
What's wrong? @font-face is MSIE only, and only works with .eot format fonts, not .ttf You can theoretically convert a .ttf to .eot using microsoft's WEFT (Web Embedded Font Tool) In general you should not be attempting to use fonts that aren't on the clients system as it bloats out the page, only works in IE if it works at all, You also should never just list one font in your font-family declaration - ALWAYS include a fallback default font-family should your font not be present - sans-serif, serif, monospace being the best supported. With browser compatability being a total joke, font embedding is a /fail/ not worth wasting the time and effort on.
@font-face Code (markup): is actually a CSS 3 selector, not MSIE only. The W3C specifications would allow for embedded TTF and other font formats if they were implemented in the browsers. The specs have been around for 5 years now. www.w3.org/TR/css3-webfonts/#q23 It doesn't look to me like much is being done in this area by the browser folks but I don't really know. IE has a torqued version using the proprietary font format WEFT (Firefox's Triton engine might handle it in Quirks mode). I do know that it doesn't work in any of my browsers using normal or open source formats in a Strict doctype. I've seen a Rube Goldberg javascript workaround but you're still stuck using a proprietary format that none of the professional font converters can handle.