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

Does it work programatically? #107

Open
ivoras opened this issue Jun 8, 2023 · 3 comments
Open

Does it work programatically? #107

ivoras opened this issue Jun 8, 2023 · 3 comments

Comments

@ivoras
Copy link

ivoras commented Jun 8, 2023

I'm building an app where almost all text is set during runtime, using t.text=something. I've tried replacing TextMeshProUGUI with RTLTextMeshPro, but it just doesn't work.

Here are some screenshots:

Before I set the text, if it's in Arabic, I'm setting the font, so the operation is:

t.font=something;
t.text=somethingElse;

This is because I need to support multiple languages. Unfortunately, I don't know Arabic so detecting problems is slow.

Can you point me to the right direction to resolve this?

Edit: Apparently there's one more bug, or a combination of bugs: auto-sizing height doesn't work, so the component misbehaves in a HorizontalLayoutGroup and sets its size to 1, and the original content is not updated / replaced with Arabic text until I change the component height in editor, which forces some kind of update, possibly related to wrapping. The problems persist even if I use an Arabic font from the start and don't replace the font at runtime. I've tried using a Western font and adding an Arabic font as fallback, and an Arabic font with a Western font as fallback, and in both cases I can't get the Arabic text to render. Here's a new screenshot: https://i.imgur.com/Ki4ZTSH.png

@javad5421
Copy link

javad5421 commented Jun 30, 2023

i have kind of same problem
in runtime if you change the text property of RtlTmp_Text after you enter 3 or more character the older characters change
im using unity 2021.3.26f1

@hk1ll3r
Copy link
Collaborator

hk1ll3r commented Jul 16, 2023

@ivoras What Unity version are you using?

This asset has usages of RTLTMPro package with live language changes. You can use that as a reference on how to use RTL text.

@ivoras
Copy link
Author

ivoras commented Oct 3, 2023

It's Unity 2021.3.30 now but it was 2021.3.24 then.

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

3 participants