Search Unity

TextMesh Pro How can I submit bugs or issues for TMP?

Discussion in 'UGUI & TextMesh Pro' started by jayatubi, Feb 13, 2019.

  1. jayatubi

    jayatubi

    Joined:
    Dec 9, 2013
    Posts:
    143
    Just found some issue when using TMP. Should I create a post here or if there is a bug tracking system?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You are welcome to report potential issues here in this section of the user forum.

    Please be sure to first perform a quick forum search as the potential issue might have already been reported and for which a potential solution may already exists thus avoiding having to wait for a reply.

    Depending on the complexity of the issue / ability for me to reproduce it, it might be necessary to submit a bug report via the Unity normal bug reporter located in the help menu inside of Unity.
     
  3. iamnexxed

    iamnexxed

    Joined:
    Jun 12, 2019
    Posts:
    4
    Got this message when I was trying to use different shaders with TMPro Text.

    Shader error in 'Sprites/Default': Internal error, unrecognized message from the shader compiler process. Please report a bug including this shader and the editor log.

    The default TMPro shaders did not work on mobile device. Is this some bug or do I need to change any setting?
     

    Attached Files:

    Last edited: Dec 18, 2019
  4. Lyrcaxis

    Lyrcaxis

    Joined:
    Dec 8, 2017
    Posts:
    7
    Suggestion........ :

    There should be a scriptable object or something to use as a settings template for new Components :)
    Should be fairly quick to add and would allow many users to customize their experience.
    I realize this isn't the most appropriate place to make this feature request/suggestion, but I'm posting it anyway and hoping for the best :)
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That is what the TMP Settings are. This is where you set what font asset is assigned to text objects by default as well as other settings.
     
    Lyrcaxis likes this.
  6. questmill

    questmill

    Joined:
    Jan 30, 2015
    Posts:
    9
    I got this error when building my Android app:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    (wrapper stelemref) System.Object.virt_stelemref_class(intptr,object)
    TMPro.TextMeshProUGUI.Awake () (at Library/PackageCache/com.unity.textmeshpro@2.1.1/Scripts/Runtime/TMPro_UGUI_Private.cs:114)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)

    In TextMeshProUGUI.cs form line 113 on, I "fixed" by replacing the given code:

    Code (CSharp):
    1. for (int i = 0; i < subTextObjects.Length; i++)
    2.   m_subTextObjects[i + 1] = subTextObjects[i];
    by

    Code (CSharp):
    1. for (int i = 0; i < subTextObjects.Length; i++)
    2. {
    3.     if (m_subTextObjects.Length > i +1)
    4.         m_subTextObjects[i + 1] = subTextObjects[i];
    5. }
    Cheers
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Version 2.1.3 of the TMP package was released earlier today and should resolve that issue.
     
  8. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    I just updated to 2.1.3 from 2.0.1 and I'm getting tons of NullReferenceExceptions that completely break my project.

    Whenever I try to set
    TMP_InputField.caretPosition
    , I get the following:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. TMPro.TMP_InputField.ClampCaretPos (System.Int32& pos) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_InputField.cs:848)
    3. TMPro.TMP_InputField.set_caretPositionInternal (System.Int32 value) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_InputField.cs:857)
    4. TMPro.TMP_InputField.set_selectionAnchorPosition (System.Int32 value) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_InputField.cs:895)
    5. TMPro.TMP_InputField.set_caretPosition (System.Int32 value) (at Library/PackageCache/com.unity.textmeshpro@2.1.3/Scripts/Runtime/TMP_InputField.cs:876)
    Furthermore,
    TMP_Text.textInfo
    is now null until the component has been enabled. This breaks tons of my code that operates on the textInfo of disabled text objects.

    I really need to update to 2.1.3 for a bug fix, but it completely breaks my project. Hoping for some fixes from you soon.
     
    Last edited: Oct 29, 2020
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The TextInfo is no longer serialized since as being generated data it was unnecessarily increasing the scene / object data size for those objects but more importantly not playing nice with prefabs. Until the text object has been processed, the textInfo and other similar generated data will not be valid / populated. This change occurred in 2.1.0.

    When and what operations are you trying to do on the text prior to it being enabled?

    You should be able to use ForceMeshUpdate() with it various overloads to force the text to be process even if disabled which would then populate the textInfo allowing to perform the previous operations you were doing.
     
    Last edited: Oct 29, 2020
  10. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Thank you for your help. I tried calling ForceMeshUpdate() with every combination of overloads, but was unable to fix the issue this way. I ended up just checking for
    if (textMesh.textInfo == null)
    before everything, and thankfully it's all working properly now.

    The specific thing I was trying to do was color links using textInfo.linkInfo, so the user can easily tell that a link exists and can be clicked on.

    Have a good day, and thank you for all your hard work on TMP, it really is a godsend :)
     
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    How are you implementing this?

    I am asking because, it might be easier to use the new OnPreRenderText() callback which would allow you to modify the textInfo prior to the mesh being uploaded to the renderer as opposed to modifying it subsequently are re-uploading it again.
     
  12. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Here's my LinkHelper script. It handles the coloring of links, including separate colors when the user hovers the pointer over a link or clicks on it. It also handles the logic for running some arbitrary code when a link is clicked on.

    I don't think the OnPreRenderText callback would be a great fit here. Links aren't just colored when the text is rendered for the first time, but also after that when the user mouses over them and clicks on them.

    Also -- I think something like my script should be a native part of TMP. Links presently require a lot of obscure boilerplate to work properly; that script took quite a bit of research and trial&error to get working.
     
  13. iitiaralunaii

    iitiaralunaii

    Joined:
    Feb 6, 2021
    Posts:
    1
    I have a problem with TextMesh Pro. There is a T which is always there and I can't get rid of it no matter what I do
     

    Attached Files:

  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Gizmos and icons in the Scene View can be controlled via the Gizmos tab in the Scene View as seen below.

    upload_2021-2-10_23-6-46.png
     
  15. questmill

    questmill

    Joined:
    Jan 30, 2015
    Posts:
    9
    Maybe I found a bug regarding very long urls in links of TMP Text UI. I guess the link url may only be 120 characters long. My example was this:

    <link="https://artsandculture.google.com/s...-den-augen-seiner-zeitgenossen/kwHWUknNmEIgcA"><color=blue>https://artsandculture.google.com/s...-den-augen-seiner-zeitgenossen/kwHWUknNmEIgcA</color></link>

    And it did not work correctly. But as soon, as I recuced the link length to 120 characters is rendered the the text correctly. This happended the same with other links.

    Thanks for feedback,

    Holger
     
  16. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There is indeed a limit of 120 characters in the link tags.

    The format of the link tag is <link="ID">Some text description</link>. This ID simply represents a unique key for the link itself. Ie. the link ID for instance could be "URL01" which in a dictionary would be associated with a value / link that is however long you need it.

    In the code that handles what to do with a given link, a simply lookup of the link ID would enable you to use a link value of any number of characters without impacting parsing performance.

    See the following post related to the above.
     
  17. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Huh, I didn't know that. Would it be possible to lift that limit? For simplicity, I'm using link IDs as link URLs -- so my link to https://unity.com, for example, has a link ID of
    https://unity.com
    . Obviously, URLs can easily go over 120 characters. Creating a lookup dictionary is an unnecessary complication to my code that I'd rather not have to write and maintain, so it would make my life a lot easier if there wasn't an arbitrary limit to link ID length.
     
  18. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I do plan on adding a new "href" attribute to the <link> tag. This new "href" attribute would not be parsed and therefore not have any limitation on character count.

    I am hoping to get that into one of the next preview releases. Not the first but most likely subsequent releases.
     
    cxode likes this.
  19. Zmadnesss

    Zmadnesss

    Joined:
    Jan 21, 2019
    Posts:
    1
    The TMPRO_INPUT_FIELD has a nasty bug that reverts the Transition's normal color back to it's default white color after changing it succesfully by script and than have it selected. Thus you cannot change the normal color since it reverts back. Fix please =P
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please take the time to submit a bug report with project as this makes it easier to track / not get lost in the numerous posts on the forum.
     
  21. NuroKratz

    NuroKratz

    Joined:
    Feb 6, 2020
    Posts:
    1
    Hi. I am having an app containing both Cyrillic (greek) letters and Latin letters. TMP has mostly not problems showing them individually, except for some upper case letters apparently (Fig 1. with spaces in between), but that is another bug I have to address.

    Screenshot 2022-04-29 092959.png

    The problem that brought me here, is that party of word I use disappear, when certain letters come after each other. So far I have identified:
    τ - ο
    τ - ά
    τ - ώ
    ζ - ω (Fig. 2)
    λ - α
    κ - α
    θ - λ (Fig. 3)
    upload_2022-4-29_10-0-12.png

    upload_2022-4-29_9-59-8.png

    Disabling the Kerning does fix the problem. So is there a setting to adjust the kerning per character or is this just a bug?
     
  22. aplusm

    aplusm

    Joined:
    May 4, 2018
    Posts:
    4
    With version 3.2.0-pre.3 and Unity 2020.3.35f1, a nullReferenceException occurs with the following code:


    Code (CSharp):
    1. int atlasSize = 512;
    2. string characters = <A_LONG_STRING> //that does NOT fit in a single atlas.
    3. TMP_FontAsset fontAsset = TMP_FontAsset.CreateFontAsset(font, 60, 6, UnityEngine.TextCore.LowLevel.GlyphRenderMode.SDFAA, atlasSize, atlasSize, AtlasPopulationMode.Dynamic);
    4. fontAsset.TryAddCharacters(characters); <-- Exception occurs here.
    The stack trace is:

    NullReferenceException: Object reference not set to an instance of an object
    TMPro.TMP_FontAsset.SetupNewAtlasTexture () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMP_FontAsset.cs:2859)
    TMPro.TMP_FontAsset.TryAddGlyphsToNewAtlasTexture () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMP_FontAsset.cs:2777)
    TMPro.TMP_FontAsset.TryAddCharacters (System.String characters, System.String& missingCharacters, System.Boolean includeFontFeatures) (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMP_FontAsset.cs:2098)
    TMPro.TMP_FontAsset.TryAddCharacters (System.String characters, System.Boolean includeFontFeatures) (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMP_FontAsset.cs:1915)


    The same code/parameters works OK with TextMeshPro V3.0.6
     
    Last edited: Jun 7, 2022
  23. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thank you for reporting the issue.

    Here is the simple fix for this issue. Note the line numbers will be slightly different between our versions.

    upload_2022-6-7_16-22-14.png

    You will need to make the change in the Global Package cache in order to make it persistent.

    This fix will be included in preview 4.
     
    aplusm likes this.
  24. aplusm

    aplusm

    Joined:
    May 4, 2018
    Posts:
    4
    Hi,

    With version 3.2.0-pre.3 and Unity 2020.3.35f1, we're having issues with the caret behaviour in textField.

    We identified 2 differents issues that we report here, with associated videos recorded on iPhone 12Pro.

    1/ The first issue occurs when quickly typing text inside the textField that cause the caret to be at the wrong position.

    The video of the issue: https://www.dropbox.com/s/vjy8hgbkcwpbi7f/tmp_issue1.mov?dl=0

    2/ The second ocurrs when keeping the delete button pressed: The caret goes to the first position but the text is NOT deleted.

    The video of the issue: https://www.dropbox.com/s/z3hhjiga6pp7gkz/tmp_issue2.mov?dl=0

    Thank you.
     
    josephwilk likes this.
  25. aplusm

    aplusm

    Joined:
    May 4, 2018
    Posts:
    4
    Hi @Stephan_B ,

    Did you get a chance to take a look at my previous post regarding the caret issues ? We can provide more insights/videos if needed.

    Thank you
     
  26. josephwilk

    josephwilk

    Joined:
    Feb 22, 2017
    Posts:
    1
    I'm having the same problems as @aplusm building for IOS and using TextMeshPro input fields. This is with a vanilla input field thats created without any additional scripting.

    >1/ The first issue occurs when quickly typing text inside the textField that cause the caret to be at the wrong position.

    I'm running Unity 2021.2.14f1.4469 and I've tried with TextMeshPro 3.0.6 and TextMeshPro 3.2.0-pre.3.
    My App is building and running on IOS.

    The jumping of the caret on normal input speeds makes it difficult to continue to use the input field on IOS. The only hack around it I have is to turn off "Hide mobile input" and in that case there is no caret jumps on input (since you are not really using the input field but the native OS X input field). The reason it's a hack is you see two input fields visible which is not the greatest user experience.
     
    aplusm likes this.
  27. Joen-EyeJustRead

    Joen-EyeJustRead

    Joined:
    Dec 16, 2020
    Posts:
    2
    @Stephan_B Where can I submit pull requests for TMP ?
     
  28. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The package repository is not public but you can always send me the proposed code changes via PM.
     
    Joen-EyeJustRead likes this.
  29. Donchesster

    Donchesster

    Joined:
    Nov 19, 2019
    Posts:
    1
    Using Unity 2019.4, TextMeshPro 2.1.6
    I think I found problem with text in Input Field, basically if you try to match any text, that you input in editor, using TmProInputField, it doesn't match same strings/integers values, but if you do it in inspector, or code, it works fine

    I tried matching integers using int.Parse(), int32 and strings with ToString(), and none of them did work

    Also, it works fine with simple Inputfield text, but not TextMeshPro
     

    Attached Files:

  30. N4ma3

    N4ma3

    Joined:
    Nov 1, 2017
    Posts:
    3
    Hi!

    I think there's a bug in the sprite character system, if a character index and a glyph ID have different values, it appears to throw an out of range exception:
    upload_2023-3-23_17-17-16.png

    From what I've seen, the error happens here in Version 3.2.0-pre.3:
    upload_2023-3-23_17-17-53.png
    Seems to me that it is because m_spriteIndex is initialized with the value glyphIndex (aka Glyph ID) instead of the character Index, which can be completely out of the spriteCharacterTable bounds.