Thursday, July 9, 2009

Web fonts for open source, a view from Cambodia

World Wide Web Consortium (W3C) has released new version of report about CSS3 show how the font resource load dynamically, that can help user agents to read all contents on WebPages without installing font on their computers.

For English, French, Chinese and many other languages have large speakers; they can recognize the benefit from this method that can keep original layout of contents for user agent to read the webpage. But for the language of small group, there are not in operating system of computer, this report is quite meaningful, an example, for Khmer language in Cambodia.

Embedded OpenType, don’t need to install fonts

Many years ago, webmasters in Cambodia were familiar with the term of “TrueDoc” from Bitstream and Embedded OpenType (EOT) from Microsoft, which can help the user agents, read text on website via loading font from server, without font installation in computer, but it doesn’t work with prominent open source web browser as Mozilla Firefox. Especially, EOT fonts work with Microsoft Internet Explorer only.

Now there is a lot of big website in Khmer language from Cambodia and abroad use EOT font, such as http://www.rfa.org/khmer of Radio Free Asia, http://khmer.radioaustralia.net.au/ of ABC Radio Australia, http://www.rfi.fr/ of Radio French International, http://khmer.ka-set.info/ of Ka-set newspaper, etc…

Also a well-known and old website http://www.everyday.com.kh/ which is interested in teenagers in Cambodia, has also provide Khmer email, use EOT based on legacy font which was created in 1990s. It is favorable for user agents who have MS Internet Explorer, but it still creates difficulties for Firefox web browser’s readers.

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/