Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: how to display unicode in a Label in Tkinter

Reply
Thread Tools

Re: how to display unicode in a Label in Tkinter

 
 
Jeff Epler
Guest
Posts: n/a
 
      08-19-2004
I have to warn you, my remarks below are based on an extensive knowledge
of tcl, and a tiny knowledge of arabic.

On Wed, Aug 18, 2004 at 02:50:07PM -0600, A K wrote:
> um i waswondering if the web page yu provided gave code that did the
> following
>
> 1) provide a function that reverses the order of the text


string:revert reverses the whole string, and turns "(" into ")" and vice
versa. The first loop at the top of "proc uc:arabchar2glyph" unreverses
strings of digits, possibly with embedded spaces, hyphens, dots, and
commas.

The next two blocks turn digits (optionally) and the punctuation
characters "?" and "," into equivalents ("ARABIC QUESTION MARK" and
"ARABIC THOUSANDS SEPARATOR").

The next two sections use commas (no "original" commas remain after an
earlier step, so this is safe) to deal with combining characters. Here
things go beyond my little knowledge of arabic. First, a comma is added
at the "side" of each glyph that is a combining glyph, then the
glyphs-with-commas are turned into the combined glyphs. For instance,
the first two entries in that list are for turning the characters
U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE
U+0644 ARABIC LETTER LAM
into
U+fef6 ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM
assuming the commas produced earlier are in the right place.

List (in arabchar2glyph), any remaining commas (from glyphs that didn't
combine) are removed, and the string is returned.

The final "proc ar:ligatures" does even more substitution. The first
pair of items turns the sequence
U+fea4 ARABIC LETTER HAH MEDIAL FORM
U+fee4 ARABIC LETTER MEEM MEDIAL FORM
U+fedf ARABIC LETTER LAM INITIAL FORM
into
U+fd88 ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM

I think these two specific examples will seem "backwards" to you,
because at both steps the string has been "rendered" from logical order
to European left-to-right order.

> 2) stores the unicode number of the arabic characters in an array and
> assigns them a letter or character from the keybord.


Yes, the portion of the code beginning "proc buckwalter2uc" turns an
ASCII representation of Arabic text into the proper unicode characters.

>
> Also the attachment yu sent contained a bunch of non-sense. I was wondering
> what it was supposed to be. thank you for your help.


The attachment is generated by software called "gpg", which is related to
older software called "PGP". It is a "signature" that allows people who
read messages I write to be confident that I wrote them. You could use
the gpg software yourself to verify the signature. In my e-mail program,
something this is displayed at the
top of a signed message:
[-- PGP output follows (current time: Wed 18 Aug 2004 08:38:54 PM CDT) --]
gpg: Signature made Tue 17 Aug 2004 09:06:45 PM CDT using DSA key ID 96935D7D
gpg: Good signature from "Jeff Epler <>"
[-- End of PGP output --]
gpg can also be used to encrypt the contents of e-mail messages, giving
some measure of privacy to online conversations. You can learn more
about gpg by visiting www.gnupg.org if you're interested, though that
website seems to be geared to people who already know what gpg is and
why they want it..

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBJA13Jd01MZaTXX0RArfuAJ4qPErrbxcuWxlKUB9iYL 4eJ4vztgCfafJq
0nyXmlbOZr6WaTQxu7A+H+g=
=WG/E
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Ali
Guest
Posts: n/a
 
      08-21-2004
I dont think I am following. Could you possibly give the code and add
commments to explain?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
<label><div></div></label> allowed? Josef K. ASP .Net 3 05-22-2005 02:13 PM
label versus asp:label Question. Thanks. Shapper ASP .Net 2 05-07-2005 05:55 AM
RE: how to display unicode in a Label in Tkinter Ben Last Python 1 08-17-2004 10:03 PM
how to display unicode in a Label in Tkinter Ali Python 5 08-17-2004 11:55 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57