Search Unity

Bug TextMeshPro: incorrect Right-to-Left rendering

Discussion in 'UGUI & TextMesh Pro' started by Nimja, Apr 1, 2022.

  1. Nimja

    Nimja

    Joined:
    Mar 19, 2013
    Posts:
    1
    Hello,

    I've been using the Localization package to have support for multiple languages. However, I am having a problem rendering Right-to-Left text in a TextMeshPro element. Setting the
    isRightToLeft
    flag seems to just invert the order of characters. However, this is incorrect; certain substrings should not be inverted, specifically, numbers - numerals are still read left-to-right. Also, RTL text can contain LTR text (English acronyms, for example), this case cannot be handled by just inverting the string as it will invert the LTR substring.

    As it stands, I would have to scan strings and invert such substrings so that TMPro's inversion will keep them in the correct order in every place that my code sets text in a TextMeshPro Text element; at which point I feel it should just be something that TMPro should handle correctly.

    Thank you.