Copy link to clipboard
Copied
I am pulling this data from xml, but all full stops and colons goes to the end of first line, see the snapshot.
By the way I tried using direction attribute Direction.RTL for paragraph, span and textFlow but output gets worst, and in fact its much better without defining direction except this dot and colon problem.
Code is:
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
textFlow.fontLookup = FontLookup.EMBEDDED_CFF;
textFlow.renderingMode = RenderingMode.CFF;
textFlow.textAlign = TextAlign.CENTER;
textFlow.verticalAlign = VerticalAlign.MIDDLE;
textFlow.addChild(p);
var span:SpanElement = new SpanElement();
span.text = text;
span.fontSize = 24;
span.color = 0xFFFFFF;
span.lineHeight = "100%";
span.fontFamily = "Tahoma";
span.fontLookup = FontLookup.EMBEDDED_CFF;
p.addChild(span);
var sprite:Sprite = new Sprite();
sprite.x = 28;
sprite.y = 24;
addChild(sprite);
textFlow.flowComposer.addController(new ContainerController(sprite, 400, 100));
textFlow.flowComposer.updateAllControllers();
XML
<block id="8">
<question en:content="One of the world's most expensive license plates, Abu Dhabi ‘1’ was sold for:"
ar:content=":بيعت إحدى أغلى لوحات أرقام السيارات في العالم ('١' أبوظبي) بمبلغ"></question>
<options>
<option answer="true" en:content="US$ 4 mio" ar:content="٤ ملايين دولار أمريكي"></option>
<option answer="false" en:content="US 14 mio" ar:content="١٤ مليون دولار أمريكي"></option>
<option answer="false" en:content="US$ 24 mio" ar:content="٢٤ مليون دولار أمريكي"></option>
<option answer="false" en:content="US$ 34 mio" ar:content="٣٤ مليون دولار أمريكي"></option>
</options>
</block>
If the paragraph's direction is set to LTR, then the punctuation ends up on the right side of the last line. If it's set to RTL, then the punctuation ends up on the left side of the last line. I've attached my XML file that imports correctly for me - it's exported directly from my TextFlow that I've been experimenting with. What I don't know is how to recreate this XML in a text editor.
Copy link to clipboard
Copied
In your XML above I'm seeing bidirectional content, not pure RTL. If I click and drag from left to right over the "ar:content=" line, the colon is selected first, then the rest of the Arabic text. That tells me (and TLF) that the colon is LTR content, so it will place the colon at the "beginning" of the first line (which is to the left in a LTR direction paragraph, or the right in a RTL paragraph), then deal with the rest of the text.
I'm not exactly sure how RTL punctuation is supposed to be represented in XML. But when I follow these steps:
1. Import your line into TLF
2. Delete the RTL colon
3. Switch to an Arabic keyboard
4. Type a new colon at the end of the text
Then the punctuation works correctly - it will end up at the end of the text no matter how many lines are used. When I export at that point, I get a span of text with this string in it:
بيعت إحدى أغلى لوحات أرقام السيارات في العالم ('١' أبوظبي) بمبلغ:
Copy link to clipboard
Copied
Thanks for the help.
I copied your arabic line into my xml and it goes to the beginning of 2nd line, kindly see error2.jpg.
Next step, in my xml I managed to type : at the end, it appears perfectly in my xml but again ends at the end of first line. I want this to appear at the end of the sentence. Kindly see error3.jpg
Please advise or if you can also post your xml file, I will also test with that.
Yes the content is Bidirectional and in fact this is what we use mostly and I read that Bidirectional text issue is solved in Text Layout Framework, do I miss something in my action script code?
Best,
Saad
Copy link to clipboard
Copied
If the paragraph's direction is set to LTR, then the punctuation ends up on the right side of the last line. If it's set to RTL, then the punctuation ends up on the left side of the last line. I've attached my XML file that imports correctly for me - it's exported directly from my TextFlow that I've been experimenting with. What I don't know is how to recreate this XML in a text editor.
Copy link to clipboard
Copied
solved. It turns out that the error was in xml itself, content appeared to be legitmate when viewed in notepad (in default LTR direction) but when I changed direction inside notepad (LEFT Ctrl + Shift) I noticed the error and thats what was leading to a totally wrong sentence including quotation marks inside Text Layout Framework, its great now.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now