On Oct 15, 2009, at 1:11 PM, Nz Gmail wrote:

what I'm trying to do is sort of Twitter client, in which the tweets can be English or Arabic so in case of Arabic the alignment should be from right to left, i hope I made it clear this time
cheers


In that case, you can probably scan the text for a Unicode code point within the ranges 0x0600 to 0x06FF and 0x750 to 0x77F. Hopefully that should cover it.

However, should the Arabic text also contain presentation forms, code points can also fall within 0xFB50 to 0xFDFF and 0xFE70 to 0xFEFF.


Now, I'm not sure about your exact content, but you may have blocks of text that are primarily English with Arabic content and visa versa. So, maybe just scan the first character and drive the layout based on that?

e.g.

[English block of text with <arabic phrase here>.<whitespace>    ]
[    <whitespace>.<english phrase here> with text of block Arabic]

An exception arises if an Arabic block of text begins with Western Arabic digits; you may have to continue scanning until you reach the first "alphabetic" character.

___________________________________________________________
Ricky A. Sharp         mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to