RTLTMPro icon indicating copy to clipboard operation
RTLTMPro copied to clipboard

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

Open uniyeh opened this issue 1 year ago • 0 comments
trafficstars

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 avatar Jan 30 '24 10:01 uniyeh