Search Unity

TextMesh Pro /t (tab) broken in 2019.1.0f2?

Discussion in 'UGUI & TextMesh Pro' started by deab, Apr 17, 2019.

  1. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    Upgraded this morning, and in a TextMeshProUGUI where I use \t tab characters to align columns, the tab width seems to have gone from what looked like around 5 characters, to maybe 50.

    I'm creating the text like this:

    Code (CSharp):
    1. string outText = "id     state coOrds\tTime\n";
    In a fresh project, if I paste the text from the inspector gui it works as expected. I can't see any difference between the settings.

    Editing the text I confirmed the tab function is working as expected, just at a much larger width.

    Is it possible to view or change the tab size?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Font Assets now have a field for Tab Width which is defined by the font file and also the existing Tab Multiple. These two values now factor into the behavior of Tab.

    upload_2019-4-17_11-46-20.png

    Most likely your old font assets (which didn't have this Tab Width) value will need adjustment.

    Let me know if that resolves your issue.
     
    MirelesJ, xinuxano and deab like this.
  3. Twosheds-Jackson

    Twosheds-Jackson

    Joined:
    Mar 1, 2014
    Posts:
    2
    Hello! I also just upgraded to 2019 and I am now getting a crash bug in TMPro. When I try to set a TextMeshProUGUI object's .font member in code, I get this:

    ArgumentException: An item with the same key has already been added. Key: 0
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    TMPro.TMP_FontAsset.InitializeDictionaryLookupTables () (at Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs:584)
    TMPro.TMP_FontAsset.ReadFontAssetDefinition () (at Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs:602)
    TMPro.TMP_FontAsset.get_characterLookupTable () (at Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_FontAsset.cs:139)
    TMPro.TextMeshProUGUI.LoadFontAsset () (at Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMPro_UGUI_Private.cs:539)
    TMPro.TMP_Text.set_font (TMPro.TMP_FontAsset value) (at Library/PackageCache/com.unity.textmeshpro@2.0.0/Scripts/Runtime/TMP_Text.cs:140)

    But it was working fine as of Unity 2018.3.9f1.

    Any idea what that might be ?

    Thanks,
    Andrew
     
  4. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    93
    Tab width was 486! Thanks. I did search the docs but found no mention of this anywhere.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you submit a bug report with the project so I can take a look?

    What version of TMP were you using prior to the upgrade?
     
  6. locbh

    locbh

    Joined:
    Sep 11, 2017
    Posts:
    10
    Hi there,
    I got the same problem here.
    I was upgrading from Unity 2018.3 to Unity 2019.1
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Stephan to pick up.
     
    Stephan_B likes this.
  8. MirelesJ

    MirelesJ

    Joined:
    Jun 2, 2017
    Posts:
    5
    That did the trick for me, too. The font asset tab size was 289. Setting it to 10 solved the problem. Thanks.