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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Problem with broken text in Unity canvas

Discussion in 'UGUI & TextMesh Pro' started by AndersMalmgren, Nov 14, 2016.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    For no particular reason text in our grid gets completly broken sometimes. The underlying string is correct its teh UI thats messed up

    Looks like this broken_ui.jpg
     
  2. dpoly

    dpoly

    Joined:
    Nov 10, 2016
    Posts:
    35
    Yes, I've seen that a few times (5.4.2f2). Obviously a bug. Try raising an issue?
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    They probably want a repo project which I cant give them, it does not happen often
     
  4. JoaoPaul54

    JoaoPaul54

    Joined:
    Nov 20, 2013
    Posts:
    52
    I also found this bug, I believe it comes from the way Unity handles dynamic fonts. For now I haven't been able to find a solution as well. If you do find a solution please let me know.
     
    Gekigengar likes this.
  5. Phil-Proulx-asd

    Phil-Proulx-asd

    Joined:
    Nov 12, 2012
    Posts:
    2
    I have the same issue, and I also think it is related with the way Unity handle dynamic fonts.

    With dynamic fonts, when a new character is displayed, it is added to a big atlas texture. When using the same character with a different font size, it is considered to be a new character and is also added to the big texture.

    The issue seems to be that when that big texture reach the maximum texture size supported by the device, it may break and display weird stuff.

    The expected result would be that it would use additional texture(s) when needed, and continue to work properly. Another option that could help would be to be able to clear that font texture.

    As a temporary solution, I am duplicating the font asset itself, and assigning different version of the same font asset into my text components according to their text size. Since Unity seems to use one font atlas texture per font asset, it's the only way I could find to force using multiple texture images. The downside of this solution is the need to maintain that text-usage/font-version relationship, which can be non-trivial in a big project if you don't have centralized text styles.

    Another (partial) solution to minimize the issue would be to reduce the number of different font sizes used in the project.
     
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks guys, been busy with other aspects, will revisit this soon, but could it be considered a bug with Unity then?