Search Unity

Word wrapping

Discussion in 'UI Toolkit' started by Reeley, Nov 12, 2019.

  1. Reeley

    Reeley

    Joined:
    Feb 23, 2017
    Posts:
    45
    Is it possible to wrap on characters instead of words so that a line of text will always be filled?


    The word "wrapping" should be split up in the first sentence.
    I do not care about correct hyphenation.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I will take a look at adding support for additional types of line breaking modes. But in the meantime, enclosing the text in the <nobr> </nobr> tag should result in breaking per character.

    Are you using UI Elements or TextMesh Pro?
     
  3. Reeley

    Reeley

    Joined:
    Feb 23, 2017
    Posts:
    45
    Im using UIElements and i dont think tags are a thing here. So would be cool to see some additional breaking modes.

    I quickly tested with Textmesh and it seems like the <nobr> tag only works for the first word. Following words will not split up:



    I also read the doc for the <nobr> tag and im kind of confused this even workes, because normaly <nobr> should keep the word together