Re: language based scaning
Re: language based scaning
- Subject: Re: language based scaning
- From: Ricky Sharp <email@hidden>
- Date: Thu, 15 Oct 2009 13:42:26 -0500
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:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden