Skip to main content
December 8, 2009
Question

RTL & LTR mixed

  • December 8, 2009
  • 2 replies
  • 1336 views

I'm working on a foreign language learning program primarily for teaching native english speakers arabic and/or japanese (osbit.research.pdx.edu)

Some of the exercises the client wants have rtl (arabic) and ltr (english) text mixed such as the question: "What is the appropriate English equivalent for شبة الجزيرة العربية?"


The client would like the arabic text to display rtl even though it is in the middle of a ltr paragraph.

Oh did I mention the text needs to word wrap and scroll?

I was thinking maybe I could render the text to a bitmap and manipulate it that way.

Thoughts? suggestions? is there an easy way to do this?

This topic has been closed for replies.

2 replies

Participant
January 17, 2010

Alright,

I have found problems working with RTL LTR mixed

If you have the text streams separated with special characters something goes wrong. Even for the same language itself. This just goes wrong as long as the TLF is set in RTL mode.

For example

هذا كلام عربي (This is English) English again

this is not supposed to be the case. the phrase English Again should come after the closing brackets.

Please  , Some body help !

Thank you

Adobe Employee
January 17, 2010

English (Latin) characters are always treated as LTR, while Arabic characters are recognised as RTL. Punctuation characters have no "natural" direction, so they get treated dependent on the direction property that is applied to the paragraph. If the paragraph is direction="ltr", punctuation is treated as left to right, if the paragraph has direction="rtl" it gets treated as right to left. Make sure the direction of the paragraph is set correctly, and this should cause the punctuation to be set correctly. If you want to override the direction applied to the punctuation, there are Unicode characters you can add to force a direction change.

Please try this, and let us know if you have further problems.

Thanks!

- robin

Participating Frequently
December 8, 2009

This is called bidirectional (or bidi) text and TLF supports it, including wrapping, scrolling, selecting, and editing it. Please let us know how it works for you; I don't think many developers have tried using it yet.

Gordon Smith

Adobe Flex SDK Team

December 9, 2009

Alright i did a find/replace to replace every <mx:Text> element with <ns:Label>, and that seems to work.

Thanks.