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.

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:
    46
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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:
    46
    I'm using unity 2021.3.10f1 currently
     
    teknolojipucu likes this.
  5. mikeymusch

    mikeymusch

    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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. mikeymusch

    mikeymusch

    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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. mikeymusch

    mikeymusch

    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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. mikeymusch

    mikeymusch

    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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. mikeymusch

    mikeymusch

    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. mikeymusch

    mikeymusch

    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:
    193
    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:
    193
    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:
    14
    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:
    228
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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:
    15
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    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:
    15
    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:
    6
    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:
    15
    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:
    15
    @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?