/t (tab) broken in 2019.1.0f2?

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:

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?

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.

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.

3 Likes

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.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0) System.Collections.Generic.Dictionary2[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

Tab width was 486! Thanks. I did search the docs but found no mention of this anywhere.

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?

Hi there,
I got the same problem here.
I was upgrading from Unity 2018.3 to Unity 2019.1

Please submit a bug-report as described in this document:

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.

1 Like

That did the trick for me, too. The font asset tab size was 289. Setting it to 10 solved the problem. Thanks.