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.

Please stop trying to make TextMesh Pro happen.

Discussion in 'UGUI & TextMesh Pro' started by chilton, Jul 3, 2022.

  1. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    505
    Every time I have to use TextMesh Pro, I regret it.

    I remember back when you implemented the current UI, and what a freakin' godsend it was, compared to other development environments. I *wish* I could get the same ease of use for a 2D non-gaming UI toolkit that I get out of Unity's UI. It's insanely powerful.

    And now you've stuck the most useful text feature, the UI.text object, in a "legacy" folder.

    Meanwhile, to use TextMesh Pro I have to import a bunch of crap, it never works right, it never lines up right, and it's hard to spell out as easily. For YEARS, it was the sole reason my projects wouldn't build. Constantly something broken in TextMesh Pro. Now at least it doesn't do that, but it's still a PITA.

    Please either implement something better, or at the very least, dig UI.Text back out of the LEGACY folder.

    Thank you,
    -Chilton Webb
    Unity programmer since day 1.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    8,885
    May I ask why you're posting this on the 2D forum? This forum is not related to UI.

    I'm suprised that you're not aware of the dedicated UI/TMP forum here.

    I'll move your post for you, maybe the team or someone there can reply to you with something useful.
     
  3. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    505
    Ever made a 2D Unity app? I'll assume so.
    And ever had to deal with 3D stuff in an otherwise 2D app? Also, I'll assume so.
    It's annoying, because it doesn't really work the same. It just doesn't fit with everything else.

    It's like someone put a thread in the wrong forum. It seems... out of place.

    And that's exactly how I feel about being forced to use TextMesh Pro in my completely 2D app. It brings a bunch of 3D baggage with it that I really don't need, especially since there's already a 2D solution in the normal Text system.

    -Chilton
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    What 3D stuff are you specifically referring to?

    The <TextMeshProUGUI> component which is the replacement for the UI.Text component for the Canvas system, provides the same base functionality as UI.Text.

    TMP does of course provide a lot more functionality but if you just use the same basic feature as those offered by UI.Text, the result should be the same in terms of layout.

    P.S. Just trying to get a better understanding of your issues to help you get the results you seek.
     
    Last edited: Jul 9, 2022
  5. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    505
    Okay so today I picked up a new client's project that wouldn't build. Build issues resulting from their overly optimistic update from Unity 2019 basically ground their project to a dead halt, and they haven't been able to ship a product in over a month because of them.

    Guess what the problem was. But they're trying to "future proof" their app, and you've clearly marked all of the previous text stuff as Legacy.

    So as I understand it, the correct solution is:
    1. Delete all of the TMP folders and associated stuff outside the asset folder.
    2. Add "using TMPro;" to all scripts that used Text.
    3. Change all of the scripts to replace every instance of Text with TextMeshProUGUI
    4. Change all of the UI and prefab components to use TextMeshProUGUI instead of Text
    5. Reconnect all of those objects as needed.

    And... what do they gain from that? Is TMPro faster? More efficient? It's definitely not simpler. Just the name, TextMeshProUGUI, adds visual clutter to the file and takes longer to type.

    I'm sorry, it just feels like it's bolted on, and not even part of the engine. It's not even in the Unity namespace.

    So is TextMeshProUGUI more efficient, is there some reason we really should be moving to this instead of using the much simpler Text system?

    Please tell me there's an effort to make a TextMeshProUGUI standalone 2D environment and I'm 100% on board. Most of my Unity apps are text heavy, and I'd love to see a UI toolkit that I could make apps in that had the same benefits as the Unity UI without everything else.

    -Chilton
     
  6. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    507
    Sorry to butt in, but you updated a legacy app, you’re going to have some legacy/upgrade pain. Trust me I have my same angers about them forcing animation controllers on us instead of allowing us to use the faster legacy animation system (legacy no longer works for sprites for example).

    Change is a reality of software dev. There are a lot of features that TMP provides the biggest being sharp fidelity at multiple resolutions without needing to use higher resolution rasterized glyphs in addition to visual/layout features. I don’t think TMP is going to be integrated for UGUI anytime soon but the there already is TextCore which is in the Unity namespace and drives newer versions of TMP and UIToolkit (which brace yourself, is another new UI system that may require you do upgrade that in the future). The only constant about tech is change. I recommend changing the mentality to expect that when you’re upgrading a project.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well the legacy text is there to allow projects to be upgraded. Seems like even that wasn't useful in this case.
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,783
    I think the problem here is that you're trying to use the dumpster fire that is UGUI. TextMesh Pro is great if you don't use it in conjunction with UGUI.

    TextMeshPro is generally faster, looks nicer and uses less ram.
     
    hippocoder likes this.
  9. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    187
    Completely unrelated to the post but
    What's the alternative? UITooklit? not production ready in a lot of way, mainly custom UI shader, UI particle and World space UI are the blocker for me.
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,783
    The alternative is coding your own UI.
     
    nishikinohojo likes this.
  11. samfss

    samfss

    Joined:
    Apr 10, 2019
    Posts:
    15
    For the majority of developers, this is not a good alternative.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    9,783
    Then Unity is not a good choice for them, because that is the way to go with Unity and UI (and post processing).

    Accepting Unity can't design or code UI systems (and post processing) will set you free.
     
    nishikinohojo likes this.
  13. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    463
    To keep the text rendered as sharp as native text rendering, Unity's legacy Text component will generate a texture in an atlas for each glyph at every font size it encounters, even for the same font. If you have a lot of text in different sizes (and languages with a lot of glyphs, e.g. Chinese, Japanese, and Korean) the atlas fills up really fast, and a new one has to be created. As the texture generation is centralized, you cannot control when a new atlas will be created. The legacy system also does not allow rendering these atlas at build time as cache, so that everything has to generate at runtime. On lower-end devices (I tested on an iPad 4 back then) this would cause a very long stutter, and memory usage will be very large if the text is dynamic (even worse if the text is any user-generated content or in multiple languages).

    TMPro solved all my issues by generating a single atlas for all the necessary glyphs (controllable texture size too), and because it uses signed distance field rendering, one texture can be used for all font sizes with sharp rendering. Using this solved the stuttering issue, and I also got rich text and effects in a single package (legacy Text did not even try with their UV effects). I purchased it when I started using Unity 5, and it has been the best purchase I have made.

    The problem may not be as big as before as computers have gone faster with better capabilities, but in memory-constrained environments, like mobile platforms, TMPro is still very advantageous. Even outside of that condition, TMPro has more features that legacy Text never got around to add, so it being preferable makes a lot of sense to me.
     
    Last edited: Jul 14, 2022
  14. samfss

    samfss

    Joined:
    Apr 10, 2019
    Posts:
    15
    Unity's UI systems aren't perfect, but they've shipped in quite literally thousands of titles from studios of every size. Quite frankly, with the state of some other parts of the engine, UI isn't even that bad. It needs work, and I'm not convinced we'll, ever see that work from Unity themselves, but it's functional enough to be useful.

    And for the record, referencing Auschwitz seems a little much for what effectively comes down to "I don't like the way Unity does things".
     
  15. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    505
    > Unity's UI systems aren't perfect, but they've shipped in quite literally thousands of titles from studios of every size.
    True, and most of those don't use Text Mesh Pro.

    Look, I'm going to give it a shot. If it actually cuts down on memory usage, that's a plus, since most of my apps are heavy on the text side.

    But it does seem funny how many of you are defending the idea that the only constant about tech is change. What, for the sake of change? That's exactly what people hate about technology. Don't buy into that as something you MUST do or MUST accept.

    These selling points for TMP sound like just how things were done before Unity's new UI system came along. So I don't get how Unity could've missed all of that when making their UI system.

    Also, "referencing Auschwitz" ? Did I do that somewhere? I know I referenced Mean Girls, but I don't think I referenced Auschwitz.

    -Chilton
     
    Gamadrila likes this.
  16. samfss

    samfss

    Joined:
    Apr 10, 2019
    Posts:
    15
    Most titles using Unity released in the last 5 years are using TextMeshPro. It's really easy to tell just by looking at it - SDF fonts have a certain 'blobiness' when not atlassed a high enough resolution, and spotting them is fairly trivial.

    I'm not happy about the constant changes in the platform at Unity, often seemingly arbitrary and without merit. However, I can say from experience having now upgraded, ported or localized over 20 titles, that all but one of them were using TextMeshPro before I even touched them - these apps were initially developed anywhere between Unity 5.2 and 2017.4, and TextMeshPro was the one common thing across the lot. (The one app that didn't use TMP was making use of a different package, but did not use the built-in UI Text component).

    Personally, until a few years ago I was a big proponent of Typogenic instead of TextMeshPro, as it seemingly handled lighting better. But I didn't want to have to deal with upgrading that or figuring out how to continue using the Flash Player based font tool it required to build fonts, and TextMeshPro is pretty stable at this stage.

    That being said, TMP does still have a way to go, especially for localized text. But this isn't in comparison to the built-in text component, rather in comparison to other engines. The built-in one isn't any better at handling the complexities of more difficult Unicode glyphs than TMP.

    (As for the Auschwitz thing, I'm not talking about you. I was specifically replying to another user, AcidArrow - this is why I directly quoted their post. Referencing anything written by Tina Fey is always appropriate.)