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

Solved Issue #124 The underlines are not correctly displayed in RTL #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uniyeh
Copy link

@uniyeh uniyeh commented Jan 30, 2024

Fixed the underline displaying issue by self-implementing reversing the text instead of reversing with TMPro.

Detailed implementation:

  1. In RTLTextMeshPro.cs, removed all lines setting isRightToLeftText and added an enableRTL boolean member to replace it.
  2. In RTLTextMeshProEditor.cs, rewrote DrawTextInput() to handle RTL text without setting values for m_IsRightToLeftProp and m_RtlText.
  3. Deleted line 130 finalText.Reverse() in RTLTestMeshPro.cs since TMPro no longer reverses the text.
  4. Rewrote the RichTextFixer.Fix(output) method to correct the order of RichTextTags by swapping the positions of <tag> and </tag>.

I also added a scene named "Underline" for reference.
underline

@uniyeh uniyeh changed the title Solved Issue #124 Solved Issue #124 The underlines are not correctly displayed in RTL Jan 31, 2024
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

Successfully merging this pull request may close these issues.

1 participant