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

Bug uGUI Text showing as black blocks

Discussion in 'UGUI & TextMesh Pro' started by olid, Mar 9, 2023.

  1. olid


    Jan 10, 2019
    We have an on going issue where the Text in our uGUI sometimes is rendered as black rectangle for each character. This has been ongoing since Unity 2017, and still happening with 2021.

    Before it typically occurred only on the Android build of the app, but it seemed to only affect certain models of phones, as was put down to a GPU bug. But now we have reports of the same happening in IOS with our Unity 2021 build.

    We use both TMP and the original Text objects in the app, as yet we havent had an issue with the TMP text, but I have read a number of reports in the forum here about issues with 0 scale, or sharing font materials between canvas and 3d - I will keep a look out for these. We are using Dynamic font atlases in the app.

    In IOS it is seeming to occur when we switch in the app in/out of focus - we see:


    where they should be three legible text labels.

    In IOS we are now see a new issue where certain characters are missing as well:


    this should be a list of X.YYY numbers - but some of the digits are not being rendered, which is even more odd!
    But could conceivably be the same or related issue.

    I am suspecting the Text:OnPupulateMesh function not resetting the m_DisableFontTextureRebuiltCallback when the text is empty, and the function exits early, and so is missing the required action when the callback FontTextureChanged is called when the atlas is expanded, and the texture is regenerated, and so it misses updating the mainTexture. But if that was the case I think it would have occurred more often.

    Reproducing the issue has been difficult, as it seems that just re-installing the app causes the issue to disappear for a while.

    I cant see any obvious reports of text issue that is not to do with TMP in the forum - any one seen this issue?

  2. olid


    Jan 10, 2019
    We now have this bug reproducible on IOS 16.3, where it doesnt happen on 15.7. In particular it happens when the user switching away from the app, and back again - are some textures being disposed when the app is in the background?

    Update: This was a bug in our code - our custom AppDelegate was not forwarding the background/active callbacks to unity
    Last edited: Jun 27, 2023