*** Version 1.5.5, 2.1.5 and 3.0.5 Now Available! ***

The following releases of the TMP package are now available. These are version 1.5.4 for Unity 2018.4, version 2.1.4 for Unity 2019.4 and version 3.0.4 for Unity 2020.x or newer.

These three (3)releases are identical in terms of features and functionality but specific to each Unity release which is required to address some API and other changes to Unity.

Release Notes
******************

  • Improved sprite tag anim functionality to take into consideration the sprite character and glyph scale. Case #1309707
  • Improved Ellipsis character insertion handling to prevent potential issues when the Ellipsis glyph ascender and descender exceed those of the primary font asset. See forum post for details.
  • Fixed text object margin handles in Scene view not behaving correctly as a result of lossy scale or object rotation. Case #1295523
  • The tag padding attribute can now be defined using font units (em).
  • Fixed text parsing issue related to recent memory overhead optimizations. Case #1295755
  • Updated TMP Essential Resources and TMP Examples & Extras.
  • Updated TMP Sprite shader to add support for Single Pass Stereo rendering.
  • Fixed potential iOS build failure. Case #1298753
  • Fixed a few missing Profiler.EndSample() in the TMP_FontAsset.cs file. See forum post for details.
  • Fixed SetText() with formatting issue where large numbers would show a leading zero. See forum post for details.
  • Updated profiling code to use the new and more efficient ProfilerMarker.
  • Fixed incorrect text bounds. See forum post for details.
  • Fixed OutOfRangeException error that could occur in the TMP Input Field when selecting all and inserting characters using IME. Case #1301059
  • Fixed incorrect handling of Surrogate Pairs in the TMP Input Field. Case #1299798
  • Fixed Font Asset Creator incorrectly leaving the Readable state of font asset atlas textures to readable where it should be set to non readable for static font assets. Case #1305520
  • Added Multi Select functionality to the “Create - TextMesh Pro - Font Asset” context menu option. Case #1303074
  • Revised internal handling of the various text input methods to ensure the text property is always reflective of the text content in the Inspector Text Input Box in the Editor and via the text property getter even when using a combination of the various SetText methods or the text property setter. Case #1294998
    Please note that using the text property getter when the text was updated via one of the SetText methods will results a string allocation.
  • Fixed incorrect line spacing caused by preceding <size=x.x> tag. See forum post for details.
  • Revised how the Bold Spacing which is defined per font asset will affect spacing between bold characters to ensure more uniform spacing. This change may require users to manually adjust the bold spacing value of their font assets to maintain similar spacing / layout results.
  • Fixed linked text components not updating correctly when setting the text to null or empty. Case #1305832
  • The vertexBufferAutoSizeReduction property will now be set to false by default. This property is used to determine if the internal data structures used in the parsing of the text should be resized when the text content shrinks by more than 256 characters which results in CG. Case #1305311
  • Fixed animated sprites not behaving correctly when using text overflow mode Ellipsis and Truncate. Case #1303672
  • Fixed TMP Resource Importer window stealing focus when Inspector Layout Property window is open when TMP Essential Resources have not been imported into the project. Case #1300462
  • Fixed minor UI cosmetic issue affecting text spacing properties alignment in the Quick Search window. Case #1299587
  • Fixed minor UI cosmetic issue in the Font Asset inspector related to the positioning of the warning when changing Generation Settings.
  • Fixed issue where the material properties of fallback font assets are not updated when changing the material properties of the primary font asset via code. Case #1271468
  • Fixed an issue with Text Overflow Linked mode where text would not flow correctly from one component to the other when the last character present at the break point was a linefeed “\n” or vertical tab “\v”. See forum post for details.

Changes Worth Noting


Project Text Spacing Conversion Tool

This tool is located in the “Window - TextMeshPro - Project Text Spacing Conversion Tool” menu item.

This tool was added to make it easier to adjust text component character, word, line and paragraph spacing as a result of the (em) scale spacing changes that were introduced in versions 1.5.0, 2.1.0 and 3.0.0.

This tool will scan the project to identify text components in scenes and prefabs that have spacing adjustment values and will list these components along with current and revised values. The tool will not change any values unless you select “Save Modified Project Files”.

Unless you have noticed spacing changes in your text since updating to the previous releases, there is no need to use this tool. As usual make sure, you backup the project first.

Note: Normal and Bold text spacing values per font asset are not adjusted by this tool. These still need to be adjusted manually, if once again, you noticed a change in text spacing.

Text Property and SetText() functions

In previous releases, there was no common internal text backing data structure between the text property and the various SetText() functions. As such, users setting the text via one of the SetText() functions and then checking it by using the text property would not get the expected string.

In this release, I have revised how these various ways of setting the text work where the source text is copied to this new internal text backing data structure which is then used to parse the text.

As a result of this change, the Text Input Box in the Inspector and the text property will remain in sync regardless of the text input method.

This change will also make this portion of the code easier to maintain.

Note that in the Editor, there will be allocations when the source of the text is not a string as we need to convert from the source format to a string. At runtime, there will be allocations when the source of the text is not a string and only when accessing the text property to check the text as again we need to convert from whatever source format to a string.

Next Preview Releases
I will next be working on versions 1.6.0 for Unity 2018.4, version 2.2.0 for Unity 2019.4 and version 3.2.0 for Unity 2020.x or newer.

Some of the larger new features that I am planning to introduce include:

Unity 2018.4
Since we are near the end of the 2018.4 LTS cycle, version 1.6.x will be the last major release for Unity 2018.4. I will of course continue to provide updates for these releases until most of you have moved on to 2019.4 or newer Unity releases.

5 Likes

Yellow text on white / grey backgrounds is unreadable.

error.

Library\PackageCache\com.unity.textmeshpro@2.1.4\Scripts\Runtime\TMP_DefaultControls.cs(188,22): error CS1061: ‘RectMask2D’ does not contain a definition for ‘padding’ and no accessible extension method ‘padding’ accepting a first argument of type ‘RectMask2D’ could be found (are you missing a using directive or an assembly reference?)

my unity version is 2019.4.9f1

2 Likes

I’ll revise the compiler conditional. The padding was added the RectMask2D in a subsequent release of Unity 2019.4 which is now at version 2019.4.20f1.

I keep forgetting about the Light Theme … argh!

Updating from 3.0.3 to 3.0.4 causes a reimport of all textures in the project… :frowning:

That seems strange… Did this happen by just updating the TMP package or you also updated to a newer version of Unity?

I updated from Unity 2020.2.4f1 to 2020.2.5f1
After the project started up (no long import time), I checked the Project Manager and saw that there’s an available update to TMP, so I clicked update.
That’s what started the reimport.

There is nothing in the TMP package that should cause a re-import of textures. There is

private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)

which is not new where this is triggered by Unity when assets have been changed.

Do you still have a backup of the project prior to the upgrade to 2020.2.5f1? I would like to see if I can reproduce this behavior to figure out why the textures would have been re-imported.

I’m on the same verson(2019.4.9f1) and get the same error. Any workarounds?

You can comment out the offending line which will need to be done in the Global Package Cache.

However, unless there is a technical reason for not upgrading to the latest 2019.4 LTS release, I would consider upgrading.

If you are using any input fields in your project, having the ability to add / control padding on RectMask2D is kind of nice.

No,i just use 2.1.3 textmeshpro.I dont want to update the version of unity ,that will bring more bugs.

I will make the necessary change for the next release.

Until then or until you update to a newer release of 2019.4, you can make the following change to the TMP_DefaultControl.cs file at line 188 which is to comment out the offending line since the padding property does not exist in early versions of 2019.4.

// Use UI.Mask for Unity 5.0 - 5.1 and 2D RectMask for Unity 5.2 and up
RectMask2D rectMask = textArea.AddComponent<RectMask2D>();
#if UNITY_2019_4_OR_NEWER
//rectMask.padding = new Vector4(-8, -5, -8, -5);
#endif

Note that the change needs to be done in the Global Package Cache in order to make it persistent.

1 Like

These features will be a huge help! Thank you for your work.

Brings a compile error on 2018.4.16f1:

[CompilerError] 'FontEngine' does not contain a definition for 'GetGlyphPairAdjustmentRecords'
Compiler Error at Library\PackageCache\com.unity.textmeshpro@1.5.4\Scripts\Runtime\TMP_FontAsset.cs:2613 column 80

I tried to replace it with the Unity 2018.3 codepath in the #define and it seems to work with that change.

Thanks! Any indication when an update will be released to resolve this?

I’m also having this exact issue on 2018.4.13f1. Would you mind elaborating on the change you did or is there any other solution I could potentially do?

If not, can this issue be fixed on an update to the 1.5.4 package?

Thank you.

I missed that initial report but this is related to recent changes / improvements that I made to the font engine in Unity 2018.4. I would suggest upgrading to Unity 2018.4.32f1.

In terms of the change, the older way of fetching glyph pair adjustments was not as efficient as the newer one. This change landed in 2018.4.24f1.

If for some reason you cannot upgrade to the latest 2018.4, you could revert that specific change in your version 1.5.4 of the TMP package. Let me know if that will be necessary or if you can upgrade to the latest 2018.4.

Unfortunately for the time being I won’t be able to upgrade the project to a more recent version of Unity, so I’ll have to revert that change. Alternatively I figured I would just upgrade to 1.5.3 which seems to work. Hopefully eventually the project will be upgraded too…

Thank you for your quick response by the way! :slight_smile:

There are issues with 1.5.3 which 1.5.4 addresses.

What specific issues are you having with 1.5.4?