Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Custom Font Set in TMP - Text (UI) Component Swapped with Default Font Randomly

Discussion in 'UGUI & TextMesh Pro' started by pako, Jul 6, 2022.

  1. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    112
    Hi,

    I'm using Unity 2021.3.5f1 LTS and TextMeshPro 3.0.6.

    I have several elements in my UI with TMP Text Components. Everything was working fine for many weeks. Yesterday, I noticed that the custom font I had set in the component, was being swapped, during Play mode, with the default TMP font "out of the blue", and for no apparent reason. In Edit mode, there's no problem. Moreover, the "swap" doesn't happen all the time. Sometimes, there's no swapping, but quite frequently, the fonts are swapped.

    I re-imported and re-created the custom fonts, and made sure that the fonts are in a Resources folder. This seemed to have fixed the problem, but it was temporary, only for a couple of times that I started Play mode.

    The only change that I can probably relate to is that I was using the Canvas as a prefab, and I unpacked it a couple of days ago. I did just an "unpack, not "unpack completely", but the UI elements with TMP Text were not a prefab themselves anyway.

    I really don't know how to fix this.

    Please help.