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

Unable to write arabic text properly if first word is in English #111

Open
RahmatAli78 opened this issue Jul 12, 2023 · 6 comments
Open

Comments

@RahmatAli78
Copy link

I am trying to write text in input field by writing first word as english and then arabic but it is not convert arabic word properly into word.
For example: Hello , How are you.
In the above exampe RTLPro is not converting arabic text.

@hk1ll3r
Copy link
Collaborator

hk1ll3r commented Jul 16, 2023

Can you be more specific in your example?

Hello , How are you does not contain any Arabic letters.

@RahmatAli78
Copy link
Author

RahmatAli78 commented Jul 18, 2023

Yes, Thanks for Your Reply.
The Issue Came When I Try to Write the English Letter First and the The Arabic in same Sentence,
Like Example: "Hello, غتناب Buddy". This is The Correct Format but when try to Write the Same Sentence With the RTL Input Field It Messed up. It Appears Like this "Hello ل ايا ي Buddy ".
Image Below.
@hk1ll3r
image

@RahmatAli78
Copy link
Author

Any Update Regarding this Issue,
@hk1ll3r .

@RahmatAli78
Copy link
Author

@pnarimani
@Rootjhon
@Hesamom
@smkplus
@eethaen
Guys! Anything Regarding this now its been a month let me know if there is a Solution for this.

@BlackSp1der
Copy link

I've had the same problem, after a few minutes looking at the code, I think I found the solution:
Replace the 'IsRTLInput(string input)' method in the 'TextUtils' class

  public static bool IsRTLInput(string input)
  {
      bool found = false;
      bool insideTag = false;
      foreach (char character in input)
      {
          switch (character)
          {
              case '<':
                  insideTag = true;
                  continue;

              case '>':
                  insideTag = false;
                  continue;
          }

          if (insideTag)
          {
              continue;
          }

          if (!char.IsLetter(character) || !IsRTLCharacter(character)) continue;

          found = true;
          break;
      }

      return found;
  }

@Rootjhon
Copy link
Contributor

>> https://github.com/pnarimani/RTLTMPro#force-fix

RTL Text Mesh Pro does not fix texts that start with English characters. Checking this checkbox forces RTL TextMeshPro to fix the text even when it starts with English character. Multiline English texts will have problem on components that have ForceFix checked.

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

4 participants