pnarimani / RTLTMPro

Right-To-Left Text Mesh Pro for Unity. This plugin adds support for Persian and Arabic languages to TextMeshPro.
MIT License
526 stars 100 forks source link

The latest version I Downloaded today works failed. How could it be fixed? #88

Closed ZHENGYUN01 closed 2 years ago

ZHENGYUN01 commented 2 years ago

translate result: image

origin text content: 射手更适合魔龙路,您确定要用{0}\n走魔龙路吗?\n(魔龙路的英雄要有较强的推塔能力,同时需要在后期具有较强输出能力,通常为射手)

ZHENGYUN01 commented 2 years ago

what I use is as below: tempValue is looks like the upper comment, RTLSupport.FixRTL(tempValue, output, true, false, true);

hk1ll3r commented 2 years ago

@ZHENGYUN01 can you copy paste the translated text? So that I can paste it into an RTLTMPro component over here and investigate the issue.

ZHENGYUN01 commented 2 years ago

the string value is .)رﺎﺴﻤﻟا اﺬﻫ ىﺪﻤﻟا وﺪﯿﻌﺑ لﺎﻄﺑﻷا ﻚﻠﺴﯾ ﺎﻣ ةدﺎﻋو .ةارﺎﺒﻤﻟا ﺮﺧاوأ ﯽﻓ ﺮﯿﺒﻛ رﺮﺿ قﺎﺤﻟإ ﻰﻠﻋ ﻦﯾردﺎﻗ اﻮﻧﻮﻜﯾ نأ ﯽﻐﺒﻨﯾو ،ﻂﻐﻀﻟا ﯽﻓ ﻦﯾﺪﯿﺟ اﻮﻧﻮﻜﯾ نأ ﺐﺠﯾ ﻦﯿﻨﺘﻟا رﺎﺴﻣ ﯽﻓ لﺎﻄﺑﻷا{0}؟\n) ماﺪﺨﺘﺳﺎﺑ رﺎﺴﻤﻟا اﺬﻫ ﻚﻠﺳ ﯽﻓ ﻚﺘﺒﻏر ﻦﻣ ﺪﻛﺄﺘﻣ ﺖﻧأ ﻞﻫ .ﺔﯾوﺎﻬﻟا ﻦﯿﻨﺗ رﺎﺴﻣ ﯽﻓ ﺐﺴﻧأ ىﺪﻤﻟا وﺪﯿﻌﺑ لﺎﻄﺑﻷا

ZHENGYUN01 commented 2 years ago

but when take a look at the string value, it is different from the value in the first comment i made yesterday.

ZHENGYUN01 commented 2 years ago

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.

hk1ll3r commented 2 years ago

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.

ZHENGYUN01 commented 2 years ago

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 = '射手更适合魔龙路,您确定要用{0}\n走魔龙路吗?\n(魔龙路的英雄要有较强的推塔能力,同时需要在后期具有较强输出能力,通常为射手)';

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.

hk1ll3r commented 2 years ago

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.

hk1ll3r commented 2 years ago

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.