Archive for April, 2005

Urdu Domain Poll

Friday, April 29th, 2005

We are thinking of getting a separate domain for all the Urdu-related stuff we are doing. This would include the following:

Help us decide on a domain name by voting in the poll at Procrastination.

Commenting Problems

Saturday, April 23rd, 2005

If anyone tried to comment in the last few days, I apologize for your comment not going through. When I upgraded to Movable Type 3.16 recently, I made a mistake so that any commenters were stuck at the “Preview” page and could not submit their comment. I have fixed it now. Comment away.

UrduEditor, An Urdu Notepad

Friday, April 22nd, 2005

This post contains the following sections
Introduction
Using UrduEditor
Where is the on-screen keyboard?
Sending Urdu Emails
Posting to Yahoo and Google Groups
Development
Futher Development
Download
Feedback
References

Introduction
With this post I am presenting you the UrduEditor, a Notepad like application especially tailored for editing Urdu text. You can think of it as a souped-up Notepad, a stripped down Unipad or whatever. After developing the web-based Urdu editor (I will call it Urdu Webpad from now on) I thought of developing a native windows version of a similar utility which I call UrduEditor. Since then I have been working on this idea. The progress has been very slow since I have been extremely busy. I do not have time even to add and test the tiniest of features. There is still a lot of unfinished functionality. I have no choice but to release a version and declare it as beta. I am also providing the source code of the UrduEditor application under GPL. Everybody is encouraged to make changes and add features to the UrduEditor. I am also ready to change the license from GPL to some other license if somebody finds it too restrictive.

Using UrduEditor

The UrduEditor works in a way similar to that of Urdu Webpad. It is also capable of saving and loading Urdu text files. The Urdu text files are stored in UTF-8 format. Although the Urdu text files are plain text files, these are saved with a .uxt extension. This helps in identifying the Urdu text files in the windows file explorer and these also have shell association with the UrduEditor application i.e. double clicking on these files opens these in the UrduEditor application. The UrduEditor can even print, well, sort of. The problem is that the UrduEditor relies on the basic printing functionality of the MFC CEditView class. As a result the print-preview looks horrible and the printing is done left-aligned. I did not delve into the inner workings of the MFC/Windows printing mechanism. One solution would have been to use the CRichEditView class. That also would have meant a major re-write of the application. If there is anybody out there willing to augment the printing functionality of the UrduEditor application, they are most welcome to do it. One interesting feature of the UrduEditor is saving the Urdu text in html format. This html is of very primitive nature i.e. full of font tags and without any style. The reason why I chose this form of html was that I intended to use it for sending Urdu emails and this kind of html is most likely to be correctly displayed by any mail-client supporting html-mail.

At the moment UrduEditor uses the Urdu Naskh Asiatype font with a fixed point size. I will try to release a version soon that will allow selection of other Urdu fonts and point sizes. The keyboard mapping is similar to that of Urdu Webpad, which in turn mimics the keyboard mapping provided in the Inpage Urdu composing software.

I have also customized the Find and Replace dialogs to easily search and replace Urdu text. Figure 1 shows the main UrduEditor application window. Figure 2 illustrates the use of some toolbar buttons in UrduEditor.

Image Hosted by ImageShack.us
Figure 1 : UrduEditor application



Image Hosted by ImageShack.us
Figure 2 : UrduEditor’s Toolbar

Where is the on-screen keyboard?

This is probably the most glaring omission from the current release. I will try to provide an on-screen keyboard soon for aiding in entering Urdu text. Meanwhile the Windows 2000 and Windows XP users can use the on-screen keyboard provided with the standard windows installation.

Sending Urdu Emails

An editor sending emails? Well, why not? I had an idea about sending Urdu emails but was too lazy to develop an extra application for that. I found out that the most feasible way of sending Urdu text based emails is sending it as html-mail. There are arguments about the security concerns when receiving html-mail but I still think that it is indispensable.

I wanted to incorporate html-mail functionality without relying on the Microsoft Outlook’s object libraries. I looked around for a c++ class that could provide a thorough encapsulation of the SMTP-protocol. The best open source class that I found was CPJNSMTPConnection written by P.J. Naughter. In fact the send mail dialog is also stolen from the sample application provided with the above-mentioned class. Figure 3 shows the send mail dialog.

Image Hosted by ImageShack.us
Figure 3 : Send mail dialog

Some configuration is necessary before actually sending mails. As shown in the figure, the mail server name and the port number has to be specified. The mail server can also be a POP-server. I have experimented connecting to an Exchange server and the POP-server provided by the webmail provider www.gmx.de. I have not been able to make it work with Gmail’s POP-server yet. There is an almost infinite number of combinations of the mail-clients and message formats and I have been able to test only a few. The configuration dialog is shown in Figure 4.

Image Hosted by ImageShack.us
Figure 4 : Configuration dialog

I have successfully tested sending Urdu emails to Hotmail, Yahoo and Gmail accounts. Figures 5,6 & 7 respectively show the screenshots of Hotmail, Gmail and Yahoo mail with Urdu mail messages. This text is taken from some article at BBC’s Urdu website.

Image Hosted by ImageShack.us
Figure 5 : Urdu message in Hotmail

Image Hosted by ImageShack.us
Figure 6 : Urdu message in Gmail

Image Hosted by ImageShack.us
Figure 7 : Urdu message in Yahoo Mail

It must be noted that you may or may not be able to freely choose the sender’s email address. For example I was able to specify any sender address I liked when sending email through an Exchange server but I was only able to send email through GMX after I specified my correct GMX-address. It is also interesting to note that when sending Urdu email this way to a Gmail-account, the email is likely to land into the spam-mail folder. Watch out for that!

Posting to Yahoo and Google Groups

One of my goals was to enable the members of Yahoo- and Google-groups to post in Urdu. This is possible by sending html-mails to the groups’ email addresses. The key to participating in a particular discussion is its title which must be specified as the subject of the sent mail. Following are the discussion groups that I set up for my experimentation:

Yahoo UrduProjects Group:
URL: http://groups.yahoo.com/group/urduprojects/
Post message: urduprojects@yahoogroups.com

Image Hosted by ImageShack.us
Figure 8 : Urdu post in Yahoo Group

Google UrduProjects Group:
URL : http://groups-beta.google.com/group/urduprojects
Post message: urduprojects@googlegroups.com

Image Hosted by ImageShack.us
Figure 9 : Urdu post in Google Group

It can be seen from the above images that the Urdu text is displayed better in the Google group. The text in Figures 8 & 9 was copied from a post in Danial’s blog.

Note: If you see garbage instead of Urdu text, change the default encoding of your browser to Unicode (UTF-8).

Development

I have developed the UrduEditor application using MFC and Visual C++ 6.0. I did not use Visual C++.NET because I wanted to avoid unnecessary dependencies that would prevent the program from running on Windows 98 systems. Asif has reported that the programs compiles fine with Visual C++.NET. I may gradually switch to Visual C++.NET for future development. The source code also presents an example of using Unicode with MFC. I have extended the MFC edit controls for editing of the Urdu text. I may at some later point create an MFC extension library useful for developing Urdu based applications.

Further development

A lot of work still remains to be done. I stay committed to the development of following features:

An on screen keyboard for helping in the entry of Urdu text.
Changing fonts and point sizes
More options for different html-templates
Dialog boxes for displaying and copying different types of html outputs
A toolbar for inserting diacritics

The ideas used in the development of the UrduEditor application can also be used in other directions. It is possible to develop a library of ActiveX controls to allow Visual Basic programmers to write Urdu based applications. The keyboard handling in the UrduEditor application can be made generic in order to support multiple keyboard layouts. This would make capable of editing text in local languages e.g. Sindhi, Balochi and Pashto. In fact I am already eying the keyboard layout format used in Unipad. I can accomplish this task only if I get enough support from people having interest in it.

Download

You can download the UrduEditor application and its source code from the following links.

Updated: Dowload UrduEditor with source code

Feedback

Your feedback is essential for the further development and improvement of the UrduEditor application. You can either post a comment on this blog or you can send a post to the above mentioned Yahoo or Google groups for your feedback.

References

  1. CSS and Email, Kissing in a Tree by Mark Wyner, http://www.alistapart.com/articles/cssemail/
  2. HTML Email and Using Style by Elizabeth Davies, http://css-discuss.incutio.com/?page=StyleInEmail
  3. Adding Unicode support to an MFC-generated application in Visual C++ 6.0, http://www.differentpla.net/node/view/135
  4. A helper class for reading, writing and appending to/from Unicode text files by PEK, http://www.codeproject.com/file/textfiledocument.asp

  5. OfficeXP look and feel Owner drawn menu with the Office XP visual style by Jean-Michel LE FOL, http://www.codeproject.com/menu/menuxp2.asp
  6. An MFC class to encapsulate the SMTP protocol http://www.naughter.com/smtp.html
  7. Customizing the Common Find/Replace Dialog by Kalai Kandasamy, http://www.codeproject.com/richedit/customfind.asp
  8. Microsoft Developers Network (MSDN), http://msdn.microsoft.com/library/default.asp

Mac OS X Urdu Keyboard

Thursday, April 7th, 2005

Tom Gewecke left a comment that he has put together an Urdu keyboard for Mac OS X. To download it, go to his webpage and download UrduPC.keylayout.

I don’t have a Mac, so I can’t check it out, but if you have one, try the keyboard out and let Tom know if there are any problems.