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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feedback Reason have to use textmeshpro?

Discussion in 'UGUI & TextMesh Pro' started by jim_unity572, Feb 9, 2021.

  1. jim_unity572

    jim_unity572

    Joined:
    Feb 9, 2021
    Posts:
    1
    Hi, I'm indie game developer making mobile games.
    I use TMP(textmeshpro) to express strings if possible. Except when express user id or unexpected text.
    So my game is made of 99% of TMP and 1% of Text.

    One day I got a question "why do I have to use TMP?"

    I summed up few reasons my self.
    First : TMP support kinds of tags <br>, <color> very useful but use really sometimes.
    Second : Support useful things in inspector like outline.

    But I think those advantages do not convince me to use lots of TMP.
    Because it is such a pain to create font asset when some text added in my game.

    So does anybody know why should one use TMP? or feedback me to one should not use textmeshpro to express strings?

    Thanks.
     
    Kraakan and the_real_ijed like this.
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    TMP provides lots of functionality and features not available in UI Text. TMP is still under active development whereas UI Text is consider legacy and on maintenance. In my opinion, there is no reason not to use TMP.

    I understand that having to deal with font assets which seems like an extra layer might appear confusing / complicated at first but there are clear benefits to these font assets as they provide added flexibility and functionality.

    Font Assets are created from a source font file where as such, it is possible to create multiple font assets from the same font file. These can have different settings, face metrics, font weight configuration, fallbacks, edited characters or glyph metrics, etc. thus avoiding any resource duplication.

    Static font assets can be created to only contain a small subset of the characters and glyphs included in the font file and without the need for such font file to be included in the build.

    Creating static font assets is certainly more complicated as you have to figure out what characters to include which potentially requires learning a bit about Unicode. You have to learn about generation settings such as sampling point size and padding and how the ratio of sampling point size to padding affects the effective range of material properties like Dilation, Outline, Underlay, etc. Stuff to learn

    Static font assets provide the best performance as all characters and glyphs needed have been added ahead of time. They are self contained where their source font file is not included in the build. These may need to be updated from time to time which is a process that many studios / users have automated as part of their build process.

    Dynamic Font Assets provide great flexibility and should be used to handle unknown characters / user input. Unlike static font assets, their source font file will be included in the build as they require access to it at runtime. When dynamic font assets are created, their atlas texture has a size of Zero and thus if shipped in this state will not contribute to build size. Changes to dynamic font assets are persistent in the Editor but not at runtime. If they are reset before build creation by manually resetting them or setting the "Clear dynamic data" flag to true, their atlas texture will always revert to size zero for each play session. Multi atlas texture enables a dynamic font asset to create additional atlas textures as needed to ultimately be able to display every single glyph contained in their source font file.

    Creating a dynamic font asset capable of displaying every single character present in a font file take 5 seconds. The steps are:
    (1) Import font file in Unity
    (2) Select the font file.
    (3) Use the context menu Create - TextMeshPro - Font Asset or CTRL-SHIFT-F12
    (4) Enable multi atlas texture
    (5) Start using it

    For spending this 5 seconds, you get the ability to customize / adjust font face as well as glyph metrics (if needed), control generation settings, control font weights, local fallbacks, etc. You can even create dynamic font asset at runtime from system / OS font files. etc.

    A new dynamic font asset type will be introduced in the next preview release of the TMP package. This new type will be Dynamic OS font assets.

    Dynamic OS font assets will work similar to Dynamic Font Assets where in the Editor you will still need to import / assign the appropriate font file. In the Editor, the characters and glyphs will come from this font file. However, in a build / player, this font will not be included. When the first font asset is loaded, the system will build a dictionary of all present system / OS fonts and then look for a font file matching the same name as the one specified in the Editor and if found, it will use it on that platform.

    There are additional workflow improvements coming to TMP as it relates to font assets including the ability to define local or global fallback (already available) but now per platform and per language. For instance, this will enable users to define what fallbacks will be used on Android when Japanese is the default language.
     
    Pyr3z, Buzzrick_Runaway and vl4dimir like this.
  3. rscTrifork

    rscTrifork

    Joined:
    Apr 8, 2022
    Posts:
    3
    a little late to the party but how does it take 4+ years to implement a horizontal scroll bar for the inputfield?
     
    DavidJares likes this.
  4. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    746
    Wrong party?
     
  5. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    709
    If Unity is recommending not to use TMP then why is Text labeled as Legacy? Shouldn't TMP be labeled as a advanced feature and standard Text remain as the standard?

    Reason I ask is because now the Asset Store is saturated with assets that use TMP when it would have been more convenient and easier to share assets if they used standard Text instead.

    I have downloaded many assets claiming they are compatible with all projects, except then each UI controller is written using TMP and I have to go through the entire project and remove each component and setup the project for standard Text inputs and labels. It's a real pain cause i don't use TMP.

    Since text is now label as "legacy" it infers to stop using it. But is this accurate?

    I really hope that standard text is not retired.
     
    Last edited: Sep 14, 2023