Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Perl\Tk Arabic %100 Support Almost There !

by Swalif (Scribe)
on Sep 05, 2009 at 21:58 UTC ( [id://793726]=perlquestion: print w/replies, xml ) Need Help??

Swalif has asked for the wisdom of the Perl Monks concerning the following question:

Good day Monks,
There was a lot of discussion regarding Arabic support in Tk, e.g :
Re: Tk Characters
right to left Tk text widget
Tk Characters
Perl/TK unicode font problem

http://www.linuxac.org/forum/linuxac51/thread14580.html

Maybe it was the wrong way we approached the problem, there was no need for encoding and decoding which could get words correct but not sentences , it was just a problem of text font and by changing the font to an Arabic one everything worked great even labels, buttons, even the title bar. Use utf8, was a most though. And there came the last obstacle the entry widget the first thing I did is to justify it to right and it worked great. Now we can say that building an Arabic application in Perl Tk is a possible thing and gives a workable program with little effort. One thing is still missing, it is the cursor.. Please see this image:
http://dheeb.wordpress.com/files/2009/09/1.jpg
You can notice the cursor is still in the far right side of the widget although it is supposed to go with flow of the text towards left. This problem is also not a big deal but see the next picture please:
http://dheeb.wordpress.com/files/2009/09/2.jpg
Here you can see that the selection with mouse doesn’t select properly unless all of the text is selected. I don’t know maybe there is a problem with indexing or something.
As you can see this is a very usable application and many other applications will work perfectly, in fact many users I gave the application didn’t notice anything because they didn’t used selection.
So, Perl\Tk now is very reasonable choice for developing Arabic apps except for applications that depend heavily on user selection like text editing.
I came across these two articles but I didn’t understand them, please see them if they are in any help:
http://wiki.tcl.tk/1126
http://wiki.tcl.tk/699
  • Comment on Perl\Tk Arabic %100 Support Almost There !

Replies are listed 'Best First'.
Re: Perl\Tk Arabic %100 Support Almost There !
by biohisham (Priest) on Sep 05, 2009 at 23:18 UTC
    Wow, that is a great thing you have done, I still remember we had a discussion on this problem you faced. That's great you have shared the news with us but wouldn't it have been more appropriate to give an abstraction of what you have done in Perl code as well for the following reasons:
    1. The RapidShare link doesn't work, it shows weird symbols.
    2. Many PerlMonks users would be interested to know what you did but many would not be following Arabic at the forum you provided either because they don't have the appropriate encoding in their machines or maybe thier ISP geographical location makes it restricted for them to open the site or they don't know the language in the first place but would like to extend this solution to their native languages if they can.

    It'd be really generous on your part if you showed this in a brief Tk code for I think you seem to be the first one who pioneered this approach. Congrats once again.


    Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.
      Hi Hisham..
      Great to hear from you again !
      About your first point, I didn't really put any Rapidshare link.. If you mean the links for pictures they are hosted on wordpress and I double checked them and they are fine, please feed me back if this isn't the case in order to upload them somewhere else.
      As for the second part, no problem at all ..
      First of all, I have this application upon my friends request ,though it is very small but it has a great value for Arabic poetry. The problem was that many of my friends are real world poets and they don't know anything about running CGI scripts so I tried to change the interface from CGI to Tk which was my first choice because of great documentation..
      To make long story short, I had these difficulties on showing Arabic chars. let alone working with them and get results.
      So, I used:
      1- Strawberry on Vista
      2- Trial Komodo IDE
      3- Trial ActiveState PerlApp for building the standalone App.

      As for the Perl code I couldn't get it showed properly here in the forum because of the plenty Arabic text it has, but as I noted before there was only three steps:
      1- use utf8.
      2- change the default font to Arial.
      3- Justify entries to right.
      *4- Avoid using encoding and decoding.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://793726]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-23 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found