Thaana Common Fonts Research

Thaana Common Fonts Research (CFR) is a Thaana related research project I launched late last month and has been running since. Today, I finally got around to writing down some introductory information on the project, so here it is.

Introduction

This project will conduct some basic research into the prevalence and distribution of Thaana fonts.

Purpose

The investigation is aimed at obtaining:
- An understanding of the prevalence of individual Thaana fonts
- An understanding of the co-occurrence dynamics of Thaana fonts
- The distribution of Thaana Unicode and non-Unicode Thaana fonts
- The OS dependence of the fonts

Significance

This study will help us to:
- Get a first look into the distribution of Thaana fonts
- Develop recommendations for the use of fonts on the web
- Develop recommendations for the use of fonts in software and in documents
- Formulate plans for improving the reach of Thaana (and hence, Dhivehi)

Method

The research is conducted via the World Wide Web by sampling the fonts installed on the devices used by Maldivian web users.

The process goes like as follows:
1) A small, invisible Flash-based data collector is embedded into websites.
2) When a user visits a participating website, the data collector automatically compiles a list of the fonts installed on the system. This is done once per user device.
3) The font names and the operating system of the user is sent to my server where the data is logged for later analysis.

It is intended that data sample collection will be carried out until the end of this month (June 2009).

Participate

Webmasters and website owners can participate and contribute to this research by embedding the Flash-based data collector using the HTML code shown below into their website. Please change the DOMAINHERE bit to the domain name of your site so that I know who to chase if there are issues. The field is also used to note your contribution and participation in the project.
<object data="http://labs.jawish.org/cfr/cfr.swf" height="1" width="1" type="application/x-shockwave-flash">
	<param name="flashvars" value="site=DOMAINHERE" />
	<param name="movie" value="http://labs.jawish.org/cfr/cfr.swf" />
</object>


If you operate a high traffic Thaana-based website, I urge you to consider participating and help make this project a success. My thanks in advance!

Statistics

As of writing this post, 2293 data samples has been collected and 269 Thaana fonts have been identified and is being tracked.

You can see LIVE stats on the CFR project home.

Firefox 3 Thaana display bug: review and fixes

Maldivians who use Firefox would be aware that certain Dhivehi websites, such as Miadhu Online, no longer display the Thaana fonts correctly when they switched to the recently released version 3 of the popular browser. I would like to review the issue for the benefit of Maldivian web developers and put forward some solutions that could be used. Further, I would also like to make available a fix that ordinary web users can themselves use until website owners (or the Firefox developers) fix the issue.

Problem description

Firefox 3.x series (and the 2.x series as well, to a lesser extent) fails in correctly displaying Thaana in web pages when certain non-Unicode Thaana fonts are applied to the elements using CSS. The same pages, however, render correctly without issue with Internet Explorer, Safari and Opera.

DOCTYPE - One contributing factor seems to be the DOCTYPE of the page. My guess is that this issue may have something to do with quirksmode rendering or standards compliance. The lack of a DOCTYPE in the markup gives correct rendering of the Thaana fonts on the page. However, omission of the DOCTYPE cannot and should not be considered a solution as DOCTYPE is required for most page markup and browsers need the correct DOCTYPE specification to correctly render modern pages.

Font - Another factor seems to be the font file used. The Thaana characters fail to be rendered correctly when almost all of the commonly used Thaana fonts, such as A_Faseyha, A_Waheed and A_Randhoo, are used. However, some fonts do work without issue - A_Ilham for example.

Here are some demo pages to highlight the issues. Each of the pages has three lines of Thaana - first of which is Thaana text enclosed in a font tag specifying a (problematic) Thaana font, the second is a H3 headline which has the font family set to a (problematic) Thaana font using CSS alone, the third is again a H3 headline which has the font family is set to a (problematic) Thaana font using CSS but has the text placed inside a font tag and finally the fourth line has a H3 headline whose font family is set to a (working) Thaana font using CSS alone.
View Thaana on page with: no DOCTYPE, HTML 4.01 DOCTYPE and XHTML 1.0 DOCTYPE.

Developer's fix

There are two definite solutions that can be easily applied by web developers.

Solution 1: Add HTML Font tags around any and all text that is to be displayed in Thaana. Specify the font to be used within the "face" attribute of the Font tags as usual. The flip-side of this method is that it results in a significant increase in page size. Haveeru News seems to have addressed the problem using this method. Here's a example:
bwlimIhunc aufulunc 

should be transformed into 

bwlimIhunc aufulunc

Solution 2: Change font used in the CSS definition to "A_Ilham". It is, perhaps, not as clean and pretty as "A_Faseyha" but until there is a fix to Firefox it will have to do.

A further alternative solution would be for the site owners and developers to take this occasion to shift to Unicode Thaana. It is much more reliable and is the currently recommended method of displaying Thaana on the web. Jazeera Daily, Haama Daily and MvHeadlines, to name a few, are all using Unicode for text display and entry. You can utilize the PHP-based Thaana Conversions class I released to convert the existing non-Unicode Thaana text to Unicode - and you can do such conversion on-the-fly on page requests.

User's fix

I wrote a quick bookmarklet-based solution several weeks ago for my use after getting annoyed with having to open Internet Explorer to view pages from sites affected by this bug. This solution will, or rather should, work on any affected site and on any computer.

Simply right click on this link - Jaa's Thaana Fix - and select "Bookmark this link" from the drop-down menu. Alternatively, you can drag and drop the link onto your bookmarks toolbar. When you are on a page that is messed up by the bug, such as Miadhu Online, Vaikaradhoo Live or Kavaasaa, click the "Thaana fix" link on your Bookmarks menu or toolbar. You will need to do this for each page you view.

Happy reading :-)