Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Unity 2020.1a17 TMPro Font Asset Created 'usage' Bug

Discussion in 'UGUI & TextMesh Pro' started by jGate99, Dec 21, 2019.

  1. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    Hi there,


    After this issue, i have encountered another issue upgrading to recent a17 and TMPro Preview 3 3.0.0.
    My fontawesome created font assets now throw these errors, even if i recreate them, issue remains same rendering me unable to continue work.

    They throw this error when i select them in textmesh pro font asset setting.



    Capture.PNG

    @Stephan_B
    Please advise just like last time so i can progress
    Thanks
     
    Last edited: Dec 22, 2019
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are you able to reproduce this when creating a new font asset or using an existing one?

    What are the steps to reproduce this?
     
    jGate99 likes this.
  3. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    Same issue even if i create a new font asset but with same settings, let me try creating a new font asset with a different font and different setting and update you if it works this time

    Update: I created another new asset with your own font and when i select it i get the same error

    Capture.PNG

    Code (CSharp):
    1. MissingComponentException: There is no 'CanvasRenderer' attached to the "TMP UI SubObject [Font Awesome 5 Pro-Light-300 SDF Material + LiberationSans SDF Atlas]" game object, but a script is trying to access it.
    2. You probably need to add a CanvasRenderer to the game object "TMP UI SubObject [Font Awesome 5 Pro-Light-300 SDF Material + LiberationSans SDF Atlas]". Or your script needs to check if the component is attached before using it.
    3. TMPro.TMP_SubMeshUI.UpdateMaterial () (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMP_SubMeshUI.cs:706)
    4. TMPro.TMP_SubMeshUI.SetMaterialDirty () (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMP_SubMeshUI.cs:610)
    5. TMPro.TMP_SubMeshUI.SetSharedMaterial (UnityEngine.Material mat) (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMP_SubMeshUI.cs:835)
    6. TMPro.TMP_SubMeshUI.AddSubTextObject (TMPro.TextMeshProUGUI textComponent, TMPro.MaterialReference materialReference) (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMP_SubMeshUI.cs:235)
    7. TMPro.TextMeshProUGUI.SetArraySizes (TMPro.TMP_Text+UnicodeChar[] chars) (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1400)
    8. TMPro.TMP_Text.ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMP_Text.cs:1863)
    9. TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1648)
    10. TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@3.0.0-preview.3/Scripts/Runtime/TextMeshProUGUI.cs:246)
    11. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at D:/Program Files/2020.1.0a17/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:210)
    12. UnityEngine.Canvas:SendWillRenderCanvases()
    13.  
    Update 3:
    Its even happening when i create a new project, add TextMesh Pro which triggers import, create font asset using your provided font but my own char code (font awesome based) and after generation when i try to apply it to TMPro instance on canvas, same error
     
    Last edited: Dec 23, 2019
  4. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    @Stephan_B
    I'm prayin that i get fix for this before u go on holidays otherwise these last days will go regreting using Unity 2020.1 Alpha :(
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Looking at it today and will provide an update as soon as I have more information.
     
    jGate99 likes this.
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The following change will resolve this issue.

    upload_2019-12-23_14-39-46.png

    This change needs to be made in the Global Package Cache otherwise the change will be reset when Unity is closed and reopened.
     
    jGate99 likes this.
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    It solves the problem for newly created TextMeshPro items, but all of my existing work (created items) still throw this error. What should i do? redoing whole ui will b a lot of rework.

    Update: 2

    I manage to fix existing by reverting scenes to an old commit and then adding missing values again. So no need to do anytihng extra.
    Thanks for your quick fix earlier once again
     
    Last edited: Dec 28, 2019
    shefyg likes this.