Search Unity

TextMesh Pro *** Preview 3 Release of Version 2.2.0 and 3.2.0 Now Available! ***

Discussion in 'UGUI & TextMesh Pro' started by Stephan_B, Mar 9, 2022.

  1. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    66
    Whats the status on the Emoji support now, it's been about 6 months since it was originally mentioned.

    Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    PR is going through the approval process. However, I uncovered an issue while doing additional testing but this should not delay the overall process.

    This still needs to be backported to previous version of Unity. I would expect perhaps another 30 - 45 days before this makes it into those Unity releases.

    What version of Unity are you currently using?
     
    mrtenda likes this.
  3. teknolojipucu

    teknolojipucu

    Joined:
    Sep 25, 2022
    Posts:
    1
    Hi;
    Will this 3.2.0 package support also WebGl input keyboard? in Mobile devices when we tab input text fields the screen keyboards are not working.
    We are working in a project and we stuck with this problem.
    in the Forums Unity solved this with the 3.2.0 version. So I am curious about this.
    When will the stable version release?

    Thanks
     
  4. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    66
    I'm using unity 2021.3.10f1 currently
     
    teknolojipucu likes this.
  5. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    Will the SDF-URP Lit shaders make it in to the next release? Been trying to get my world space text to receive shadows/lights, is there a simple way to achieve that or should I just wait for the SDF Lit shaders?
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The URP and HDRP shaders are already included in version 3.2.0-pre.3. They are included in the TMP Essential Resources which you will need to re-import.
     
  7. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    Sorry, I meant next full release, not prerelease. When I use the URP SDF List shader right now in a new URP project I get some console errors, but you're probably aware of that.
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I am not aware of any console error when using version 3.2.0-pre.3 with URP in Unity 2020.3 or newer.

    What error are you getting?
     
  9. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    Here were the steps I followed to yield this console error:
    1. Create new unity 2021.3.10f1 project
    2. Import 3.2.0-pre.3.
    3. Import URP
    4. Set SRP settings to use a URP asset
    5. Add some text to the scene
    6. Change the text's shader to use TextMeshPro/SRP/TMP_SDF-URP Lit
    7. Console error appears
    This is the error:
    Code (CSharp):
    1. Material 'LiberationSans SDF Material' with Shader 'TextMeshPro/SRP/TMP_SDF-URP Lit' doesn't have a float or range property '_ScaleRatioA'
    2. UnityEngine.Material:GetFloat (int)
    3. TMPro.TextMeshProUGUI:GenerateTextMesh () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMPro_UGUI_Private.cs:2364)
    4. TMPro.TextMeshProUGUI:OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TMPro_UGUI_Private.cs:1737)
    5. TMPro.TextMeshProUGUI:Rebuild (UnityEngine.UI.CanvasUpdate) (at Library/PackageCache/com.unity.textmeshpro@3.2.0-pre.3/Scripts/Runtime/TextMeshProUGUI.cs:216)
    6. UnityEngine.Canvas:SendWillRenderCanvases ()
    Back to the question at hand, will the URP Lit shader be ready for use in the next full release?
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I repeated the above steps in Unity 2021.3.11f1 and I am not getting those console errors.

    I also tested creating a new project using the 2D (URP) template and not getting any errors either.

    In terms of the stack trace above, at line 2361, the code does check if the material is using a shader with gradient scale and if it is then it would try to set the scale ratio. Since the SRP shaders do not use this property, it should not execute the code that produces the error in your case.

    Something is causing those errors to appear in your case and like I said before version 3.2.0-pre.3 has been available for a long time and used in many SRP projects (both URP and HDRP).

    Out of curiosity, what is the text that you are setting on the text component?

    Do you get the same errors if you create the new project using the 2D URP template?

    P.S. In theory, it is possible to get some temporary console errors when switching from a shader that was using the normal render pipeline to an SRP shader when that text object is using fallbacks. This is temporary in the sense when switching the first time. Re-updating the text or entering or existing play mode some resolve all of that.
     
  11. wvandierdonck

    wvandierdonck

    Joined:
    Sep 13, 2022
    Posts:
    3
    Is there an update on this? We're using version 2021.3.8f1 and would like to integrate better emoji support.

    From my understanding, TMP version 3.0.6 (the one we're currently using) supports emojis using sprite assets, however it does not support unicode sequences/modifiers. For example, we can't display the astronaut emoji since that's made up by combining the man + rocket emojis in a sequence.

    Would this new version with native emoji support address that? If so, is there a timeline on when it will be added to Unity version 2021.3.8f1
     
  12. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    The text just says, "New Text" as all I did was create it and then change the shader.

    Just to clarify, when I create a new project, i'm not using the URP template, just an empty 3D project
     
  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The latest release which is version 3.2.0-pre.3 includes support for Ligatures which is what Emoji Modifier Sequences are kind of defined as. So in conjunction with the support for color emoji where those will be part of a font asset which will now support Ligatures, you will be able to setup those Emoji modifier sequences.

    I don't know yet in which version of Unity 2021.3 in which it will land but it will be available on a future version of 2021.3.
     
  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Do you get the same issue if you create a new project using the URP template?

    Like I said, I am not getting those errors on my end so still trying to figure out how to reproduce the behavior you are getting on your end.
     
  15. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    Sorry been busy.

    Just tried replicating my steps with a 3D URP template project and NO, I don't get the console errors.

    Would love some help figuring out why.
     
  16. alcheMikey

    alcheMikey

    Joined:
    Feb 18, 2021
    Posts:
    30
    @Stephan_B I found it!

    Just set the text to bold and you should get the errors.
     
  17. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    upload_2022-11-12_22-29-26.png
    I tested 2022.2.b14 and it feels great not having to populate all these myself anymore.
    There are still some edge cases where it's not working but I think this save soooo much time already.
    BTW how do I use emojis? @Stephan_B

    Edit, manage to get emoji working by using NotoEmoji as a fallback in the setting. But I try using NotoColorEmoji and it doesn't work? not sure what happen there
     
    Last edited: Nov 12, 2022
  18. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    upload_2022-11-12_23-16-48.png

    The emoji extract from color font emoji is greyed out.
    Same for NotoColorEmoji
     
  19. sachinhello

    sachinhello

    Joined:
    Dec 27, 2018
    Posts:
    35
    upload_2022-11-15_18-9-38.png
    this is TMP_Inpufield
    @Stephan_B
    I got this error in adb logs when I select or deselect text
    2022-11-15 18:10:59.940 11082 11082 Error nogames.cards5 No package ID 3f found for ID 0x3f050001.
     
  20. TheZombieKiller

    TheZombieKiller

    Joined:
    Feb 8, 2013
    Posts:
    266
    In the latest 2023 alpha (2023.1.0a20) TMP_FontAsset.CreateFontAsset throws an exception in TMP_FontAsset.CreateFontAssetInstance because it tries to create a Texture2D with a width and height of zero (I'm surprised that it does this, I was under the impression that it was always invalid to create a 0-sized Texture2D)

    upload_2022-11-26_1-6-13.png upload_2022-11-26_1-17-47.png

    This is in package version 3.2.0-pre.3.

    Changing the code to create a 1x1 texture instead prevents the exception, however fonts now no longer render correctly.

    Changing the code to do "new Texture2D(0, 0)" without specifying a texture format also prevents the exception (this is special-cased in the Texture2D constructor, judging by the C# reference sources), but naturally causes other problems due to the texture format no longer matching what is expected.

    Since the texture validation checks were only introduced in 2023.1.0a20, it does not reproduce on 2023.1.0a19 and earlier.

    EDIT: Changing the texture creation code to:
    Code (CSharp):
    1. Texture2D texture = new Texture2D(1, 1, texFormat, false);
    and then changing all instances of:
    Code (CSharp):
    1. if (m_AtlasTextures[m_AtlasTextureIndex].width == 0 || m_AtlasTextures[m_AtlasTextureIndex].height == 0)
    to:
    Code (CSharp):
    1. if (m_AtlasTextures[m_AtlasTextureIndex].width <= 1 || m_AtlasTextures[m_AtlasTextureIndex].height <= 1)
    appears to "fix" the problem on 2023.1.0a20 for now, so there's a potential temporary solution for anybody else living life on the bleeding edge :)

    If you want to be thorough, you can also replace all instances of:
    Code (CSharp):
    1. fontAsset.atlasTexture.width != 0
    with:
    Code (CSharp):
    1. fontAsset.atlasTexture.width > 1
    in the editor code.
     
    Last edited: Nov 25, 2022
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This issue is due to a recent change from the Graphics team which they did not test against the TMP package. So instead of resetting the texture back to size zero, we now reset it back to size 1.

    This change will be in preview 4
     
    TheZombieKiller likes this.
  22. Carlo_H

    Carlo_H

    Joined:
    Sep 29, 2018
    Posts:
    5
    Hello,
    It seems the 3.0.6 and 3.2.0-pre.3. versions won't compile if you set the
    TMP_DEBUG_MODE define. Found this out when I was trying to test Inputfield caret functionality.
    Looks like this FallbackMaterial baseMaterial property may have been renamed?
    Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_MaterialManager.cs(666,56): error CS1061: 'TMP_MaterialManager.FallbackMaterial' does not contain a definition for 'baseMaterial' and no accessible extension method 'baseMaterial' accepting a first argument of type 'TMP_MaterialManager.FallbackMaterial' could be found
     
  23. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    We are currently using TMP 3.0.6. One potentially huge feature for us in 3.2.0 is the Dynamic OS fonts, as it would decrease our download size and significantly improve our memory usage for most players I believe. I'm wondering therefore how stable that feature is in the 3.2.0-pre.4 version. From comments in this thread, I understand that 'old' features are already stable, and it is the new features that need more time to settle. I'm wondering how safe it would be to release a production version of our game using just old (3.0.6) features + this one new feature. Can anyone comment from personal experience? @Stephan_B can you give any insight there? And does it feel like a final release of 3.2.0 is imminent that it would be worth holding off for?
     
  24. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Version 3.2.0-pre.3 has been available for quite a while now and I do consider it stables in terms of the core features and even the dynamic OS support.

    I would recommend upgrading to version 3.2.0-pre.4 as it contains additional improvements and fixes. Obviously be sure to thoroughly test it all. In the event you run into any issues, please be sure to report those. Keep in mind that you can always revert back to version 3.0.6 if you run into any major.

    As per the upgrade notes, you will need to update / re-import the TMP Essential Resources and TMP Examples & Extras when upgrading to these new packages. Failure to update the TMP Essential Resources will result in the text not rendering as the shaders have changed.

    I believe there will be additional preview releases of version 3.2.0 before it is taken out of preview so again I would consider using version 3.2.0-pre.4 especially if support for dynamic OS is beneficial for you.
     
    AndyBlock likes this.
  25. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    Great, that is what I was hoping to hear :) . I will give it a go before our next release, thanks for the info!
     
  26. dexhort

    dexhort

    Joined:
    Dec 18, 2021
    Posts:
    10
    Hi, I have questions about the 3.2.0 preview,
    I'm currently on Unity 2021.3, and the mark function won't work.
    I have ligatures just fine, but marks would take place correctly on the letter.

    The ligature table and mark Base Adjustement Table are populated just fine, but it doesn't work.
    Marks are written on the side like any other glyph.

    Is there a fix I need to do or it's just not working at all ?
     
    Last edited: Jan 15, 2023
  27. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    I'm looking at getting Emoji support into our game. I was trying to follow the instructions here for using color emojis:

    Set up color emojis
    Create a color font asset and add it to the TMP Settings Fallback. Note this is the same as the Project Settings/TextMeshPro/Settings as depicted in the image.
    1. In your project, import a font file that has color emojis in it.
    2. Right click in the Asset folder, and then select Create > TextMeshPro > FontAsset > Color. This ensures that you create the font asset with the right shader (Sprite) and the right atlas rendering mode (Color).
    For 1, I was using NotoColorEmoji-Regular.ttf from Google fonts. But trying to follow step 2, I don't see 'Color' as a FontAsset option. The only options in that menu are SDF, Bitmap and Font Asset Variant. I've tried creating an SDF font or a Bitmap font and playing with the settings, but haven't been able to get anything to work.

    We are using 3.2.0-pre.4 and Unity 2021.3.9f1. I tried reimporting the TMP essentials in case that helped, but no luck (I had done that already when upgrading to 3.2.0-pre.4 FWIW). @Stephan_B, any clue what I'm missing here? Thanks in advance,

    Andy
     
  28. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    @Stephan_B Any clues on the above? Or has anyone else here managed to get color emojis working with 3.2.0-pre.4 and could give me some pointers?
     
  29. unity_QJ7RazXzghZCzA

    unity_QJ7RazXzghZCzA

    Joined:
    Jul 9, 2021
    Posts:
    104
    I have randomly disappearing text in my UI elements. Why you are not releasing bug fixes? Why we should wait so long for major release just to get bug fixes?
     
  30. DuncrowLukas

    DuncrowLukas

    Joined:
    Jul 10, 2020
    Posts:
    2
    How can I upgrade to the latest preview version 3.2.0?
    I am on Unity 2021.3.18f1 and cannot see in the package manager. (I can see other preview packages just fine)
     

    Attached Files:

  31. timbo_unity

    timbo_unity

    Joined:
    Apr 29, 2022
    Posts:
    10
    upgrading from 3.0.6 just makes everything white boxes for me. upload_2023-4-1_10-47-36.png

    If I change to use the mobile variant, I get something closer to functional, but not quite there

    upload_2023-4-1_10-48-24.png

    I am on 2021.3.10, not sure if thats supported or not.
     
  32. ifightnoman

    ifightnoman

    Joined:
    Jan 15, 2022
    Posts:
    15
    @Stephan_B Same as @timbo_unity above, upgrading to any of the 3.2.0-pre versions wipes out all my TextMeshProUGUI objects (no characters are visible). The only SDF that works is LiberationSans, all of my own fonts are blanks. I've tried re-generating the SDF assets, no dice. This is on 2021.3.8f1, on an M1 Mac if that helps.

    Character table and glyph table appear correct, fwiw. But the editor shows nothing.
    Screen Shot 2023-04-04 at 1.35.35 PM.png

    Screen Shot 2023-04-04 at 1.33.39 PM.png Screen Shot 2023-04-04 at 1.33.52 PM.png
     
  33. KrisGayClipwire

    KrisGayClipwire

    Joined:
    May 26, 2021
    Posts:
    41
    Ran into something similar upgrading one of my projects. After checking that you're up to date with the Essential Resources (Window > Text Mesh Pro > Import Essential Resources) what I did was simply re-import all my font assets, then close out unity and re-open.
     
  34. ifightnoman

    ifightnoman

    Joined:
    Jan 15, 2022
    Posts:
    15
  35. ifightnoman

    ifightnoman

    Joined:
    Jan 15, 2022
    Posts:
    15
    @Stephan_B OK now trying to import an asset (the attached font) with ligatures and unfortunately I get an empty ligature table. Tested with 3.2.0-pre.4.
     

    Attached Files:

  36. unity_76B23670CAE5891C073A

    unity_76B23670CAE5891C073A

    Joined:
    Mar 16, 2023
    Posts:
    1
    Hello everyone

    I am facing issue in text mesh pro in unity version 2019.4.39f1. TextMeshpro 2.2.0-preview.3

    Facing issue in unity iOS build

    When I use input-field for my first input, everything works fine. But when I reset the text field using empty text through script, the second-time typed text is not visible in the input field.

    Reproduction step

    Step 1:Install Textmeshpro 2.2.0-preview.3, Unity version 2019.4.39f1

    Step2: Use the Textmeshpro input field and select HideInput filed.

    Step3: Create and Attach a script to button that can reset input field text by assigning empty text.

    Attach this to any button and call this function on Buttonclick () for resetting
    ResetText:MonoBehaviour
    {
    public TMP_InputField inputFiled;
    public void Reset()
    {
    inputFiled.text = "";
    }
    }

    Step4: Take iOS build and install

    Step5:Enter a huge number of characters in the input field.

    Step6: Call Reset() by clicking the button mentioned in step 3.

    Step7: After Reset, enter text again in the text field. Issue occurs The entered text is not visible in the input field.

    If anyone has faced this issue and knows any solutions, please let me know.
    Attacking screenshot:
     

    Attached Files:

    Last edited: May 1, 2023
  37. ryg81

    ryg81

    Joined:
    Jun 24, 2019
    Posts:
    5
    @Stephan_B I tried ligature feature in Version 3.2.0-pre.4 - December 16, 2022 on unity 2020.3.12f1.
    Every time I generate font, I have to add all ligatures manually again. Any way to overcome this such that it automatically generates ligature from fonts? I have to use unity 2020.3.12f1 as it's the base of a main big app.

    rahul
     
  38. Mr-Zhou

    Mr-Zhou

    Joined:
    May 4, 2016
    Posts:
    26
    I encountered the same problem, did you solve it?
     
  39. ryg81

    ryg81

    Joined:
    Jun 24, 2019
    Posts:
    5
  40. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    @Mr-Zhou Sorry for the late reply, but I'm afraid I haven't found a solution so far, no.
     
  41. KrisGayClipwire

    KrisGayClipwire

    Joined:
    May 26, 2021
    Posts:
    41
    The most recent NotoColorEmoji font does not work. I downloaded the Emoji 14 release of NotoColorEmoji and it did work for me.

    I believe it's related to the same issues that just using the device font on iOS has. If and when this will ever be fixed I don't think we can know since apparently the timelines for anything related to TMPro are blown out of the water now.
     
  42. hglaborious

    hglaborious

    Joined:
    Dec 14, 2021
    Posts:
    1
    Hi,
    In version 3.2.0-pre.5, (I'm testing in Unity 2021.3.29f1), there's an issue with the fix for incorrect line breaking when a hyphen '-' is preceded by a space. Case #1391990.

    On line 3488 in the TextMeshProUgui.cs we get an infinite loop with a non-incrementing index returning from RestoreWordWrappingState. This only happens if the hyphen minus is connected to another character and preceded by a space.
     
    Last edited: Sep 22, 2023
  43. qLate

    qLate

    Joined:
    May 3, 2019
    Posts:
    13
    I have the same problem, entering playmode just freezes the game, and when I launch unity again it freezes before editor even opens. I have to manually go to scene file and remove the minus sign from the text.

    Any updates on this?