Friday, June 27, 2008

Thai font in Firefox 3

A week after Firefox 3 has been released, I notice that I have a Thai language problem with some websites such as mhafai.com, dailygizmo.wordpress.com. I have never tried Firefox 3 until it is final, so I didn't know how to deal with it. I tried to do some configuration but the result didn't meet my expectation. I quickly searched with Google and found a solution. The problem font is called 'Lucida Grande', which is Mac's font, it doesn't display correctly for Thai symbols.


First solution, I found it by configuring somethings in Firefox's Setting. This one will force Firefox 3 to display all web pages according to our chosen font. The following step shows how to do so.


  • In the menu bar click Tools (Alt + T) -> Options...
  • Select Content Tab. Then in fonts & colors region, select Advanced..
  • Finally, uncheck "allow pages to choose their own fonts, instead of my selection above" then OK.
The problem with this solution is that all pages will render with your selected font which in my opinion is not nice.

Second solution, I get this one from the internet[1]. It is very easy, just delete the font from the system and Firefox will use default font for that page.


  • Go to Windows Control Panel -> Fonts
  • Find and Delete "Lucida Grande.ttf" and "Lucida Grande Bold.ttf"


What I don't like about this one is you will not be able to render pages with "Lucida Grande" (oh!, I am quite a perfectionist). It will use default font for instead of "Lucida Grande" in English and Thai.

Final solution, I come up with the solution when I surf internet on Mac OS X with Firefox 3. I noticed that a problem website rendered correctly in Mac. Therefore, "Lucida Grande" font in Mac must differ from Windows. Fortunatly, I had to port fonts from Mac to Windows for my aunt about a month ago and I now know the way how to do that.


  • Copy "LucidaGrande.dfont" in /Systems/Library/Fonts (Mac OS X 10.5) to Windows
  • Convert dfont to ttf. You can use a program like Crossfont[2] which has 15-days trial period.
  • Find and Replace (Copy&Paste) "Lucida Grande.ttf" and "Lucida Grande Bold.ttf" in Control Panel -> Fonts with Mac's Font.
The last solution provide you with correct Thai font display and also preserve rendering "Lucida Grande" in English correctly.

Resources:
[1] - http://www.thaicyberpoint.com/ford/blog/id/520/
[2] - Crossfont

8 comments:

Joseph Okharedia said...

I am so happy that some1 share the same interest as I do. Can you send me a copy of the converted Lucida Grande.ttf(with bold and italics) please ?
my email address is jokharedia2@gmail.com

Unknown said...

http://mobile.thaisecondhand.com/

Other Thai webpages could be viewed perfectly by Fire Fox 3.0

except the link and some others site, would you please give some opinion on this.

I am thinking that the site is not using a conventional fonts rather some kind of font which doesn't generally been supported by FireFox 3.0


Thank you in advance.

Patanachai said...

Heuankeo,
it is a problem with encoding. They must set something wrong in HTML or CSS.

However, I have a simple solution.
View (from menubar) -> Character Encoding -> Thai (TIS-620 or Windows-874)

Brad Cordeiro said...

Thanks so much for this info, I am trying to learn Thai but the fonts on the page I was using were too tiny to even make out!

The setting in Firefox you found works under Ubuntu Linux as well, which is what I'm running.

Anonymous said...

Thanks a lot.. it's very useful !!!

kit said...

That is a great blog post. I have a related problem. I'm learning Thai, and I've been told the best online dictionary is done by the Royal Thai Institute. But I can't get it to display properly in ubuntu.

http://rirs3.royin.go.th/

I even tried using ie4linux, but it still doesn't display properly. Any help is really appreciated.

Patanachai said...

kit,

I tried it on Ubuntu 9.10 and it works fine.
All I do, was change encoding to TIS-620 (view->character encoding->SE&SW asian->TIS-620).

Make sure that you've already installed Thai font in Ubuntu (ttf-thai-tlwg).

kit said...

Hi,

That's fixed it, thank you!
Kit