Change Text Direction in Doc.Composer


#1

Hi every body,

Do you have any idea about how to change direction of Text and Property tags from LTR (that is default) to RTL in Doc.Composer templates ?

something like :
<Property direction=“rtl” /


#2

Hi, I tested on a Hebrew word, seems it is RTL.
Do you want the text and icon align to right?


#3

Hi peter.wong,

I know about alignment and tried it before but its not what i’m looking for.

This problem occurs when i use some combination of Persian and English language in a line together and there is no problem in showing a line with only one right to left language like Hebrew or Persian .

Currently I can fix this problem in the Microsoft Office tools after i export the result to word file but it take some times and i want a better solution !

we have this problem in almost all tools and usually we fix it by changing a Direction property from LTR to RTL but i don’t find this option in Doc.Composer Template language.


#4

Thanks for your information. (Sorry, we are not familiar with RTL languages)

on DocComposer’s Preview:
Seems the problem occurs when the paragraph is generated by 2 or more <Property>, <Text>.

and after generated to WORD:
the arabic + “C++” becomes LTR…

We are trying to fix it. Please wait…


#5

Hi, Mamad

We will support direction="rtl" in <Text> and <Property>
But it will be only working on WORD document. // Preview, or PDF/HTML does not support it…

It will be supported in next version: 15.1. Please wait for the new version.

Since we are not familiar with Right-to-Left languages.
From the above screenshot, if you found it is incorrect in the generated WORD. Please tell me to let us fix it again. Thank you very much. :pray:


#6

Hi peter.wong,
Thank you so much.I appreciate your support.
It seems OK but i’m not completely sure about that.
There is a simple method to find if you are in the right way:
As i showed in the attached picture :

1

In the outputted word file select the whole sentence that contains a combination text of two languages.then from the Home menu in Microsoft word, press Right to left text Direction button.Does the presentation style of selected sentence change after you press the button ?
(notice that i mean presentation style = the order of words from right to left)
if yes, you are wrong and probably need to change your fix !! but if the displaying style of whole sentence don’t changed, this means your sentence is in the right form of Right to left presentation and you don’t need to fix any more !!!


#7

Visual Paradigm 15.1 is released. You can update your Visual paradigm to use
<Text direction="rtl" ...>...</Text>, and
<Property direction="rtl" .../>
to make your content Right-To-Left now.

For your more details:
We specify the Right-to-Left in words, not in paragraph.
Since <Text> or <Property> is generating words, and multiple <Text> or <Property> forms a paragraph. So, the rtl (Right-To-Left) is specified in words, not in a paragraph.

Sample Template XML:

<?xml version="1.0" encoding="UTF-8"?>
<ElementBaseInitiationBlock>
	
	<Inline template="General/Element Basic"/>
	
	<Block>
		<Text style="@heading+">rtl on arabic only</Text>
		<ParagraphBreak/>
		
		<Text>Here are some words before - </Text>
		<Property property="name" direction="rtl"/>
		<ParagraphBreak/>
		
		<Property property="name" direction="rtl"/>
		<Text> - Here are some words after</Text>
		<ParagraphBreak/>
	</Block>
	
	<Block>
		<Text style="@heading+">rtl on all words</Text>
		<ParagraphBreak/>
		
		<Text direction="rtl">Here are some words before - </Text>
		<Property property="name" direction="rtl"/>
		<ParagraphBreak/>
		
		<Property property="name" direction="rtl"/>
		<Text direction="rtl"> - Here are some words after</Text>
		<ParagraphBreak/>
	</Block>
	
	<Block>
		<Text style="@heading+">rtl not specified</Text>
		<ParagraphBreak/>
		
		<Text>Here are some words before - </Text>
		<Property property="name"/>
		<ParagraphBreak/>
		
		<Property property="name"/>
		<Text> - Here are some words after</Text>
		<ParagraphBreak/>
	</Block>
	
</ElementBaseInitiationBlock>

#8

Thank you :ok_hand: