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

Some TextMeshPro fonts dissapear on window resize, target WASM + Chrome on windows

Discussion in 'UGUI & TextMesh Pro' started by Kinetic, May 29, 2020.

  1. Kinetic

    Kinetic

    Joined:
    Jul 15, 2012
    Posts:
    26
    Hi! Maybe someone can shed some light on this issue?

    I'm a developer for the Decentraland world client (play.decentraland.org). We are noticing that when the browser window is resized on chrome + windows, some captions that use TextMeshProUGUI component are dissapearing completely. The text geometry is generated correctly, but the actual characters are not rendered.

    Tested this on:

    - Firefox + Windows -> does work
    - Chrome Version 81.0.4044.138 (Official Build) (64-bit) + Windows -> doesn't work
    - Chrome + OSX -> doesn't work

    We are using Unity 2019.1.14f1. TMPro package version is 2.0.1.

    If any of the devs can give us any insight of what could be failing it would be mostly welcome!.

    B
     

    Attached Files:

    JohnOknelorfDev likes this.
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Since the behavior appears to change based on target platform, the issue is likely on the Unity side of things as from a code point of view, TMP is exactly the same regardless of the target platform.

    I would recommend testing in the latest release of 2019.3 to see if the issue is still present. If it is still present, please submit a bug report with the projects and steps to reproduce. If you do submit a bug report, please provide me with the Case # once Unity provides it to you via email.
     
  3. Kinetic

    Kinetic

    Joined:
    Jul 15, 2012
    Posts:
    26
    Thanks for the support!. If you or anyone stumbles upon this, we fixed it by stop using I think its the default TMP font (LiberationSans SDF). Using our custom fonts with an atlas of 512x512 seemed to magically fix this issue.

    If anyone's want to dive deeper, this is the PR on our repo that fixed it: https://github.com/decentraland/explorer/pull/981

    Sorry for the late reply!
     
  4. DeloitteCam

    DeloitteCam

    Joined:
    Jan 23, 2018
    Posts:
    22
    We're seeing this on 2019 LTS, some TMP fonts will not render in Chrome at specific resolutions. For our project we make the canvas scale with the browser window size. When resizing the window any text using some fonts will blink on and off. It's not clear why this happens with some fonts and not others. We're not using the default font anywhere. We have tried re-creating the font atlases at different resolutions using the built in SDF font generation tool (256/512/1024) but the issue persisted.

    Renders flawlessly in Firefox.

    Don't have time right now to build an isolated case as we need to deliver the project to client very soon, going to look into a javascript workaround where we just restrict the WebGL canvas size to specific increments.
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    For testing purposes, switch the shader on those text objects to use one of the Signed Distance Field (SSD) shaders. These are included in the TMP Essential Resources and have the suffix SSD at the end of their name.

    Let me know if the text renders correctly using any of the SSD shaders.
     
    SomeC00lName likes this.
  6. DeloitteCam

    DeloitteCam

    Joined:
    Jan 23, 2018
    Posts:
    22
    The issue was actually because we had the same material variants for both UGUI and World Space Text Mesh Pro components. Creating separate variants for this solved the issue but if this causes unexpected bugs at build time only then I'd like to advocate for a big red warning signs in the editor at runtime when this is detected or the engine should just automatically create a new variant at runtime and generate a warning when doing so. Would be nice to reduce the number of Unity specific edge cases I need to hold in my head when working with the engine.
     
    taoufik_unity, SomeC00lName and exe2k like this.
  7. exe2k

    exe2k

    Joined:
    Oct 26, 2015
    Posts:
    63
    I Confirm. I changed fonts and materials that used directly inside 3D objects on a scene to split used fonts between UI and in-scene TMPro-s. The issue was fixed! Thank u, DeloitteCam! I use Unity 2021.3. Does anyone know if this bug gone in newer verisons?
     
    SomeC00lName likes this.
  8. yitz_unity

    yitz_unity

    Joined:
    Jun 22, 2021
    Posts:
    12
    I just encountered this bug in Unity 2021.3.14f1. It works correctly in Firefox, but not in chrome. If a font is used in World Space and UI Canvas it stops rendering in the UI Canvas after I resize the window in anyway including full screen.
     
    Last edited: Feb 14, 2023
  9. Rezrael

    Rezrael

    Joined:
    Nov 11, 2014
    Posts:
    7
    Same issue is happening in OUR COMMERCIAL PRODUCT online. We are thinking about dropping Unity entirely. Our clients are pissed. If anyone even moves the window the text just disappears.
     
  10. AngryMuppet

    AngryMuppet

    Joined:
    Mar 28, 2014
    Posts:
    34
    Still an issue in 2023.1.2 0 - changed over the world space font materials and all good! (Chrome/Edge only - Firefox works fine)
     
    Last edited: Jul 4, 2023
  11. JohnOknelorfDev

    JohnOknelorfDev

    Joined:
    Oct 2, 2017
    Posts:
    21
    Stumbled upon exactly the same issue in 2021.3.11f1 LTS. The project works perfectly in Firefox but random TMPro labels just go invisible in Chrome. Tried solutions above -- nothing. Tried a lot of other possible fixes -- nothing. Unity is so frustrating