Archive for October, 2005

Digital Urdu Library ڈیجیٹل اردو لائبریری

Sunday, October 30th, 2005

Dear friends,

AssalamOAlaikum. As you all know, we at urduweb.org are striving to promote Urdu on the net. Our aim is to provide a common platform to the Urdu community for doing collaborative efforts for promoting Urdu and we do need a combined effort to achieve our goals. Recently there has been a discussion on the Urdu Mehfil Forum about creating an online libray in the style of Project Gutenberg and work has actually started on this. Our friend Mohammad Shakir Aziz is coordinating this project. In the following, Mr Shakir explains the need and aims of this project and invites you to join this effort.

عزیز دوستو، السلام علیکم

جیسا کہ آپ سب جانتے ہیں، اردو ویب انٹرنیٹ پر اردو کی ترویج کے لیے کوشاں ہے۔ ہماری یہ کوشش ہے کہ اردو ویب کی صورت میں ہم اردو کمیونٹی کو اردو کی ترویج کے سلسلے میں مشترکہ کاوشوں کے لیے ایک مشترکہ پلیٹ فارم فراہم کر دیں اور یہ کام ہم سب مل جل کر ہی سر انجام دے سکتے ہیں۔ حال ہی میں اردو محفل فورم پر پراجیکٹ گٹن برگ کی طرز پر انٹرنیٹ پر ڈیجیٹل لائبریری تشکیل دینے کے بارے میں تجاویز پیش کی گئی اور اس سلسلے میں باقاعدہ کام شروع کر دیا گیا ہے۔ ہمارے دوست محمد شاکر عزیز اس پراجیکٹ کی کوآرڈینیشن کی ذم داری سنبھالے ہوئے ہیں۔ ذیل کی تحریر میں شاکر اس پراجیکٹ کے اغراض و مقاصد کے بارے بیان کر رہے ہیں تاکہ آپ بھی اردو کی ترویج کےاس کام میں شریک ہوں۔
—————————————————————————————————————————-

اردو ہم جس کو کہتے ہیں داغ
سارے جہاں میں دھوم ہماری زباں کی ہے
اردو اور سائنس آجکل اردو کے چاہنے والوں کا پسندیدہ موضوع ہے۔ کچھ کریں یا نہ کریں مگر یہ ضرور کہیں گے کہ ہر چیز اردو میں ہو۔ استعمال چاہیں نہ کریں ۔ کمپیوٹر بھی سائنس میں شمار کیا جاتا ہے ۔ زندگی میں کمپیوٹر کے عمل دخل نے جہاں ہمیں اور پہلوؤں سے متاثر کیا ہے وہاں ہماری زباندانی پر بھی اثرات اور بڑے بد اثرات چھوڑے ہیں ۔ اس کی مثال یہ لے سکتے ہیں کہ رومن میں چیٹ کر کر کے اب میرا یہ حال ہو گیا ہے کہ بعض اوقات شبہ ہونے لگتا ہے کہ شاید اردو میں لکھے اس لفظ کے ہجے ٹھیک نہیں حالانکہ ٹھیک ہوتے ہیں ۔ بات چلی تو عرض کرتا چلوں اردو کا ہاتھ سے لکھنا بھی چونکہ تقریبا عنقا ہوتا ہے، بعد از میٹرک تو اس کا حال بھی برا ہے۔ اس بات کا انکشاف ہم پر اس وقت ہوا جب بی کام پارٹ ون کا اسلامیات کا پرچہ دے رہے تھے اور کسی سے لکھا نہیں جا رہا تھا اردو لکھنے کی عادت نہیں تھی ہاتھوں کو پچھلے ٣ سالوں سےتو کیا خاک لکھا جاتا نتیجتًا تمام لڑکے پرچہ دینے کے بعد دیر تک ہاتھ اور بازو ملتے رہے کہ درد ہو رہا تھا۔

خیر یہ تو بات سے بات تھی۔ ذکر ہو رہا تھا کمپیوٹر میں اردو کا ۔ کمپیوٹر کی بات ہو اور انٹرنیٹ کی نہ ہو یہ تو ہو ہی نہیں سکتا۔ اردو کا نام بھی کمپیوٹر کے لیے حرام تھا چند سال پہلے تک مگر اب کچھ نئی تکنیکوں اور کچھ ٹوٹکوں نے کمپیوٹر پر اردو لکھنا اردو پڑہنا ممکن بنا دیا ہے۔ جب یہ سب ہو گیا تو اردو کے چاہنے والوں کو ہوش آیا کہ اب انٹرنیٹ پر بھی بس ہر طرف اردو ہی اردو کر دیں ۔ اسی سلسلے کی ایک کڑی کے طور پر اردو ویب آرگ کا قیام عمل میں آیا ۔ جہاں سے ناچیز کے اصرار پر ایک پراجیکٹ یا منصوبہ بسلسلہ اردو ای بکس شروع کیا گیا۔

اگرچہ ابھی ابتدائی مراحل میں ہے اور انتہائی نگہداشت کے وارڈ میں داخل مریض کی طرح اس کی حالت نازک ہے مگر امید ہے کہ بہتری ہوگی۔ اردو ای بکس یوں تو موجود ہیں انٹرنیٹ پر مگر یہ سب تصویری اردو میں ہیں تحریری اردو میں نہیں ۔ تصویری اردو وقتی حل ہے مستقل حل نہیں چناچہ یہ منصوبہ جو اردو محفل کے اراکین کی طرف سے ترقی پذیر ہے میں اس بات کو یقینی بنایا جائے گا کہ اردو کی کتابیں مہیا کی جائیں جو:
1۔تحریری اردو میں ہوں
2۔مفت اور ہر ایک کے لیے ہوں
3۔ خصوصًا اردو کی کلاسیکل کتابیں جن کے نایاب ہونے کا خدشہ ہے یا کم ملتی ہیں یا انھیں اردو میں ایک مقام حاصل ہےاور صاحبان ذوق ان کو سینت سینت کر رکھنا پسند کرتے ہیں۔
4۔اسلامی کتابیں جیسے قرآن بہ ترجمہ و تفسیرقرآن،احادیث کی کتب،سیرت نبی اکرم صلی اللہ علیہ وسلم پر کتب، صحابہ کرام رضوان اللہ علیھم اجمعین کی سیرت وغیرہ۔
5۔اردو کی لغات جن سے اردو داں طبقے میں اردو کی صلاحیت بڑھے۔
6۔ایسی کتابیں جن کی کاپی رائٹ نہ ہو یہ ختم ہو گیا ہو ہو یا متعلقہ ادارہ انکی آن لائن اشاعت کی اجازت دے دے۔

اس سلسلے میں ہمیں ہرممکن تعاون درکار ہے ہم فی الحال علمی تعاون مانگ رہے ہیں۔ اگر:
1۔ آپ کے پاس کوئی کتاب ان پیچ یا کسی بھی اردو اڈیٹر میں لکھی ہوئی موجود ہے، آپ اپنی غیر مطبوعہ تحاریر(بشرطیکہ معیار پر پوری اتریں ) یا اپنی یا اپنے ادارہ کی کسی کتاب کا کاپی رائٹ دے سکتے ہوں۔
2۔آپ کچھ وقت نکال کے ہمارے ساتھ اس کام میں ہاتھ بٹا سکتے ہوں لکھنے کے سلسلے میں(اور انشاءاللہ مستقبل قریب میں تحاریر کی پروف ریڈنگ کے سلسلے میں جب کام کی رفتار زیادہ ہوگی)
3۔آپ اس کام کو آگے بڑھانے کے سلسلے میں ہمیں کوئی مفید مشورہ دینا چاہتے ہوں کوئی تکنیکی بات جس سے اس منصوبے کو نکھارنے میں مدد ملے۔
4۔اس کے علاوہ کوئی بھی ایسی بات، کوئی تعاون جو آپ کے خیال میں اس سلسلے میں مفید ثابت ہو سکتا ہو
اگر ہمیں فراہم کریں گے ہم بصد شکریہ اسے قبول کریں گے اور اسے آپکے نام کے ساتھ اپنے منصوبے میں شامل کریں گے۔ اس صدقہ جاریہ کا صلہ تو اللہ ہی دے سکتا ہے مگر دنیا میں جو خوشی اس سے آپ کو اور اردو کے چاہنے والوں کو ملے گی اس کا کوئی بدل نہیں ہوسکتا ۔
اللہ کریم ہمیں توفیق دے ۔
خیر اندیش
www.urduweb.org کی جانب سے‘دوست‘

صرف اردو سیارہ

Sunday, October 23rd, 2005

اردو سیارہ پر اب صرف اردو میں لکھی ہوئی پوسٹس آئیں گی۔ اردو بلاگرز کی انگریزی پوسٹس اس میں سے نکال دی جاتی ہیں۔

Urdu WebPad Reloaded, Urdu OpenPad

Monday, October 17th, 2005

I wrote Urdu WebPad earlier this year, which is effectively an open source version of the Urdu Pad from urdulife.com. This is a web-based editor that allows the editing of Urdu text without the need of installing Urdu keyboard and language support on the computer. It works with Internet Explorer and FireFox. Urdu WebPad is fairly easy to integrate in web applications . The first Unicode Urdu forum Urdu Mehfil is a well-known example of the use of Urdu WebPad. The keyboard mapping provided by Urdu WebPad is that of the Phonetic Urdu keyboard. An on screen keyboard assists in entering Urdu text.

I have been thinking about incorporating multiple keyboard layouts in Urdu WebPad. Such a feature would benefit those accustomed to other keyboard layouts as well as other local languages such as Pashto and Sindhi. I got the inspiration for this idea from Unipad. This feature has to be accompanied by an on-screen keyboard which would reflect the currently selected keyboard layout. The result of the this work is Urdu OpenPad. The word OpenPad hints at the openness of the editor. It is now possible to incorporate custom keyboard layouts for web-based editing.

Unipad Keyboard Definitions

Unipad supports multiple keyboard layouts and it allows the definition of custom keyboard layouts. Figure 1 shows the virtual keyboard layout used by Unipad. The details of how to define a new keyboard layout in Unipad can be found here. As can be seen there, Unipad used a four state keyboard i.e. normal, shift, Alt Gr and shift+Alt Gr states. Alt Gr key is found on some non-English keyboards and it is equivalent to the Ctrl+Alt key combination.


Figure 1 – Virtual key map used by Unipad

OpenPad Keyboard Definitions

I have decided to implement a three-state keyboard mapping i.e. normal, shift and Alt Gr states. This should be sufficient in most of the cases. I had to implement Alt Gr differently for Internet Explorer and FireFox because of the different ways handling of shift keys in these browsers. Alt Gr is equivalent to Ctrl+Alt in Internet Explorer and to Crtl+Shift in FireFox for Urdu OpenPad users.

Defining and adding a new keyboard mapping is very easy in Urdu OpenPad. All you have to do is to create an array of Key type objects. An object of type Key contains a single key mapping. It should contain at least the information about the normal key state and it can contain up to three key states. Following is the syntax of defining a key mapping.

Mapping[KeyCharacter]=new Key(x, [y], [z]);

Where;
x:= Normal key state
y:= Shift key state
z:= Alt Gr key state

The following shows a section of the Urdu Phonetic key-mapping included in Urdu OpenPad:

var UrduPhonetic= new Array(); UrduPhonetic['a']=new Key(0x0627, 0x0622); UrduPhonetic['b']=new Key(0x0628, 0x0628); UrduPhonetic['c']=new Key(0x0686, 0x062B); . .

Having completed the keyboard-mapping, it then has to be added to the list of available keyboard layouts inside the InitUrduEditor function as shown in the flowing:

KeyMaps["UrduPhonetic"]=UrduPhonetic;

All that remains is to set the current keyboard layout used in the editor with the following function call:

setKeymap("UrduPhonetic");

I am including three keyboard mappings, one each for Urdu Phoentic, Sindhi and Pashto. I used the Unipad keyboard mappings of Sindhi and Pashto.

On-Screen Keyboard

I have tried to model Window’s on-screen keyboard as closely as possible. Its display changes to reflect the shift keys pressed. The user can also click directly on the Shift or the AlrGr key. In that event, the on-screen keyboard remains in that state until the user clicks another button or presses some key. A small bar above the on-screen keyboard shows the help. I have used the Tahoma font for displaying characters in on-screen keyboard because it contains support for most of the languages based on the Arabic script. There may be mistakes in the on-screen display as well as in the implementation of the key mappings of Sindhi or Pashto. Unfortunately I cannot check this since I am not conversant with either of these languages. I hope, however, that soon Sindhi and Pashto speaking brothers and sisters will pounce onto these mistakes and inform me about these. Following figures show the keyboard layouts that come with Urdu OpenPad.


Figure 2 – Normal Urdu Phonetic Keyboard


Figure 3 – Shift State of Urdu Phonetic Keyboard


Figure 4 – Normal Sindhi Keyboard


Figure 5- Shift State of Sindhi Keyboard


Figure 6- Normal Pashto Keyboard


Figure 7- Shift State of Pashto Keyboard


Figure 8- Alt Gr State of Pashto Keyboard

Enhancements over Urdu WebPad

Following is the list of changes in Urdu OpenPad compared with Urdu WebPad:

  • English digits are used also in Urdu mode for Urdu Phoentic.
  • Now each OpedPad edit-control (single- or multi-line) handles its language mode separately instead of having a global language setting for all edit controls.
  • Some bugs are fixed for working with FireFox.
  • Urdu Phonetic keyboard contains both single and double, left and right quotes
  • It is possible to set different fonts and point sizes of the OpenPad control. This can be seen in the included demos.
  • Each OpenPad control gets a pale yellow background to distinguish it from the other controls on the web page.

Fonts

I have used many fonts in one of the demos included in the download to demonstrate the capability of setting fonts of the editor control. I have included on Sindhi (MB Sindhi Web) and one Pashto font (Pashto Kror Asisatype). The Tahoma font also contains supports for Sindhi and Pashto. You can find many other Unicode fonts for Sindhi and Pashto here. Figure 9 shows the use of Nafees Nastaleeq font in OpenPad editor control.


Figure 9- UsingNastaleeq Font in Urdu OpenPad

FireFox Issues

For some inexplicable reason, FireFox would not display diacritics (aerab) in their isolated forms inside the on-screen keyboard. That is why I had to add the character alif to the diacritic to make it appear properly. The result is shown in Figure 10.


Figure 10- Diacritics in FireFox

Future Work

I have heard many people complaining about the Phonetic Urdu keyboard because they are used to using some other keyboard layouts. I would appreciate if somebody sends me other Urdu key-mappings e.g. Aftab, Muqtadra etc. Though I think the on-screen keyboard in Urdu OpenPad to be a significant achievement, it still lacks in its visual appeal. Adding a the English character in the background in each key would enhance its utility. I find it very cumbersome to use the mouse every time I want to toggle the language mode. It would be better to implement a short-cut key for that.

Some of you already use Urdu Editor Lite which in fact just embeds an html page (Editor.htm) to provide Urdu editing capabilities and the Urdu text can saved in UTF-8 format. The Editor.htm file included in the download can be used in place of the one already in use by Urdu Editor Lite. Make sure to copy all the necessary files along i.e. OpenPad.js, OpenPad.css and the other graphics. This will at allow the use of new capabilities that come with OpenPad. This way Sindhi and Pashto text can also be processed and saved in UTF-8 format. I have not updated the sources of Urdu Editor Lite accordingly. This means that the Save As html function still saves an html file with a fixed font (Urdu Naskh Asiatype) and point size. I will try to update the sources of Urdu Editor Lite as soon as possible.

Another future prospect is that of using the same logic of key mapping in web-based WYSIWYG controls e.g. RTE, TinyMCE etc. I have already done some work in this direction and I hope to come up with some workable solution soon.

I will be looking forward to your feedback and comments. Those who are already using Urdu WebPad in their forums and websites are encouraged to give Urdu OpenPad a try. You may post a comment on this blog or you can discuss it on the Urdu Mehfil forum.

Download Urdu OpenPad
View Demo 1
View Demo 2