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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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. cameron_oltmann

    cameron_oltmann

    Joined:
    Jun 7, 2017
    Posts:
    8
    I don't think that's the case here, as it happens even if I manually enable the VertexJitter component long after the scene has started. I'll try ForceMeshUpdate() though and let you know how it goes.
     
  2. cameron_oltmann

    cameron_oltmann

    Joined:
    Jun 7, 2017
    Posts:
    8
    NVM, that's not it. There's already a call to ForceMeshUpdate() in the coroutine.

    I don't know why the cached data enters an invalid state, but I'm almost certain the immediate cause of the null ref is the cache check not being robust enough. Do you have any other suggestions for ways I can overcome this issue?

    Thanks!
     
  3. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    Is there a way to save the kerning info and re-apply it to the new font?

    I had to add new characters to an existing font, but when I generated a new Font Atlas and saved the Text Mesh Pro font asset, all the previous kerning pair info was deleted.

    Is there a way to save out the kerning pairs and re-apply them to the new text asset?

    Thanks!
     
  4. ramon_delmondo

    ramon_delmondo

    Joined:
    Aug 19, 2015
    Posts:
    22
    Hi @Stephan_B some news about my error?

    Thanks
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I just got one more repro yesterday that I need to test to make sure everything now works as expected. Unless I run into something new, I will have a new release available over the weekend.
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    There is not at this time.

    However, the current API does expose all the functionality that would be needed for a user to implement their own method to backup kerning data from a font and reapply it to some other font. However, this doesn't mean the kerning data of the previous font would look good on the new font given the glyphs could be very different in shape and size.
     
  7. cameron_oltmann

    cameron_oltmann

    Joined:
    Jun 7, 2017
    Posts:
    8
    @Stephan_B Do you have any suggestions for other ways I can overcome this issue? ForceMeshUpdate() is already being called.

    In case it helps, The version I'm using is dll-only 1.0.55.54.0b9.

    Thanks!
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Can you provide me with a small repro of what you are using that produces the issue? Please make sure you share this privately via email or link in a PM.
     
  9. cameron_oltmann

    cameron_oltmann

    Joined:
    Jun 7, 2017
    Posts:
    8
    I'll see what I can come up with. Thanks!

    Update: I DM'd you a repro project.
     
    Last edited: Jun 9, 2017
  10. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi Stephan,

    I purchased Text Mesh Pro back in 2015 and have been using it ever since. It is a great product.

    However, at work I can not get the same results with the free version of TextMesh Pro for multiple reasons

    1. Does not include the same fonts (the ones included are not that goof IMO)
    2. The generated SDF from TT fonts does not seem to work well
    For example, creating an asset from Arial.ttf using the Font Asset Creator does not give me a very usable font.

    If I set the text size to 36, then the text looks fine. But setting the text size to something much smaller, say 14, the output is worse than the Unity text.

    Is there something that I can do? Am I doing something incorrect when using the Font Asset Creator?

    Note: It also looks like the documentation is for the paid version, not the free version.
     
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    If you purchased TMP back in 2015, I strongly recommend you continue to use the paid version which I will continue to update and make available on the TMP user forum as I have done over the past several years.

    The font asset creator has not changed between those releases so you should be getting the same results. Perhaps you are using different settings. Make sure you check the font asset creation video just in case you are overlooking something in the creation process.

    The included fonts are different and slightly different in terms of design but that doesn't make them worst or better. There are lots of fonts available on the internet. Google/fonts has a great selection where most are free to use.
     
    Last edited: Jun 11, 2017
  12. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    Hi Stephan,

    Thanks for the reply. I do continue to use the purchased version for myself, but at work I can only use the free version since the paid version is no longer available.

    But I even tested the paid version over the weekend using an Arial.ttf font with the following settings (which is what I used in the free version)

    Font source: Arial
    Font Size: Auto Sizing
    Font Padding: 5
    Packing Method: Fast
    Alias Resolution: 1024 x 1024
    Character Set: Extended ASCII
    Font Style: Normal
    Font Render Mode: Distance Field 16
    Get Kerning Pairs: Yes
    ----
    Font Arial Pt. size: 98
    characters Packed: 250/306

    The results are basically the same in both version (there is a bleeding of the text) - both TextMesh Pro and Text Mesh Pro do not look very nice when displaying smaller point size fonts (e.g. 14) that have a dark (vertex) color (e.g. black) on a light background.

    If I raise the point size to say 36 or higher the text starts to look better. The height the point size the less the bleeding.

    It just seems that TMP does not work well to just display text with no special effects.
     
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The Ratio of Sampling Point Size to Padding should be at about 10% otherwise as per FAQ Question 2 and 11, you can get visual artifacts around the text at small size. This is likely the issue in your case. Your padding value is too small for the range of material properties you are using. This information is also covered in the Font Asset Creation Video.

    When displaying the text at small size, it can be useful to enable Extra Padding in the text object inspector panel. Using Linear Color space will also produce better results.

    When computing the SDF, you can use Distance Field 32 which will take longer to compute but produce slightly better results.

    Make sure you are also familiar with Material Presets and how to use them.
     
  14. TBruce

    TBruce

    Joined:
    Jan 18, 2015
    Posts:
    86
    I originally was using a padding of 9 but I will now play around with that to tray and get a 10% ratio. I do have the Extra Padding box checked as I have found it does help a little, but not enough.

    I had already tried setting the color space to linear but the effect was worse (the text was lighter if I remember correctly).
     
  15. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    textmeshpro error.png

    error after change font no matter what font i choose (including default one) i can't change material or its configs!
     
  16. Moori_Sioux

    Moori_Sioux

    Joined:
    Mar 21, 2016
    Posts:
    3
    That's exactly the fix I need and with some urgency. Is it possible to share a version with this correction outside of Unity Asset Store, since you're waiting for some other features before publishing a new version?
     
  17. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The new release has been uploaded to the Asset Store so they should be available some time this week.

    In the mean time, you can send me a PM with your email address and what version of Unity you need the release for.
     
  18. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    What error are you getting?

    As a side note, I see that you have some UI.Mask somewhere affecting the text object. I suggest replacing the UI.Mask by 2D RectMask.
     
  19. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    385
    Hi,
    I'm running with Linux editor unity build ( 2017.1.b8). Demos run fine and I can get pre created fonts to load and run in a project. However if I try to use the font asset creator I get the following error
    Code (csharp):
    1.  
    2. DllNotFoundException: TMPro_Plugin
    3. TMPro.EditorUtilities.TMPro_FontAssetCreatorWindow.OnDisable ()
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    5.  
    can anyone advise please? Thanks.

    PS the font asset creator didn't work in older versions either.
     
  20. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    the text is inside a scroll rect! so use mask! it's ui so text mesh pro isn't compatible yet with mask on UI?
     
  21. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Since the Font Asset Creator is a native plugin, it requires a dll for each of the platforms. Currently there is a dll for Windows and OSX but there is not one for Linux which is why the Font Asset Creator is not working with Linux.
     
  22. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    There are issues with the UI.Mask and Stencil masking is not supported on all mobile devices and performance isn't as good as using a 2D Rect Mask which works on all platforms. Hence why I am suggesting switching to it.
     
  23. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    385
    Thanks. So is there any plans for it?
     
  24. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Not in the short term as my development focus is on the integrated version. Since the integrated version will be part of Unity, it will work on all platforms and at runtime.

    In the meantime, you will need to run in either Windows or OSX to create your font assets.
     
    knobby67 likes this.
  25. amateurd

    amateurd

    Joined:
    Nov 1, 2016
    Posts:
    95
    Hopefully this is easy to answer. Is TMPro recommended to replace all text objects? I wonder about memory, cpu etc. If TMPro is better then should I just use that? It would be a bit of work to replace all text objects in the project but if it's worth it I will. Thanks,
     
  26. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    TextMesh Pro will provide much greater flexibility in terms of text visual styling, control over text formatting and layout. From a performance point view, it should perform on par or in most cases better than the other text components.

    Given that it is now free, just try it out and do your own testing.

    Be sure to watch the Font Asset Creation video and Working with Material Presets as understanding those is fundamental.

    Be sure to check out all the demo scenes as they provide great insight of the vaste majority of features.
     
  27. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    When I apply the "underlay," the entire polygon the text is being drawn on turns a tinted grey. The tinted grey poly shading is only seen in the render view, it is not seen in the scene view.

    Anyone know how to apply an underlay without shadingthe polygon?
     
  28. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This is most likely due to the ratio of Sampling point size to padding value being too small. This is explained in the Font Asset Creation video as well as FAQ Question 2 and 11 on the TMP user forum.
     
  29. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    Awesome I'll watch the video. Thank you!!!
     
  30. ramon_delmondo

    ramon_delmondo

    Joined:
    Aug 19, 2015
    Posts:
    22
    @Stephan-B Man, thanks for the update, helps a lot. :)
     
    Stephan_B likes this.
  31. PerunCreative

    PerunCreative

    Joined:
    Nov 2, 2015
    Posts:
    113
    Hi,

    I am using TMPro in world space canvas and it is placed above the npc. The problem is that I am using unity temporal antialiasing which makes the text extremely blurry with some ghost artifacts when player/camera is moving. Any idea on how to solve this? I am using TMPro UGUI with Mobile/Distance Field shader with drop shadow settings
     
  32. mgregoirelds

    mgregoirelds

    Joined:
    Feb 3, 2017
    Posts:
    21
    Hi, in the 1.0.55 release notes on the TMP user forum, you mention something related to Release 1.0.55.2017.1.0b10 is for Unity 2017.1. However, when I do import the latest b10 package from the Asset Store, I can't find the 1.0.55.2017.1.0b10 dll. Is there something I am missing related to this comment ?
     
  33. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    some devices(android) the text on the android keyboard appears totally white with the white background giving the impression that the user isn't typing anything. here is a picture.
    20170620_122104.png
    20170620_122051.png
     
  34. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Hi there, I have a problem with the TMP input field. If line type is set to multiline and I have only one line of text, scrolling with the mouse wheel will bring the text at the bottom of the field. There is nothing that I can do to disable this behavior.
    While were at it, if I add a scroll bar, how do I get the scroll bar to only show when text is longer then the input field?
    Thanks!
     
  35. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Since it is not currently possible to upload packages for Unity 2017.1 to the Asset Store (due to a bug in the Asset Store Publisher Tool), I posted a link to the 2017.1 release in the sticky thread in the Unity UI & TextMesh Pro section of the user forum. Here is the link to that thread / post.
     
  36. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    It looks like you might have some object / texture perhaps overlapping the keyboard. The keyboard overlay is part of the Android OS and just called by TMP to have it show up.
     
  37. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Many of the post processing FX don't tend to work well with transparent objects (which text is). I haven't played with the temporal antialiasing so I don't know if that could be a limitation.
     
  38. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I need to look into that behavior and I guess disable the ability to scroll when there is only one line of text in a multi line input field. Similarly, I could add an extra property to control showing the srollbar.
     
  39. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Would it be asking too much to ask if you can send me a version containing these features? hehe
    We're making a writing app for kids and the behavior makes them all believe they lost their text, hence why we need to fix it fast:)
    If not, any estimate of when this would be added in the main branch?
    thanks
     
  40. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I'll try to take a look tonight. Disabling the scrolling on a single line should be simple. Are you using the free version of TMP or the paid version?

    Controlling the scrollbar, will be more complex to implement.
     
  41. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    unfortunately it is the TMP since after i replace it for the normal unity ui input field the text appears normal on the android keyboard. so i will wait the fix until then i will use input field of the unity! and not the one of TMP!
     
  42. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Were using the free version, controlling the scroll bar is something I can easily control from outside the plugin, the undesired scrolling is more tricky.

    Thanks!
     
  43. jlanisdev

    jlanisdev

    Joined:
    Jan 18, 2016
    Posts:
    76
    When updating from b9 to b10, half of my text in the project disappeared. It turns out a large portion of the UGUI scripts in my project somehow disabled themselves (only on the game objects that were already enabled in the hierarchy). I didn't delete the old asset before importing the new one - should I do that for future updates to prevent this from happening again, or do you think it was just a weird glitch? I'm using Unity 5.6.1f1.
     
    Last edited: Jun 21, 2017
  44. FortisInvictus

    FortisInvictus

    Joined:
    Feb 3, 2015
    Posts:
    3
    The same in my project... TMP team, please, take a look to this problem
     
  45. jlanisdev

    jlanisdev

    Joined:
    Jan 18, 2016
    Posts:
    76
    For anyone upgrading to b10, I've found that this works:

    1) Delete the entire TMP asset folder from the project (keep the TMP settings asset in a backup folder if applicable)
    2) Save the project and restart Unity
    3) Import latest update (in this case, b10)
    4) TMP components retain their enabled state
     
    Last edited: Jun 21, 2017
    Stephan_B likes this.
  46. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    It is always best to delete the previous package first as the Asset Importer is very primitive. Furthermore since the dll's are named after each version, you would end up with two sets of dll and scripts conflicting with each other.

    So as per the Release and Upgrade notes, always remove the previous package first. Of course always be sure to backup your project first and any content you may have saved inside the "TextMesh Pro" folder hierarchy.
     
  47. jlanisdev

    jlanisdev

    Joined:
    Jan 18, 2016
    Posts:
    76
    Good to know, thanks! IMHO, you should include this note in the release notes that are viewed within the Unity editor, not just the forum page. The note that you're referring to is the 3rd paragraph down on that page, which can be easily missed (as I did).

    I also think it's a good idea to include the release-specific notes within the Unity editor's asset store tab, instead of only on the forum page. The problem is that when you click on the link to the forum page, it fills up the entire asset store tab within the Unity editor and there is no way to go back without having to close out the asset store tab completely and re-opening it (see attached image).
     

    Attached Files:

  48. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Hi there,

    Is it possible to change the color on a Text Mesh Pro component without it causing the Text Mesh to be rebuild each time?

    Even when I change the color through the faceColor property, which should only update the material and not the vertex colors in the mesh, the TextMeshPro.Rebuild() function is still called.

    Thanks for the help!
     
  49. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    There are several callbacks in the editor only which do not happen in builds. Changing the faceColor material property via some script for instance would not cause the TMP object(s) to update.

    Having said that, you have to be careful when changing material properties as in Unity accessing the material will result in an instance of the material being created whereas accessing the sharedMaterial will not.

    The most efficient way to change the color of the text of individual text object is via the vertex color. Changing the vertex color property of the text object will result in the object being refreshed / updated. Changing the vertex color of the geometry created by the text object will not. See the AnimatingVertexAttribute example which does something similar.
     
    Tycho likes this.
  50. Kev_DK

    Kev_DK

    Joined:
    Nov 27, 2013
    Posts:
    2
    Hi Stephan_B,

    I have a TextMeshPro Text component that has a fixed max Width, in the case 500. This particular problem is very evident with a fixed text size, but it's even present with font autosizing.

    When the text (which can include icons, tags, etc) is inserted and wordwrapped, it takes up the majority of the space, but with left-aligned texts, it's obvious that there can be some left over space in the right side. This can be close to 0, but it can also be quite noticeable, especially if there's a simple box sprite behind it.

    What I'd like to do it calculate what the surplus width is. Basically, for each line, see how long it is, determine what the smallest gap is (in this particular case, 12 pixels gap, see image below). Because then I can code in that the real TextMeshPro Text component (a copy of the first one) should be 488 width, make sure the box sprite behind it follows suit, and then there's no gap.



    The question is, how can I get that number 12 through scripting?

    I've previously done this for regular Unity UI text, but that was quite a hassle - I went through all the characters of a text (grabbing the info from the cachedTextGeneratorForLayout), built up each line manually, with special cases for special characters like tags, \n characters etc., and mimicked how Unity did word wrapping, to find that number. But I'm not sure I can even do that here, and that didn't even support the sprite icons.

    Any ideas? :)
     
Thread Status:
Not open for further replies.