Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ZHENGYUN01 opened this issue Dec 15, 2021 · 9 comments

Comments

@ZHENGYUN01
Copy link

translate result:
image

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

@ZHENGYUN01
Copy link
Author

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

@hk1ll3r
Copy link
Collaborator

hk1ll3r commented Dec 15, 2021

@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
Copy link
Author

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

@ZHENGYUN01
Copy link
Author

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

@ZHENGYUN01
Copy link
Author

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
Copy link
Collaborator

hk1ll3r commented Dec 16, 2021

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
Copy link
Author

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

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
Copy link
Collaborator

hk1ll3r commented Dec 16, 2021

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
Copy link
Collaborator

hk1ll3r commented Feb 15, 2022

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.

@hk1ll3r hk1ll3r closed this as completed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants