Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

TextMesh Pro Version 1.5.0 & 2.1.0 Preview 1 - Now Available for Testing!

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Stephan_B, Oct 1, 2019.

  1. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    The preview release (beta) of the TMP package version 1.5.0 for Unity 2018.4 and version 2.1.0 for Unity 2019.x are now available for testing via the Package Manager.

    These are identical releases in terms of functionality but had to be separate releases due to changes in Unity such as dependency on the UI package in 2019.x, etc.

    These two packages include updated TMP Essential Resources and TMP Examples & Extras. Updating these is optional.

    There are two new major features in this release, Text Styles and Multi Atlas Texture support which I will cover below as well as several minor features and lots of fixes. See the ChangeLog for more details.


    Text Styles
    Text Styles allow the application of a style to a text object. This is very useful when a specific style applies to the whole object which previously required using the <style> tag at the start and end of the body of the text which was not ideal in some cases and also error prone.

    upload_2019-9-30_18-12-50.png

    The Text Style pull down shows the Text Styles available. Text Styles are defined Globally in the TMP Settings Default StyleSheet and can now also be Local by assigning a StyleSheet in the Extra Settings of the text object. If a style is defined in the local and global StyleSheets, the local style will override the global style.

    It is possible to use a Text Style and styles in the body of the text. Nesting of styles has also been improved.

    Multi Atlas Texture
    The Multi Atlas Texture feature enables font assets to create new atlas textures as needed which is when it is no longer possible to add new glyphs to the main atlas. These additional atlas textures inherit the settings of the main atlas texture which are defined in the font asset Generation Settings. All atlas textures including the main atlas are contained in an array of Texture2D. The main is always index [0].

    upload_2019-9-30_16-42-52.png

    Changes to the font assets including the addition of new atlas texture are persistent in the editor but not persistent in builds. As such and for example, a dynamic font asset with multi atlas support enabled will be able to grow / add as many atlas textures as needed to handle the glyph coverage in a given play session but will always default back to its initial state for the next session.

    upload_2019-9-30_18-15-6.png

    Since changes to font assets are persistent in the Editor, it is also possible to Reset font assets via the Context Menu option Reset. This will clear the Glyph, Character and Glyph Adjustment Tables. This will also clear all atlas textures.

    Changing generation settings (in the Editor) like atlas texture size, will automatically regenerate and re-pack the existing glyphs and adjust the number of atlas textures as needed based on the new settings. This makes easy and convenient to later optimize your font asset and atlases in the event you discover the initial settings were incorrect.

    This Multi Atlas Texture feature applies to all dynamic font assets whether they are assigned as primary or fallback somewhere.

    As mentioned above, these atlas textures are contained in an array and in this first implementation will result in a draw call for each atlas texture. However, I am planning on updating the shaders to add support for texture arrays where on devices that support this feature (which is most fairly recent mobile devices), these will now only take a single draw call.

    Multi Atlas Texture support is an important new feature that will require additional robust testing. No doubt we'll uncover potential issues and / or API functionality that should be added to make the feature even more robust / flexible. I look forward to your feedback on this new feature and release of course.

    Additional Important Changes
    (1) In this release, I reworked the line breaking / word wrapping handling to address limitations related to glyph insertion when used in conjunction with Text Auto Size which required recursion. The catalyst for this was an issue with Soft Hyphenation used in combination with Text Auto Size.

    As part of this refactor, I also improved the handling of Text Overflow modes like Truncate, Ellipsis, Linked and Page mode to also remove the use of recursion. This also improves the layout / performance when using these modes.

    Although I have done a lot of testing related to these changes, no doubt we'll run into some cases where we get incorrect layout results. Let me know if you notice any issues when using these modes or overall text layout.

    (2) Additional tweaks were done to character, line, paragraph spacing which now represent 1/100 em. This affect tag using (em) and those values in the inspector. Simply put the (em) handling was incorrect in previous versions. Some of those changes were present in 1.4.1 so let me know if you run into any issues here.

    (3) Alignment properties have now been split into horizontalAlignment and verticalAlignment. This will provide for independent control over these which was a requested feature when working with Prefabs as changes to alignment in the past would always dirty everything. This should be a workflow improvement. In theory (again) you should not notice any changes here. There was an issue with alignment in 1.4.1 which affected users with project initially created back in the Unity 5.4 ish time frame. These alignment issues should be handled automatically now.

    (4) Added support for modern line breaking for Korean where spaces are used. This option is in the TMP Settings.

    Again please review the ChangeLog as it contains lots of stuff including reference to some new smaller new features.

    This release is missing some new features that I plan to add in the next preview release or so. These are in no particular order: <HR> tag, Initial implementation of the TMP Resource Manager to make it easier to work with Asset Bundles and Addressables and any type of custom loading of resources. Support for manual definition of diacritical marks (Mark to Base and Mark to Mark). Improve handling of super large text objects where the geometry is larger than 65,535 vertices. This currently works but I uncovered some issues that I want to address. Adding iTextProcessor interface to improved pre-processing / shaping of the text. Additional line breaking / work separators discussed in forum posts. And more small type features that I have discussed on the forum that I would like to get in version 1.5.0 and 2.1.0.

    Lastly, it took too long to get this release out so I want to work on reducing the interval between releases.

    Feedback
    If you run into any unforeseen issues or have questions about these releases, feel free to reply to this post.


    How to Install
    These latest preview release are available via the package manager only. To install these, open the Package Manager UI and select the appropriate package as shown below.

    In Unity 2018.4
    upload_2019-9-30_15-3-1.png

    In Unity 2019.x
    upload_2019-9-30_15-33-16.png
     
    Last edited: Oct 2, 2019
    TurboNuke likes this.
  2. elmo

    elmo

    Joined:
    Sep 21, 2012
    Posts:
    7
    I never got it to work to have shadows for my fonts. The material is not created it seems but the Font Creator window doesn't show an option here. I also don't understand the different Render Modes. What is SDFAA_HINTED etc. Is there any documentation about this? Thanks!
     
  3. elmo

    elmo

    Joined:
    Sep 21, 2012
    Posts:
    7
    I think I found the problem. My point size was at 500 - I set it down to 80 now and somehow it's working now.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    See the following post about the different modes. SDFAA is the equivalent of Smooth whereas SDFAA Hinted computes the SDF using the Hinted version of the glyph.

    I suspect your initial issue was due to the ratio of Sampling Point Size to Padding being too small. This ratio determines the effective range of the material properties. See FAQ Question 11. You normally want a ratio of about 10% so if the sampling point size was 500, you would have needed a padding value of 50 which is huge. Most fonts will render nicely at around 72 - 100 points and most Asian fonts due to how they are structured actually do pretty good at 36 to 48.
     
    elmo likes this.
  5. elmo

    elmo

    Joined:
    Sep 21, 2012
    Posts:
    7
    Thanks for your fast and detailed reply, Stephan!
    After I wrote my initial question here - I found the video that explains all this. As you said, the Padding was my problem that effects didn't work out well - together with a very high Sampling Point Size. So this has been solved! :)
     
    Stephan_B likes this.
  6. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    235
    mcallet likes this.
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306

    Attached Files:

    elmo and aurelien-morel-ubiant like this.
  8. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    235
    Ok thanks for the changelog !
    I see nothing mentioning some issue we reported concerning the Custom Validator is it inside ?
     
  9. elmo

    elmo

    Joined:
    Sep 21, 2012
    Posts:
    7
    I added three different text objects in my scene and now I want to change the color of one text. However, now all text objects getting changed when I edit one of the text objects. I created the text objects by dublicating the first text object - could this cause this issue - I'm sure this is a feature to make it easier to change the settings on all the text in one scene - or am I doing something wrong here? Thanks for any hint!
     
  10. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    184
    Unfortunately that problem with input field text not getting masked by RectMask2D that was fixed in 1.3 is back again:
    tmp_masking.gif

    Repro project is attached.
     

    Attached Files:

  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    I'll take a look this afternoon and provide feedback thereafter.
     
  12. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    235
    @Stephan_B there is some issue with the update in our project.

    For example we have a CustomTextInputField without RectMask2D on the same game object than the `TextViewport` object reference in your `TMP_InputField` and this create an issue during the `OnEnable` method call.

    Because you have this :

    Code (CSharp):
    1.  m_TextViewportRectMask = m_TextViewport.GetComponent<RectMask2D>();
    2. m_TextViewportRectMask.enabled = false;
    and you must probably write this instead :

    Code (CSharp):
    1. m_TextViewportRectMask = m_TextViewport.GetComponent<RectMask2D>();
    2. if(m_TextViewportRectMask != null)
    3.     m_TextViewportRectMask.enabled = false;
    For the code above I think you just missed it because in the UpdateMask method just under those lines your first test is to check the m_TextViewportRectMask with != null

    Another thing is now in our project we have some element that we call
    Skinned TMPro UGUI which allow us to use a skin for our entire project. Before 1.5 every text in the InputField was visible with a blue color but now they aren't display whereas the text is good. So I think they are white but I'm still investigate on this issue.

    Edit 1 : on the second issue, this is only happening on 2 input fields in our project. Which is quite odd because they all use the same nested prefab. So still investigate... I will try first to reimport the project just in case.

    Edit 2 : After the reimport nothing new.
    BUT
    I found where the issue was but I couldn't explain it...
    If we manually in the inspector enabled / disabled the rectmask2D, the text is displayed.
    If you have some explanation on this feel free to share them :)
     
    Last edited: Oct 3, 2019
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    Can you provide me with some simple test setup that mirrors what you have?
     
  14. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,306
    There are definite issues related to Clipping / Culling in the preview 1 which I have been looking into. I do have a current solution which I am further testing. I expect to release a new preview within the next few days.

    This should resolve all issues related to Clipping and Culling including the null reference on RectMask2D.