Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Text Mesh Pro - The Ultimate Text Solution for Unity - Powerful & Flexible - Advanced Text Rendering

Discussion in 'Assets and Asset Store' started by Stephan-B, May 29, 2014.

Thread Status:
Not open for further replies.
  1. MichiealO

    MichiealO

    Joined:
    Jul 7, 2013
    Posts:
    68
    I do formally withdraw the Mindset comment, as it was a personal observation. I apologize for putting you on the defensive, Stephan.

    Where I encountered this the most, was in Unity 2017.3 & .4 versions. I noticed today that Unity 2018.2 now actually shows the packages that the project will use (whether you added them or not, apparently). I jut installed 2018.2 last night, and I didn't see it because my project was sprawled out pushing it out of view.

    With 2018.2... It only shows the one package for TMPro, and it does compile and run correctly. Maybe that part of the team fixed how it's addressed? (Speculating there.)
    In 2018.2, here are the packages... (Trimmed down some...)

    ...
    "com.unity.package-manager-ui": "1.9.11",
    "com.unity.purchasing": "2.0.3",
    "com.unity.textmeshpro": "1.2.4",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    ...

    I do apologize, at this hour, I am not exactly 100% sure which project in my project drive has an older version of unity, that used TMPro. Depending on how busy work is, I'll try to look for it tomorrow.

    What I do remember about it:
    I had installed the TMPro package from the preview area, as it wasn't in the Unity Package manager yet. That put it into my assets directory initially. Then, when I installed Unity 2017.3? I had issues, because I thought it would update it correctly, when I saw that it was part of the new package manager loadout. So, I deleted it out of the assets directory. And I continued to have issue, even after that and after installing 2017.4. I tried removing the UPM package for it, and it was still broken. It had referenced the packages in the cache, too. (Weird behavior, but hey, why not?)
    I tried recreating the project, and it worked ok until I tried to use any of the TMPro items, and it wanted to install the extras. (And I said, okay - make this work!) Boom. Breakage.
    I did that twice, with deleting every TMPro related item in the assets directory... to no avail. Then I searched for help, encountered the forums, and immediately facepalmed when I was told, by you, to "Delete the folder in the assets directory" as the official "this fixes everything" answer. (Curious side note here, this is also when I learned that comcast has a really crappy upload speed... As I really wanted to show you the project in its entirety so you could see it yourself.)
    I recreated the project yet again, and had the same set of errors, so I decided to eradicate anything TMPro from my computer, and find a different way to do things. That's when I found the Unity Package manager cache. I found multiple copies of the TMPro asset in there, and I deleted them all, as I had already "uninstalled the packages" in UMP. And, wow... that worked. (I wasn't as eager to give up on it, as I thought I was, as I gave it another try.) With only the one package in the cache area, and available... it worked... So, I marked it as the answer and left it. As a disclosure, I've not tried TMPro in the now new project (even though it's listed under referenced packages, and I didn't tell Unity to even use it. It's just there, after I installed 2018.2). Having the thing work, even without the emoticons, I'm good with. And, I can't say that I am eager to break things just to go "See!!! I told you it didn't work!!!" as, that's not conducive to getting things built.

    Hopefully that will give a road map? I dunno if the UPM team will address it, as I would hazard to think that in Listing the Referenced packages (as they do in 2018.2) they would remove duplicate packages and enforce some checking routines... So, maybe it's only broke in 2017? Good reason to update, right? :p lol.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,967
    Just to clarify the release history of TextMesh Pro, the first version of TextMesh Pro available via the package manager was for Unity 2018.1. As per this sticky post, the first ever release of the TMP UPM package became available about the same time Unity 2018.1 beta 3 was released. Users had to manually install this version of TextMesh Pro form the package manager in Unity 2018.1 following the procedure outline in that stick post.

    Prior to that, the only versions available of TextMesh Pro were either the source code version available from the TextMesh Pro user forum (available to users who purchased the product in the past) or the free / dll only version available from the Asset Store. These releases were available for Unity 2017.4 and prior versions of Unity.

    Unity 2018.2 is the first version of Unity where the TextMesh Pro package is included with Unity itself. Users still need to add the TMP Essential Resources and (optional but recommended) TMP Examples and Extras in their project but the package is included by default.

    I am not sure how the 2018.1 package manager version of TMP could end up in Unity 2017.3 or 2017.4 but for certain it would not work simply due to the use of assembly definitions and some other stuff.

    In terms of the upgrade procedure for previous source code version or the free / dll version of TextMesh Pro, the process has always required removing the previous version by deleting the old "TextMesh Pro" folder. This has been the procedure since the first release of TMP since 2014. This is also the same procedure when migrating from the source code / free dll version of TMP to the new package manager versions. This procedure is also outlined in the sticky post.

    Although the migration from the non package manager version of TMP to this new TMP UPM version can be tricky / problematic, once running on these new package manager versions of TMP, upgrades to subsequent versions of the TMP UPM package are so much easier.

    With regards to the issues you have run into, I certainly apologize for that. I still don't know how you ended up with the 2018.1 version package manager version of TMP in Unity 2017.3 or 2017.4. This would most certainly cause all kinds of issues.

    It looks like you are migrating to Unity 2018.2 where the TMP UPM package is included by default. Like I said above and as per that sticky post, you will need to add the TMP Essential Resources. If you are looking to migrate a project that was using an older version of TMP to Unity 2018.2, be sure to follow that outline procedure and review the Updated Notes at the bottom of that first post.

    If you run into any issues, I am always available to provide assistance.
     
    MichiealO likes this.
  3. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
    Any update on single pass instance support?
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,967
    Last edited: Aug 8, 2018
  5. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,967
    Nothing firm. I do need to review the shaders to add support for SRP for the surface shaders so maybe I'll take a look at this at the same time.

    I'll provide an update when I have more information to share.
     
  7. jlanisdev

    jlanisdev

    Joined:
    Jan 18, 2016
    Posts:
    60
    I apologize in advance if this question has been asked before, but how do I get TMP to work properly with fog? I've tried turning Fog to "On" in the shader, but doesn't seem to work. I also tried searching the forums but couldn't find a solution either. I am using 2017.4 and am using the non-canvas TMP component on mobile (using the standard Mobile/Distance Field shader).
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,967
    The mobile distance field shader isn't designed to work with lighting / fog. Used the mobile Distance Field Surface shader.

    Take a look at the example scene 24 - Surface Shader Example.
     
  9. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    469
    am i the only one to get this problem ?
     
  10. skyrusfxg

    skyrusfxg

    Joined:
    Jan 14, 2016
    Posts:
    113
    Hello. How properly programmatically change cursor position? I made build to Xbox One S . And want to change position of cursor. Tried to do it this way (for example):

    input.caretPosition = Mathf.Max(input.caretPosition - 1, 0);//move cursor left
    input.ForceLabelUpdate();


    Here "input" is TMP_InputField.

    Cursor position changes, but when i start print something on a virtual xbox keyboard it starts from the end of string.

    How properly set logical position and visual cursor position? Tried also doing for test:
    input.stringPosition = input.caretPosition = Mathf.Max(input.caretPosition - 1, 0);
    Result is the same.

    @Stephan_B ?
     
    Last edited: Aug 22, 2018
  11. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    37
    I just updated a project from 2018.2.3 to 2018.2.4 and I get 19 errors similar to this one:

    C:/Users/user-name/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.3.0-preview/Scripts/Runtime/TMPro_Private.cs(3551,92): error CS0121: The call is ambiguous between the following methods or properties: `TMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Color32, UnityEngine.Color32)' and `TMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Color32, UnityEngine.Color32)'

    I was using textmesh pro 1.2.4, but updated to 1.3.0 to see if that fixed the errors. It didn't work.
     
  12. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    209
    Hi @Stephan_B I'm struggling with something in TMP that I don't know if it's a bug or a feature yet.

    When you create a TextMeshProUGUI to use with Unity UI system, and you use fallback stuff, for example you have a fallback font to cover latin chars or like in my case, I use Roboto as the assigned font in the component, but this font is configured to fallback to FontAwesome, and also has assigned Roboto-Bold in the Bold field of the font asset.

    so when I write something like "this is <b>bold</b>" it will use the real bold version of the font, or for example I'm able to use font awesome icons like this: "this is a fontawesome icon: \uf101".

    that the moment you use one of these fallbacks, a child gameobject is created called "TMP SubMeshUI [<material used> + <atlas used>]".

    I understand or assume this is necessary because you are creating an extra material for an atlas texture that doesn't have that material, on the fly, besides I assume this child GO is creating meshes for the characters that fallback to that.

    now, the problem is that if you for example decide to change the text in the TMP component, and you delete any chars that were using fallback fonts, the child GO persists, so you end up with unnecesary gameobjects that are garbage since there are not needed anymore, besides I don't know if this affects performance (is the runtime generated material still in memory or was freed?) does this subobject still create an extra drawcall? etc.

    so my concern is if there is a way to automate TMP so it detects when the childGO is not needed anymore and removes it, aka the TMP component doesnt have text that needs to fallback to something else anymore. Right now I have to do this manually and is a tedious process if you have a significant size of UI.

    thanks.

    EDIT: I also realized that TMP is managing the runtime created materials pretty smart, if I have multiple text components in the UI, and some of them use weird combinations of material presets with fallback fonts, the created material is shared, meaning is not creating a runtime material for <FontAssetX> + <MaterialPresetY> for every text component, but somehow recognizes if this particular combination already exists and grabs a shared material from somewhere, I like this because I'm saving a lot of drawcalls with that smart management of materials, I would like to have some insight on how it works to make sure it will always work and that I'm not breaking it anywhere and generating duplicates of materials.
     
    Last edited: Sep 6, 2018
  13. KristoferBoman

    KristoferBoman

    Joined:
    Feb 16, 2016
    Posts:
    58
    Hi guys,

    I need help with canvas and Text Mesh Pro. The moment I add text mesh pro (on scene under canvas) it automatically changes additionalShaderChannels mask of canvas to TexCoord1, Normal and Tangent. I only want to turn on TexCoord1 but it is not possible because mask is reset every time new text is added. I checked materials that are used for text and none of them is using lighting.

    Canvas is set to screen space overlay. Even if I set mask from script in start up it will reset whenever new text is instantiated. Does anybody knows what is the problem?
     
  14. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,967
    TextMesh Pro does need the Normal and Tangents for the normal Distance Field shader and the surface shaders.
     
Thread Status:
Not open for further replies.
unityunity