Search Unity

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

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

  1. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    The 3.2.0-pre.4 package is now available via the Package Manager for Unity 2021.x or newer.

    In Unity 2021.x or newer, the package can be added by name as seen below.
    Untitled (1).png

    To take full advantage of some of the newly added features like Color Glyphs and the ability to extract Ligature, Kerning and Diacritical Mark data from source font files at runtime, you will need to use one of these newer releases of the Unity Editor: 2021.3.16f1, 2022.2.0b13 and 2023.1.0a15.

    Note that we anticipate this latest preview release to be the last version of 3.2.0 before it is released out of preview. For more information about the future of TextMesh Pro please refer to this post.

    Release Notes for 3.2.0-pre4
    • Fixed italic horizontal displacement of punctuation. (TMPB-133)
    • Updated Input Field to not restore the original text when the X in the HoloLens keyboard is pressed.
    • Fixed MissingReferenceException when changing scenes. See case TMPB-120 and forum thread for more info.
    • Fixed Undo operation not correctly undoing some newly created TMP objects. Case #1400391
    • Fixed glyphs not being drawn in the various font asset inspector tables although present in the glyph table until unselecting and re-selecting the font asset.
    • Fixed incorrect line breaking when using a mixture of Latin and CJK text.
    • Fixed potential NullReferenceException when creating font asset with multiple atlas textures. See forum post for details.
    • Fixed potential issue when using the <mark> tag in conjunction with Ellipsis.
    • Added new "Get Font Features" option in the Generation Settings of Font Assets to provide control over fetching of font feature data.
    • Fix potential duplication of Ligature data when using Dynamic Font Assets.
    • Added new "duospace" attribute to the <mspace=value> markup tag where the spacing of the '.', ':' and ',' characters will be half of the value. This was added as an option when displaying numerical values using this markup tag.
    • With the addition of support for new OpenType Layout features such as Ligatures, Mark-to-Base and Mark-to-Mark, we have made the following changes:
      • The "Kerning" option in the Extra Settings of the text component inspector has been replaced by a new popup menu to independently control these features which are "kern", "liga", "mark" and "mkmk"
      • The "enableKerning" property has been deprecated and replaced by the "fontFeatures" property which is a list that contains which features are enabled on the text component.
    • Fixed two potential NullReferenceException related to missing material references or materials on SubMesh text objects. See forum post for details.
    • Fixed for text alignment mode Justified and Flush blending not working correctly when using <NBSP> in the text.
    • Fixed external keyboard on iOS/tvOS and Android when Hide Soft Keyboard is used
    See ChangeLog in Package Manager for changes contained in previous releases.

    Changes Worth Noting
    Untitled (2).png

    Untitled (3).png

    Upgrade Notes
    • The Kerning field from the TMP_Settings and the TextComponent has been deprecated and replaced by the FontFeature field. These will be upgraded automatically, but usage of this field through scripting will have to be updated manually.
    • The “Examples & Extras” resources will have to be reimported to remove the warnings in some scenes.

    Please post any potential issues you uncover with this latest release in this thread.
     

    Attached Files:

    DevDunk, cxode, DragonCoder and 8 others like this.
  2. dujimache123

    dujimache123

    Joined:
    Sep 8, 2020
    Posts:
    10
    3.2.0-pre4 doesn't support emoji modifier???
     
  3. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    seems like it
    upload_2022-12-22_14-12-35.png

    upload_2022-12-22_14-36-42.png
     
    Last edited: Dec 22, 2022
    HugoBD-Unity likes this.
  4. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    in documentation :
    • Include emojis in text through their Unicode. For example, enter \U00001f60 to represent a smile.
    The correct text is :
    • Include emojis in text through their Unicode. For example, enter \U00001F600 to represent a smile.

    however, why emojipedia and every other sites uses U+1F600 and Unity uses U00001f600 ?

    upload_2022-12-22_17-0-32.png
     
    Last edited: Dec 22, 2022
    HugoBD-Unity likes this.
  5. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    When I copy paste an emoji inside my TextMeshPro it does display in the scene but it does not display in the inspector : upload_2022-12-22_16-57-58.png
     
    Thygrrr likes this.
  6. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    The U+ is a notation to represent the Unicode code point while the other is an escape sequence. It's part of other escape sequences (\n, \t, \r...). Here's a wiki article on escape sequences.

    Indeed! We've added support for emojis to TextMeshPro, but the editor itself, prior to 2023.1, uses a different TextEngine called TextNative that doesn't support emojis nor UTF-32. We are currently in the process of bringing those capabilities to the editor for 2023.1+.

    And thanks for raising the issue with the doc. I'll make sure this is addressed!
     
    karl_jones and Fangh like this.
  7. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    @HugoBD-Unity btw, is there any workaround for the chain context limitation. Are there plans to support it eventually?
     
  8. yumehik0

    yumehik0

    Joined:
    Sep 9, 2020
    Posts:
    1
    Are there any plans to support "palt" features?
    Most professional Japanese fonts use "palt" features for kerning. This means that kerning of Japanese fonts cannot be done with "kern" features alone.
     
  9. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    For now, we only support a subset of all Opentype font features. (kern, liga, mark and mkmk). We've decided to release this version even with partial font features support as it still provides substantial value. We are looking to keep improving our font feature support but unfortunately, I can't provide a timeline yet.


    More precisely, here's how it impacts emojis support:
    • Emoji ZWJ Sequences are not supported. (link)
    • Country Flags are not supported.
    • Emoji modifiers are not supported.

    A potential workaround would involve manually adding a ligature for a specific sequence we want to substitute. This requires opening the Font and adding the corresponding glyph index. For instance, here's how I would create a ligature for the US flag:
    CleanShot 2023-01-03 at 14.01.09.png
     
    jiraphatK likes this.
  10. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    Hi HugoBD,

    I don't know what happened. I upgraded to 2022.2.1f and I get an error with the package:
    Library/PackageCache/com.unity.textmeshpro@4.0.0-pre.1/Scripts/Runtime/TMP_Text.cs(2814,35): error CS0029: Cannot implicitly convert type 'uint[]' to 'int[]'

    How did this get into the non-beta version of Unity? Please advise.
     
  11. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    106
    We upgraded to 3.2.0-pre.4 for emoji support! It works for us in editor, will be testing in builds later!

    Here's some feedback:
    1. Like Fangh we're also finding that the unicode string given in the docs doesn't render as expected. Here's a copy paste of two characters - one is an emoji (however the heck these are actually formatted), the other is the unicode string \U00001f60, as given on the docs. Fangh's suggestion of adding an extra 0 didn't work for us (it just adds a 0 character)
      upload_2023-1-5_10-4-53.png
    2. Working out how to add the emoji font file was a bit tricky. The instructions are reasonably clear but prior to this I had no idea that I'd need a font file, or even that emoji were stored in font files. Can you please supply an open source emoji font file in the package or linked on that page to help people get started? Fonts/unicode is confusing, and expecting devs to have too much knowledge on how they work might limit some folks.
    3. Wow, emoji fonts are HUGE! I can see that it's building a texture dynamically as emoji are used in editor, but I'm not sure what this means for development. It doesn't look like emoji are ever removed from this texture, even when they're no longer in a piece of text? What does this mean for users adding emoji at runtime? Some documentation on how we're supposed to work with this setup would be hugely appreciated! For now we're just going to have a piece of text offscreen with all the emoji we need to work dynamically at runtime, and just eat the cost of the ones we once-used-but-now-arent.
    4. A demo scene showing emojis working would be massively appreciated!
    5. Not being able to see emoji in the TMP editor text field makes them very difficult to work with! Since 2023 is quite a long way off, can I suggest replacing the current "no space character" with something that allows them to be read?
     
    hsiunien and Johannski like this.
  12. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    It's a known issue. We are planning a new release of TMP 4.0 shortly (couple of weeks). It will contain the latest changes, emojis & font feature support, and bug fixes. Sorry for the inconvenience.
     
    MousePods likes this.
  13. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Big thanks for the feedback @tomkail_betterup!
    • It's a good idea, we'll add an example scene for getting started with emojis.
    • More thorough documentation for Dynamic FontAsset would indeed be welcome. In the meantime, here's what we have. Some information on what's a Dynamic FontAsset here and on ClearDynamicData here. Clear Dynamic Data is used to ensure the atlas is cleared before bundling the resource in a build.

    If you fear the atlas will fill up quickly, you can enable Multi Atlas Textures on the Font Asset. It's also covered in the aforementioned documentation.
     
  14. Dasp

    Dasp

    Joined:
    Sep 25, 2012
    Posts:
    38
    Are there plans to properly support addressables and TMP together?
     
  15. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    106
    We've just upgraded in another project and we're finding that our fonts no longer show. Downgrading resolves the issue. We've seen this issue in the past, but we can't seem to find a solution this time. Fonts in the examples folder still work, but fonts that we import render as shown below.

    upload_2023-1-9_16-24-0.png
     
    Menion-Leah likes this.
  16. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @tomkail_betterup!

    It's the first time I see this issue. Could you report a bug through the Unity Bug Reporter and paste the ticket in thread ? I'll have to investigate further.
     
  17. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,090
    Maybe change topic of this thread as it's conflicting. I thought it's about TMP 4.0.

    Speaking of emojis, I wish they would work on forums. These look like some 2005 forum: :);):(:mad::confused::cool::p:D:eek::oops::rolleyes:o_O
     
    Ruslank100 and HugoBD-Unity like this.
  18. Krzys292

    Krzys292

    Joined:
    Jan 14, 2023
    Posts:
    3
    Hi!
    While working with latest TMPro release, I've experienced a problem. Whenever I try to set the text with SRP shader to bold, an error "Material 'Arial Material' with Shader 'TextMeshPro/SRP/TMP_SDF-URP Lit' doesn't have a float or range property '_ScaleRatioA' " appears. In result, the letters are not thicker, they are just farther apart from each other.
    What should I do to fix this? I am using TMPro 3.2.0-pre.4 on Unity 2020.3.7f1 and URP 10.4.0. I've already tried to remove the package and reinstall the shaders, but nothing seems to help. Thank you :)
     
  19. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    106
    Got it! I had to reimport TMP Essential Resources. Might be worth this happening automatically, or flagging a warning, or something?
     
  20. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @kwybor123! I think it's the same issue, can you try reimporting the TMP Essential Resources ?

    Your issue seems similar to the one in this thread
     
  21. Swah

    Swah

    Joined:
    May 13, 2015
    Posts:
    80
    Hello,

    We would love to use the emoji support for our currently live game. Using a preview version seems risky though so:
    - what is the expected release date of 3.2.0?
    - is this preview version quite stable? We likely wouldn't ship with it, unless developers using it here are pretty confident. Or if the unity team says it's tested and ready to go, but not official because they need to add something unnecessary like support for a niche platform.

    Thanks!
     
    Last edited: Jan 17, 2023
  22. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @Swah! We are looking to verify 3.2.0 around May 2023.

    New features such as Emojis and FontFeature are what need more ironing. Except for those, my confidence level is quite strong. 3.2.0 has been out and used by many for some time now.
     
    Swah likes this.
  23. Krzys292

    Krzys292

    Joined:
    Jan 14, 2023
    Posts:
    3
    I've already tried many times to delete and reimport the shaders, now I removed the entire TextMesh Pro folder and imported all of the TMPro Essential Resources, but the problem is still there. The solution in the thread that you linked (manually adding float property in the shader graph) gets rid of the console error, however it still doesn't allow me to make the text bold.
     
  24. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
  25. LukeLitman

    LukeLitman

    Joined:
    Jun 9, 2015
    Posts:
    6
    Curious if anyone else is still tinkering around with this?

    I have tried several color emoji fonts including "NoTo Color Emoji" and "Apple Color Emoji". Neither of these show up in the editor(2121.3.12f1) or on iOS. I've even tried these fonts in Unity 2023 without any luck.

    I've managed to get the black and white fallbacks of the "EmojiOneColor" font showing up in the editor and on iOS, but would definitely prefer color emojis if possible! Has anyone found a decent free/paid color emoji font that works?
     
    Last edited: Jan 23, 2023
  26. theembracedone

    theembracedone

    Joined:
    Jul 31, 2019
    Posts:
    22
    I imported the preview as per OP in a new project using version 2023.1.0b1 to test out font features (specifically kerning) on a font (Cormorant Garamond). Unlike in my normal project which is on 2021.3.9f1 using tmpro version 3.0.6, it does import the contents for the Glyph Adjustment Table:

    However when used on a TextMeshProUGUI component, kerning wont work regardless of which "font features" I have on (Everything or just kern). I reimported the tmpro package and regenerated the font asset to no avail. Any ideas?

    This is what it looks like on a TextMeshProUGUI with "Everything" enabled:
    NDMvqOGsid.png

    Here's the same thing with "Nothing" selected:
    TeamViewer_3tlkUrwG29.png

    And this is what it should look like (picture taken in LibreOffice Writer):
    upload_2023-1-25_20-40-54.png

    It seems like SOME of the kerning works, note the "Ty" in the last row and all the example pairs starting with "Y", but the fffff and pairs starting with "Q" remain completely unchanged. Why could this be?

    Here's a gif of the two for ease of comparison:
    TeamViewer_inMfsk1RsR.gif
     
    Last edited: Jan 25, 2023
  27. Yi-GPS

    Yi-GPS

    Joined:
    Jan 21, 2020
    Posts:
    5
    @HugoBD-Unity I'm trying to test out the color emoji feature but not seeing the Color option when I try to create the font assets. I'm not seeing the `Color` option nor a `Color` render mode. It only shows up when I try on Unity 2022
    Is that not supported on Unity 2021?
    Screenshot 2023-01-25 at 11.03.08 PM.png Screenshot 2023-01-25 at 11.03.26 PM.png
     
  28. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    A new version of NotoColorEmoji was recently released to support Unicode 15. Unfortunately, the new version uses a new Color Glyph format that currently isn't supported by FreeType. Hence, it's currently not supported. Sorry for the inconvenience it's an issue that was recently discovered.

    As for the issue with the Apple Color Emoji on iOS, you may need to use Dynamic FontAsset instead of Dynamic OS FontAsset. For more info, have a look at the current known limitations:

     
  29. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Make sure you use one of these newer releases of the Unity Editor: 2021.3.16f1, 2022.2.0b13 and 2023.1.0a15.
     
  30. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    That is good news! Its been about a month. Is there any news? Really need to update :)
     
  31. theembracedone

    theembracedone

    Joined:
    Jul 31, 2019
    Posts:
    22
    Sorry for the tag @HugoBD-Unity but any idea what might cause the issue I described in reply #26 please?
     
  32. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    hello,
    well with emoji so works but when i'll insert them via code... the text line jumps and i'll also see a rectangle before the emoji appears... any chance to fix that?
    here is a link to a video that shows the effect:
    can do what i'll want... the line jumps...
    use the Apple Color Emoji
    https://www.smart-app.dev/Down/TMP_Emoji_jump.mov

    thx
    M.
     
    HugoBD-Unity likes this.
  33. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    471
    hello,
    if you use the Apple Color Emoji ....
    your build size becomes 10 x more ...
    like if you have 50MB normally... with Apple Color Emoji it becomes 500Mb !!!
    this is not working... :-(
    how long do we wait for native emoji support in Unity?
    dissapointed
    M.
     
  34. amateurd

    amateurd

    Joined:
    Nov 1, 2016
    Posts:
    97
    Some imported fonts that worked before don't work anymore (characters replaced with odd shapes). Those that work have a strange highlight at the bottom. Reverted for now.
     
  35. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @theembracedone sorry for the delays. We currently only have basic open-type font feature support. Meaning we only support Kerning, Ligatures and Diacritical Marks. I looked at the Cormorant Garamond font and "Qa", "Qi",... are not ligatures. It seems like ligatures are disabled in the screenshot you share as I tried locally and the "ff" was properly replaced.

    CleanShot 2023-02-07 at 16.00.37@2x.png
     
  36. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi all,

    Unfortunately, I have to inform you that the new Color Glyph and Opentype Font Feature support won't be available for the 2020.3 version. We encountered some challenges while trying to backport the feature, making it more difficult than we initially thought. Therefore, we've decided to prioritize fixing bugs and implementing other features instead.

    Apologies for any inconvenience this may cause.
     
  37. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Thanks a lot for raising the issue, we'll have a look! Could you log a bug for it ? (See how to report a bug)
     
  38. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    Is there any news on 4.0.0.pre2? It has been about a month and I still cannot update to 2022.2.
     
  39. abhi3188

    abhi3188

    Joined:
    Dec 13, 2015
    Posts:
    31
    After upgrading to TMP 3.2.0-pre.4, all the text in my app has got this weird underline.

    Any ideas what would be causing this?

    I'm using Unity 2022.2.1f

    Edit: Solved: I had to do Window > TextMeshPro > Improve TMP Essential Resources
     

    Attached Files:

    Last edited: Feb 17, 2023
    Zer0ne7 likes this.
  40. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    TMP 4.0.0-pre2 has been released, and you should be able to upgrade through the package manager.
     
    TomTheMan59 likes this.
  41. urginsan

    urginsan

    Joined:
    Sep 22, 2013
    Posts:
    3
    Hi!
    Please, help me. Im trying 2 days to fix this =(
    Screenshot_1.jpg
    Screenshot_2.jpg
    Screenshot_3.jpg

    Two tmpro text fields use apple color emoji font.
    Upper text font asset render mode = COLOR
    Bottom text font asset render mode = SMOOTH

    But emoji is grayscale, and never not have a color :(

    Atlas population modes = Dynamic
    Shaders on font assets = TextMeshPro/Sprite
    Fallback emoji text assets include this fonts in Project Settings
    Tmpro version = 4.0.0-pre.4
    Unity version = 2023.1.0a26 (Also trying 2023.1.0b4, 2023.1.0a15)

    Maybe i have font import error?

    Thanks, best wishes!
     
  42. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @urginsan!

    I presume you are using 3.2.0-pre-.4 as 4.0.0-pre.4 is not yet released :)
    Can you ensure the atlas texture on the Apple Color Emoji Font Asset is RGBA ?

    Otherwise, it's hard to tell, if you can reproduce consistently it might be worth logging a bug. (How to report a bug)
     
  43. urginsan

    urginsan

    Joined:
    Sep 22, 2013
    Posts:
    3
    Hi, HugoBD-Unity! Thanx for answer!
    Yes, my mistake - i use 4.0.0-pre.2 (not pre 4)

    How i can change atlas texture format?
    This texture not have format settings :(
     

    Attached Files:

  44. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    @urginsan I apologize for not being clearer. I highly recommend staying on 3.2.0-pre.4. TMP 4.0.0 is for users who use both UITK and UGUI in the same game as it allows reusing FontAsset between the 2 UI frameworks. For more info, there is a detailed explanation about TMP 4.0.0 in the package description.

    TextCore assets will start supporting Color Gyph in 2023.2.
     
  45. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    anybody knows how to solve this on 3.2.0-pre.4? it's pretty odd that tmpro isn't backwards compatible by default. I mean, text is one of the most fundamental things in Unity

    upload_2023-2-23_23-35-39.png

    attached the ttf and the generated SDF out of it
     

    Attached Files:

  46. frekons_unity

    frekons_unity

    Joined:
    Sep 6, 2018
    Posts:
    21
    @HugoBD-Unity in TextMeshPro 3.0.6 and 3.2.0-pre.4, there are problematic lines, many mobile users in our game is affected at the moment. We will try to fix it with reflection but it will be slow... Please make ActivateInputFieldInternal function protected virtual instead of private.

    Please add needed boundary checks while setting m_SoftKeyboard.selection
     
    Glader and HugoBD-Unity like this.
  47. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Btw for this TMP for both UGUI and UITK runtime UI, any plan to support SetText api that able to directly pass FixedStringxxx instead of required to convert to string and causing gc spike?
     
    Thygrrr likes this.
  48. jotapeh_

    jotapeh_

    Joined:
    Nov 16, 2012
    Posts:
    45

    I am seeing this same issue with the default LiberationSans Font. 2021.3.19f1, 3.2.0-pre4. upload_2023-2-28_14-33-16.png
     
    xucian likes this.
  49. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    They say they cannot reproduce it. what are your full specs?
    Mine are:
    CPU
    AMD Ryzen 7 5800X 8-Core Processor

    GPU
    NVIDIA GeForce RTX 2060 NVIDIA GeForce RTX 2060

    Operating System
    Windows 10 (10.0.19045) 64bit

    Selected Platform
    WebGLSupport
     
  50. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Found the fix for this particular problem:
    1. Delete the Plugins/TextMeshPro directory
    2. Reimport TMPro essentials
    3. Git diff to restore any overrides you’ve done previously
    Ofc, if you haven't made a backup and lost data, you deserve it (kidding, make a backup first!).

    Feedback to TMPro team: the popup should appear after any TMPro update, with the above instructions.