Search Unity

TMP "Font Units" Spacing Broken after Updating from 1.3.0 to 1.4.1

Discussion in 'UGUI & TextMesh Pro' started by bstockwell, Jun 28, 2019.

  1. bstockwell

    bstockwell

    Joined:
    Apr 6, 2018
    Posts:
    7
    So I have a decent amount of UI in this game that uses "Font Units" in various places, example strings:

    "<mspace=2.2em>00:03:49</mspace>"
    "
    2<voffset=-0.25em><space=1em><sup>nd</sup>"

    Here is how the text looked before upgrading TMP:



    Here is how the Text looks after upgrading to 1.4.1 :




    This is the string: "<mspace=2.2em>00:03:49</mspace>"

    Here is another before and after:

    Before:


    After:


    Here is the string: "2<voffset=-0.25em><space=1em><sup>nd</sup>"


    Is there anyway to fix this with TMP Settings or Font Asset Settings?

    The only notable change log said this:
    • Fixed an issue where rich text tags using pixel (px) or font units (em) were not correctly accounting for orthographic camera mode. This change only affects the normal TMP text component.
    What changed that cause this to be broken now? How can I easily fix it with out manually checking what "em" number makes it look like the way it used to?

    Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    My apologies as I did change the handling of spacing since it was incorrect in previous releases. This should have also made it into the release notes.

    Subsequent to the changes, using something like <mspace=50px> will now correctly space the characters by 50 pixels. Using <mspace=1em> when the point size is 50 will also now result in the characters being spaced by 50 pixels.

    Spacing options in the Inspector have also been revised (in the next release 1.4.2) where the values now specified in 1/100 em will also result in the correct spacing.

    In terms of how to adjust existing values to account for this change, let me take a look to see if I can come up with some simple solution / migration there.

    Note: In previous releases, 1em equaled the width of 1 space character. Now like I said above, 1em will equal 1 pixel * point size.
     
    Last edited: Jul 1, 2019
    Deleted User likes this.