Monday, August 31, 2009

Web fonts for Firefox and Safari

According to W3C’s recent report post on their website in June 18, 2009, new term was used and described similar to TrueDoc and Embedded OpenType before, is Web fonts and the way to make them load dynamically from server to user agent’s computer, just upload the font server and add CSS code to webpage. Compare to Embedded OpenType from Microsoft, it is easier, because we don’t need any special tool to convert the font for server.
The fonts for upload to server still keep the original extension, example font.ttf, font.oft or font.svg, etc…

To use a downloadable font call Khmer OS:

@font-face {
font-family: “Khmer OS”;
src: url(http://domainname/font/KhmerOS.ttf);
}
p {font-family: Khmer OS;}

The user agent will download Khmer OS and use it when rendering text within paragraph elements.
p {font-family: Khmer OS, Time New Roman;}

If for some reason the site serving the font is unavailable, the default Time New Roman will be used.
Right now, above CSS works with Firefox and Safari only. We also can add more CSS for Internet Explorer in the same time, after create EOT font by using WEFT of Microsoft.

@font-face {
font-family: “Khmer OS”;
src: url(http://domainname/font/KhmerOS.ttf);
}
@font-face {
font-family: “Khmer OS”;
src: url(KhmerOS.eot);
}
p {font-family: Khmer OS, Time New Roman;}

For more information: http://www.w3.org/TR/2009/WD-css3-fonts-20090618/

Reference: http://khmertype.blogspot.com

No comments: