Radheef for Ubiquity

Earlier this week, Mozilla Labs released a very interesting (and useful) new extension for Firefox called "Ubiquity". It basically taps into the services provided by web services to integrate them better into the browsing experience. For an introduction to Ubiquity, it'd be best to read the post on the Mozilla Labs blog where the product was launched - the video featured in the post presents quite impressive practical enhancements to the browsing experience made possible by the product.

Radheef for Ubiquity
Radheef for Ubiquity adds the verb 'bas' to Ubiquity to facilitate quick and easy look up of definitions of Dhivehi words from any Thaana web page using the Radheef. To lookup a word you find on a Thaana web page, you can either select the word and bring up Ubiquity. Alternatively, you can type the word in to the Ubiquity command window. The definition results are shown immediately within the Ubiquity command bubble.

To install this, visit the Radheef for Ubiquity page after Ubiquity is installed and follow the normal verb installation steps.

Screenshots:

In use on a selected word on the Unicode-based Jazeera Daily website


In use on a selected word on the Ascii-based Haveeru Daily website. It offers helpful suggestions if no result is available for query word as-is.


Happy browsing :-)

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 :-)

Javascript Thaana Keyboard version 3.0

I released my Javascript Unicode Keyboard Handler for Thaana early this year as open-source software so that web developers producing Dhivehi websites can allow users to type Thaana straight into text entry fields without forcing them to switch keyboard using the relevant features on the user's computer operating system. The code has since made its way into many different Dhivehi websites. However, the code I released then was mostly as-is from it's original version which I had written back in 2003 which, sadly, means that its behavior could be a little bit unpredictable with certain modern browsers - especially Opera and Safari.

I've now rewritten the code with the intent of producing cleaner, easier-to-use code that works without fail on all modern browsers. This version is (more or less!) guaranteed to work, and has been tested, on Firefox 2+, Opera 9+, Internet Explorer 6+ and Safari 2+ and has also been tested on Windows, Mac and Linux operating systems.

I am a big fan of separating code from design, so in keeping with that ideal this new version uses a more modern way of assigning the Thaana keyboard functionality in favour of inline javascript event handling used by the previous version (look below for an example). Since everything needs a spunky name I've also changed the old name to the more descriptive "Javascript Thaana Keyboard", which future versions of the script will maintain.

As before, it is being released under the MIT License, which allows its use in both personal and commercial applications as long as the copyright and license permission notice remains intact - so what the guy at basfoiy.com has done is a definite no-no.

Usage:

1. Link the file in the HEAD section of the page:


2. For any text input element (i.e INPUTs or TEXTAREAs), assign them the class name "thaanaKeyboardInput". You can assign further classes to the elements without ill-effect, if needed.

3. Using CSS, set any Unicode-compatible Dhivehi font (and size) to be used for the fields. You can easily do that by adding a class definition for the "thaanaKeyboardInput" class or by any other method of your choice.

4. The Thaana functionality would be automatically applied to any elements with the required class name when the page is loaded!

Demo:

Check out the demonstration and testing page here.

Download:

- original full source version (7.34 KB)
- minified version (2.01 KB)
I recommend you use the minified version.

As always, drop a line here if you use it and/or have problems or suggestions. Enjoy. :-)

Update (20-Oct-2008): This version is now superseded by the new and improved v4.0.

Guide to blogging in Dhivehi using WordPress

Here is a short guide to using Thaana to make posts in Dhivehi using the free WordPress blogging service. I regularly get emails from different people asking me for help on this topic, so I hope this is helpful to all such people :-).

The solution presented here can be used on the free Wordpress blogging accounts available from WordPress.com and also on custom installs of WordPress. Please be aware, however, that there are much better ways to setup WordPress for Dhivehi posting if you have a custom install of WordPress or have a paid WordPress account.

Requirements

You need to have the Dhivehi keyboard installed on your computer. If you already type Dhivehi, say using MS Word or OpenOffice, then you have this already. See this post by Fayid if you need help with getting the Dhivehi keyboard installed.

Steps

1. Login to WordPress and click on the "Write" tab to start a new post.


2. In the post editor area, find and click the "HTML" tab to switch the view to HTML mode.


3. Copy and paste the following code into the editing area. It contains the bare minimum HTML/CSS needed to correctly display Dhivehi on all browsers supporting right-to-left text display in Unicode.
Test



4. Tinker around with the font family and font size settings if you know some CSS (or are feeling adventurous enough!). Faruma is probably the most decent Dhivehi Unicode font and is installed on most computers - hence is listed as the first preference. Different people like different font sizes for Dhivehi but 14px and 16px, I think, tend to be the easiest on the eye.

5. Click the "Visual" tab to switch the view back to the normal WYSIWYG mode.


6. Switch the keyboard to "Divehi" on the computer.


7. Select or delete the "Test" text on the post editor and start writing in Dhivehi.


That's all it takes!

Notes:
Unfortunately, there is no way to apply proper formatting to the post title with the free accounts on WordPress so you will have to settle for the out-of-alignment title display.

Video guide:
I thought it'd be fun to make a video guide for this and here is what thus materialized: View good quality | View crap quality (Youtube)

Good luck with the blogging!

Using 4GB SDHC Cards with the TI PCIxx12 Integrated FlashMedia Controller based card readers

I recently bought a 4GB microSDHC card and had serious trouble reading the card using my laptop's built-in card reader under Windows Vista w/ SP1. The card reader had been able to read other cards of less capacity, including a 1GB card, just fine. Looking around on the web made it apparent that a LOT of people had the same issue when attempting to read cards above 2GB. It took a lot of reading through various forum posts on the subject before I finally got it working with the 4GB card.

The built-in card reader in my Acer Aspire 5673WLMi uses the Texas Instruments PCIxx12 Integrated FlashMedia Controller, which is a device found on a lot of laptops of various different models and brands. The latest driver version for the device currently issued by Acer, and most other manufacturers, is versioned 2.0.0.6. The two main solutions proposed on the forums is 1) an install/upgrade of the existing driver manually without using the installer software, and 2) registry hacks that supposedly fix the problem. Neither of these worked for me, though the forums postings indicate these "fixes" worked for many people.

I spent the better part of a day reading and checking various proposed fixes and, in the end, all it took was for the recent version 2.0.0.7B driver found on the HP Customer Care website to be installed...

Anyway, I thought I'd reiterate the solution in case it helps someone else...

Me on Twitter

Twitter is a free microblogging service that has been around for quite a while. I didn't think much of it when it was first launched and never thought it would become as popular as it has become now. It looked (and is, in some ways) like an appropriation of the likes of the "status" field found on Facebook and seemed silly. Nevertheless, I decided to give it a spin a few months ago and ended up finding it suprisingly fun and addictive.

Now, I find Twitter to be an amusing application/service that is more than just a status field - it extends the human. Telephones made the globe small and instant messaging (chat) applications make the world even smaller by keeping people easily in reach and in touch of each other regardless of the physical distance between them. Microblogging and status updates, like that provided by Twitter, I think, take another step to make the world tiny. Almost all of the people that I "follow" on Twitter update their status regularly and I remain aware of (some of) what they are upto and (some of) their thoughts - given that their Tweets are honest, ofcourse!. It is sort of like seeing, hearing or just "knowing" what a group of people are upto even though they are beyond and away from the capacities afforded by my biological sensory organs. It reminds me of the Borg collective conciousness as on Star Trek and the truth maybe just that these are modern day precursors towards such. Maybe that is letting my imagination run a bit wild but I can really see that happening if (and when) the man and machine merge further...

Anyway, coming back to reality, follow me on Twitter if you like... and perhaps join The Collective even.