Closed ZHENGYUN01 closed 2 years ago
what I use is as below: tempValue is looks like the upper comment, RTLSupport.FixRTL(tempValue, output, true, false, true);
@ZHENGYUN01 can you copy paste the translated text? So that I can paste it into an RTLTMPro component over here and investigate the issue.
the string value is
.)رﺎﺴﻤﻟا اﺬﻫ ىﺪﻤﻟا وﺪﯿﻌﺑ لﺎﻄﺑﻷا ﻚﻠﺴﯾ ﺎﻣ ةدﺎﻋو .ةارﺎﺒﻤﻟا ﺮﺧاوأ ﯽﻓ ﺮﯿﺒﻛ رﺮﺿ قﺎﺤﻟإ ﻰﻠﻋ ﻦﯾردﺎﻗ اﻮﻧﻮﻜﯾ نأ ﯽﻐﺒﻨﯾو ،ﻂﻐﻀﻟا ﯽﻓ ﻦﯾﺪﯿﺟ اﻮﻧﻮﻜﯾ نأ ﺐﺠﯾ ﻦﯿﻨﺘﻟا رﺎﺴﻣ ﯽﻓ لﺎﻄﺑﻷا
but when take a look at the string value, it is different from the value in the first comment i made yesterday.
So maybe, you can copy the origin text content, and pass the origin text content to tempValue in the statement:
RTLSupport.FixRTL(tempValue, output, true, false, true);
and then set the output.ToString() to a Text.text.
finally, you will get the result as what i showed in the first comment.
origin text content in your first comment is in Chinese (or another east asian language). What is the string value you put in the RTLTextMeshPro component? Either through the inspector or in code with: RTLTextMeshPro c = ...; c.text = myVar; // I need value of this myVar string.
sorry, I did not describe my question clearly.
I download RTLTMPro project and import it into my Unity project.
But I use it in my c# script as below:
`
FastStringBuilder output = new FastStringBuilder(RTLSupport.DefaultBufferSize);
output.Clear();
tempValue = '射手更适合魔龙路,您确定要用
RTLSupport.FixRTL(tempValue, output, true, false, true);
Text text = new Text();
text.text = output.ToString(); ` I want to get the FixedValue computed with RTLSupport.FixRTL and set it to an Text component.
The text you are providing is not Arabic, Persian nor Hebrew. Are you trying to render Chinese text RTL? Have you tried setting the text in a TextMeshPro component with RTL set to true? TextMeshPro (Unity's package not RTL version in this repo) can draw characters in RTL order.
If you can provide more detail (what you want to do, what you expect to happen in this asset and what goes wrong), please reopen this issue with more details. As of now I still don't understand why there are only Chinese characters in the text.
translate result:
origin text content: 射手更适合魔龙路,您确定要用{0} \n走魔龙路吗?\n(魔龙路的英雄要有较强的推塔能力,同时需要在后期具有较强输出能力,通常为射手)