Search Unity

TextMesh Pro Problem with the difference text height between English and Chinese.

Discussion in 'UGUI & TextMesh Pro' started by Huangtiya, Jan 3, 2018.

  1. Huangtiya

    Huangtiya

    Joined:
    Nov 15, 2017
    Posts:
    3
    Hi all,
    I found an issue when I used the TextMesh Pro to show texts in localization.
    I used the same layout and font size, but when two texts align to the top, it will show some padding in Chinese. It causes two texts seems not to be aligned, because of the difference font height between two texts.
    I tried to use UGUI Text Component , It didn't cause the text height difference issue.


    font.png
    Upper texts are used TextMesh Pro
    Lower texts are used UGUI Text
    PS. Two texts need align to the top ,because the left text can show two lines with auto-layout ,but the right text should be aligned to the first line forever.


    Anyone know how to fix this problem?

    Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of Unity and TextMesh Pro are you using?

    Can you provide me with a simple repro scene of this so I can take a closer look?
     
    Last edited: Jan 3, 2018
  3. Huangtiya

    Huangtiya

    Joined:
    Nov 15, 2017
    Posts:
    3
    Hi~ Stephan
    I use Unity 5.5.2f1 and TextMesh Pro1.0.54.

    The following link is an example project package for my issue. You can check the two panel "English" and "Chinese" in the scene "LocalizationTest".

    Edit: Removed link to source code version of TMP.

    Thanks for your help!
     
    Last edited by a moderator: Jan 4, 2018
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thanks for providing the Repro.

    I'll try taking a look tonight if I can and provide feedback as soon as I have more information.

    Update: The package you provided doesn't include the TMP Settings and other required resources. So I can't tell how you were handling switching to the Chinese font asset which I would assume is the NotoSansCJK... Were those assigned in the TMP Settings fallback list?

    You are using a pretty old version of TMP so once I have been able to verify the alignment is correct, I would suggest considering upgrading to a newer release of TMP. Updates to the source code version are available on the TextMesh Pro user forum.

    Update 2: Using the latest version of TMP, here is what I get on the Text_title object in your scene.

    upload_2018-1-3_23-50-0.png

    I believe whatever alignment issue is likely to have been addressed in some subsequent releases of TMP. However, I would like to confirm that before you upgrade. Please re-export the project while making sure it includes all the resources and stuff and provide me with a link via PM so you don't end up sharing your project or the source code version of TMP with everyone.

    If you do elect to process to upgrade your project to the latest release, please sure be to back up your project first. Then as per the Release and Upgrade notes, you will need to remove the previous version of TextMesh Pro (by deleting the "TextMesh Pro" folder before importing the new release. Since your NotoSansCJK font asset is contained inside the TextMesh Pro folder hierarchy, you will need to make sure you save those as well as review any changes you might have made to your TMP Settings file.

    P.S. I removed the link from your post since it included the source code version of TMP.
     
    Last edited: Jan 4, 2018
  5. Huangtiya

    Huangtiya

    Joined:
    Nov 15, 2017
    Posts:
    3
    Thanks for your reply.

    I'll try to upgrade the latest version to check the issue still exist or not.
    But how can I replace the old version TMP text in my current project?
    When I deleted the "TextMesh Pro" folder and import the new release. All my project text script is missing, like that ScriptMissing.png
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are those missing scripts the TextMeshPro scripts like the TextMeshProUGUI or are those your own scripts?

    Unless your scripts are located somewhere inside the "TextMesh Pro" folder, those script references should be maintained.

    When upgrading to the new release, you also have to make sure that you upgrade to the source code / paid version of TextMesh Pro which is only available on the TextMesh Pro user forum. Upgrading to the free dll only version will not work as the source code version and dll versions have different GUIDs and FileIDs.

    Other than those two considerations, removing the previous version of TextMesh Pro before importing the new version is the process that all TMP users and myself have used over the past several years when upgrading to newer releases.
     
    Last edited: Jan 4, 2018