Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

TextMesh Pro *** 3.2.0-pre.4 Release Now Available! ***

Discussion in 'UGUI & TextMesh Pro' started by HugoBD-Unity, Dec 19, 2022.

  1. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    We've got a bug to report! Emoji in a TMP UGUI component that uses a text style which uses a different font often causes the following error:

    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. TMPro.TMP_Text.PopulateTextProcessingArray () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.4/Scripts/Runtime/TMP_Text.cs:2233)
    3. TMPro.TMP_Text.ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.4/Scripts/Runtime/TMP_Text.cs:1999)
    4. TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.4/Scripts/Runtime/TMPro_UGUI_Private.cs:1713)
    5. TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.4/Scripts/Runtime/TextMeshProUGUI.cs:216)
    6. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/CanvasUpdateRegistry.cs:215)
    7. UnityEngine.Canvas:SendWillRenderCanvases() (at /Users/bokken/build/output/unity/unity/Modules/UI/ScriptBindings/UICanvas.bindings.cs:96)
    8.  
    It's not 100% consistent, but we find we can trigger it pretty reliably in a scene with a single TMP component by jumping in and out of play mode and changing the text style. Changing to a text style that uses the same font (or even font variants - using a font file with different weights) doesn't cause the error.
    Based on the fact that it sometimes works, and that it only stops working when we jump in and out of play mode repeatedly we would guess there's some sort of weird caching error going on.
     
    Muckel likes this.
  2. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    Oh! And while I'm at it; we've found that text styles that use a different font (again, font assets that are just variants for weight/italics etc seem fine) aren't reliable. Sometimes they render in a jumbled up way. We only see these issues when the font from the style is different from the one set in the Font Asset field.
     
    Muckel likes this.
  3. frekons_unity

    frekons_unity

    Joined:
    Sep 6, 2018
    Posts:
    17
    upload_2023-3-5_15-10-29.png
    %50 of the PC users is affected by this bug in our game. Version: 3.0.6
    Also we are not sure to use 3.2.0 pre 4. AS it says it's not ready for production and do not use it in production
    What should we do? We like the 3.0.6 version, the supported font etc. we do not want new emoji things etc. we want to stay at 3.0.6 version but can you provide the fixes to 3.0.6 version?
     
    Last edited: Mar 5, 2023
    Muckel likes this.
  4. LukeImmersive

    LukeImmersive

    Joined:
    Feb 21, 2019
    Posts:
    5
    I am encountering an issue with the Kerning setting for Hebrew test.
    For example "כריס שבוע טוב מה שלומך?" is displaying incorrectly when Kerning is enabled with characters overlapping. This seem to be an issue with all fonts from what I can see.
    Note: This wasn't the case with Kerning enabled in the previous version so I assume this is related to the change to Font Features.

    Kern Off

    Kern On
    Capture 2.PNG
     

    Attached Files:

  5. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    We looked into it, but were not able to reproduce the issue. If you can reproduce consistently, could you log an issue using the bug reporter ?
     
  6. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    Gotcha! Took the time to put together a minimal repro; would love for this one to get fixed before the official release!
    Issue is IN-35240.
     
    Muckel and HugoBD-Unity like this.
  7. holahyunsik

    holahyunsik

    Joined:
    Apr 20, 2019
    Posts:
    5
    Hi @HugoBD-Unity

    I'd really like to know when this iOS emoji problem will be fixed?
    For Android I just look for the emoji font in the device and use that instead of adding the font file to the project - this is the best way to handle emoji because emoji fonts tend to be way way too big.

    It works fine for Android but iOS on the other hand can't do this and makes the app size about 250mb bigger.
    The game I'm developing is a very lightweight, teeny tiny 2D game so it should be under 50mb but because of this whole iOS emoji thing, it ends up being over 300mb which is ridiculous for such a small game.

    • Dynamic OS FontAsset has limited support on some iOS devices. The Apple Color Emoji font file found on OSX and several iOS devices works fine. However, the Apple Color Emoji-160px found on newer iOS devices is not support as the emoji's are encoded in JPEG format which is not supported by FreeType.
    I'd love to get rid of Apple Color Emoji so I can simply find the font, make use of that and keep the app size small.
     
    Muckel likes this.
  8. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    We'd also like to hear about the plan for this! We're currently prototyping but when we enter full production we're going to need a solution if we continue.
     
    Muckel likes this.
  9. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    227
    The size is one issue but I struggle to see how using Unity solution is viable anyway when it doesn't even support most emojis in the first place.
     
    Muckel likes this.
  10. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    463
    i'll don't get it....
    how long do we ask for true emoji support?
    we have 23 now... and still nothing serious...
    btw... those Atlas are also huge for TMP to use... over 10MB each... now...
    Text and Scroll rect are the biggest issues when working with Unity
     
  11. holahyunsik

    holahyunsik

    Joined:
    Apr 20, 2019
    Posts:
    5
    @HugoBD-Unity are you there?
     
  12. holahyunsik

    holahyunsik

    Joined:
    Apr 20, 2019
    Posts:
    5
  13. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hi @holahyunsik! Sorry for the delayed response. Unfortunately, I can't give a precise ETA on it. One thing that would help is logging a ticket for it. Other users can also vote on it, which helps with visibility and prioritizing the issue. (see how to report a bug)
     
  14. Tricnic

    Tricnic

    Joined:
    Apr 6, 2014
    Posts:
    6
    I am facing a bug on the Quest 2 relating to TMP_InputField deselecting itself when shouldHideSoftKeyboard and/or shouldHideMobileInput are set to true. Digging into the TMP_InputField code, it really feels like this line of code in LateUpdate on line 1537 is the culprit.

    Code (CSharp):
    1.  
    2.             if (InPlaceEditing() && isKeyboardUsingEvents() || !isFocused)
    3.             {
    4.                 return;
    5.             }
    6.  
    On Android platforms:
    InPlaceEditing() will return true if TouchScreenKeyboard.isSupported (always true on Android) and either shouldHideSoftKeyboard or shouldHideMobileInput is set to true.

    Code (CSharp):
    1.  
    2.         private bool InPlaceEditing()
    3.         {
    4.             if (Application.platform == RuntimePlatform.WSAPlayerX86 || Application.platform == RuntimePlatform.WSAPlayerX64 || Application.platform == RuntimePlatform.WSAPlayerARM)
    5.                 return !TouchScreenKeyboard.isSupported || m_TouchKeyboardAllowsInPlaceEditing;
    6.  
    7.             if (TouchScreenKeyboard.isSupported && shouldHideSoftKeyboard)
    8.                 return true;
    9.  
    10.             if (TouchScreenKeyboard.isSupported && shouldHideSoftKeyboard == false && shouldHideMobileInput == false)
    11.                 return false;
    12.  
    13.             return true;
    14.         }
    15.  
    That's all good. If you want to handle the input yourself, set one of those two properties to true, but...

    isKeyboardUsingEvents() will never return true on Android due to this:

    Code (CSharp):
    1.  
    2.         private bool isKeyboardUsingEvents()
    3.         {
    4.             switch (Application.platform)
    5.             {
    6.                 case RuntimePlatform.Android:
    7.                 case RuntimePlatform.IPhonePlayer:
    8.                 case RuntimePlatform.tvOS:
    9.                 #if UNITY_2020_2_OR_NEWER
    10.                 case RuntimePlatform.PS4:
    11.                     #if !(UNITY_2020_2_1 || UNITY_2020_2_2)
    12.                     case RuntimePlatform.PS5:
    13.                     #endif
    14.                 #endif
    15.                 case RuntimePlatform.Switch:
    16.                     return false;
    17.                 default:
    18.                     return true;
    19.             }
    20.         }
    21.  
    What this means is that "InPlaceEditing() && isKeyboardUsingEvents()" will never be true on Android. The problem if statement will only ever be true if the input field is not focused.

    I think the if statement should be changed to:
    Code (CSharp):
    1.  
    2.             if (InPlaceEditing() || isKeyboardUsingEvents() || !isFocused)
    3.             {
    4.                 return;
    5.             }
    6.  
    If someone has more info on this and has a good reason why it should be &&, I'd love to be enlightened, but my understanding of this bit of code is telling me it should be ||.
     
    Muckel likes this.
  15. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    463
    it's a joke... isn't it?
    sry but we pay a lot for Unity and we are professionals and we have customers who are waiting....
    damn i'll should had switched earlier to Unreal...
     
  16. jongin_unity

    jongin_unity

    Joined:
    Nov 22, 2022
    Posts:
    3
    @HugoBD-Unity
    I created a font asset with noto color emoji, but why is the sampling point size fixed at 109?
     
  17. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    294
    About ligatures. I was testing a cursive font in TMP, and to no surprise it didn't work very well, as the letters don't connect. I tried updating to this new version with ligature support, and while (at least) one instance is working, most of them are not. The font is Belle Allure (https://www.jeanboyault.fr/belle-allure/).

    First picture is from OpenOffice, this is how it should look. Second picture is from Unity using TMP-version 3.2.0-pre.4. As you can see, the "el" - pair is working, others are not. I'm using dynamic font asset and can see the "el" ligature in the font atlas, but for some reason nothing more is utilized. I'd expect all of them font since one does? Any ideas?

    in OpenOffice:
    upload_2023-4-25_9-10-6.png
    in Unity:
    upload_2023-4-25_9-10-12.png
     
  18. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hi @mh114! It seems like this Font is using Contextual substitution to implement the other features, which is currently not supported...
     
    mh114 likes this.
  19. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hello! This seems like a bug, can you open a ticket ? (How to report a bug)
     
  20. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    294
    Okay, thanks for clarifying. Is contextual substitution something that will be supported in TMP at some point, or..?
     
  21. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    It's definitely something we want to support at some point, but we can't share an ETA yet.
     
    mh114 likes this.
  22. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    212
    Input Fields with Validators work fine in Editor, but are broken on devices (iOS, Android). I am not able to input any text.
    Was working fine on a previous version
     
  23. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Thanks for bringing this up! Would you mind opening a ticket? We'll have a look. (How to report a bug)
     
  24. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    212
    Submitted! CASE IN-40706
    A bit offtopic, but wouldn't it make sense to ignore the Library folder when sending a bug report from within Unity? I just sent 1.5GB of data for a project that is less than 3MB
     
    HugoBD-Unity likes this.
  25. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    Is there an ETA on fixes for this version? We're having to perform a lot of awkward workarounds, but if fixes are coming soon we'll hold off.
     
  26. YD_JMysior

    YD_JMysior

    Joined:
    Aug 4, 2016
    Posts:
    46
    For anyone having issues with weird lines or character shapes - for me this turned out to be caused by outdated TMPro shaders. Updating the package in an existing project does not re-import these assets. To fix reimport the Essential Resources via Window/TextMeshPro/Import TMP Essential Resources.
     
    HugoBD-Unity and AndreaGalet like this.
  27. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    50
    Thanks for that
     
  28. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hi @tomkail_betterup! What specific fixes are you waiting for and are there tickets opened for these bugs ? It's the best way to ensure they get prioritized.
     
  29. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    82
    I submitted a report for IN-35240, I've also reported a few other bugs on this post too. Generally curious to know which of all the bugs that have been reported on this post are getting addressed in the next version!
     
    HugoBD-Unity likes this.
  30. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    50
    @HugoBD-Unity What about the issue with mobile input on webGL when the input field's context type is different from normal, example: decimal number?

    Error:

    Invoking error handler due to
    InvalidStateError: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.
    Error: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.
    at _JS_MobileKeyboard_SetTextSelection (...i hided this part for privacy
    /Build/farming_build.framework.js:10:234148
    at Object.touchEventHandlerFunc [as handlerFunc] (...i hided this part for privacy)
    at HTMLCanvasElement.jsEventHandler (...i hided this part for privacy)
     
    Last edited: Jun 5, 2023 at 11:08 AM
  31. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hi @tomkail_betterup! You can follow the status of each ticket using the Unity Issue Tracker. As you can see here, your bug hasn't been processed yet. We are picking bugs based on the user pain, but voting for an issue will also help to get it prioritized.
     
  32. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    410
    Hi @AndreaGalet! Please submit a bug, it's the best way to ensure we look into it. (How to log a bug)
     
  33. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    50
    HugoBD-Unity likes this.