Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

TextMesh Pro TMP_InputField.characterLimit doesn't work well for full-width characters

Discussion in 'UGUI & TextMesh Pro' started by jeff414, Jul 17, 2020.

  1. jeff414

    jeff414

    Joined:
    May 28, 2020
    Posts:
    2
    If I set characterLimit = 4.
    I can type in ABAB or ABCD. But CD is 2x wider than AB. Because they are full-width characters. It may overflow the inputfield.
    Could you please add a new property such as characterWidthLimit? If I set characterWidthLimit= 4. I can only type in ABAB or ABC or CD.
    CJK characters are almost full-width characters.
    Thank you!
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This seems like a bug as the character limit should be whatever you set regardless of the actual width of those characters.

    I will look into that as soon as I have a chance.
     
  3. jeff414

    jeff414

    Joined:
    May 28, 2020
    Posts:
    2
    Yes,character limit is whatever I set regardless of the actual width of those characters. Either a halt-width character or a full-width character is regarded as one character.
    But we want a full-width character regarded as two characters. Because it's double wider than a halt-width character.
    Could you please add a option such as "full-witdh character regarded as 2 charaters" to support it?
     
    Last edited: Jul 17, 2020