Skip to main content
Participant
January 27, 2009
Answered

RTL and XML

  • January 27, 2009
  • 1 reply
  • 2571 views
Hello, what is the best way to use the new text component to import the arabic language via xml into flash.

I noticed in the demo with the spinning globe that the arabic text is actually unicode, the unicode string is actually LTR, then is displayed RTL. Obviously this works nicely with wordwrap etc. Is there some sort of converter I can get to convert RTL arabic to LTR unicode?
I'm wondering also if its possible to import the Arabic font as a string from XML, and have things like the word wrap work correctly, I'm presuming here (maybe naively) that there isn't a RTL XML format and if there is flash doesn't wrap its head around it. I can't imagine writing whole paragraphs of text backwards in xml. To do this do I need to use markup code as per the bidi.xml file in the examples, where it seperates out each line for display to deal with the wrap issues.

Any insight would be great, I'm sorry if my explanations are a little newby, i'm no gun.

K.

This topic has been closed for replies.
Correct answer robin_briggs
It is up to the application that displays the XML as to how it will appear to you, so I can't speak for whether it the XML will look LTR or RTL when you view it. But the idea is that the Unicode characters are stored in reading order. For TLF, we get the Unicode in reading order, and then the Player converts them into "atoms" that are ordered either RTL or LTR depending on the Unicode values.

The example in bidi.xml does have many shorter lines, but the same principle works on longer paragraphs as well, and TLF, using the Player, will correctly do line wrap regardless of the text direction. In order to get the column order, indents, and punctuation to look right, you will have to decide if your TextFlow and paragraph is mainly LTR or RTL and set the direction attribute appropriately.

1 reply

robin_briggsCorrect answer
Adobe Employee
January 28, 2009
It is up to the application that displays the XML as to how it will appear to you, so I can't speak for whether it the XML will look LTR or RTL when you view it. But the idea is that the Unicode characters are stored in reading order. For TLF, we get the Unicode in reading order, and then the Player converts them into "atoms" that are ordered either RTL or LTR depending on the Unicode values.

The example in bidi.xml does have many shorter lines, but the same principle works on longer paragraphs as well, and TLF, using the Player, will correctly do line wrap regardless of the text direction. In order to get the column order, indents, and punctuation to look right, you will have to decide if your TextFlow and paragraph is mainly LTR or RTL and set the direction attribute appropriately.
brian_thomas2
Adobe Employee
Adobe Employee
January 28, 2009
Also check out BabelPad: http://www.babelstone.co.uk/Software/BabelPad.html

It has good complex script support and will convert to unicode.