Search Unity

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. lenten1111

    lenten1111

    Joined:
    Jun 10, 2016
    Posts:
    8
  2. lenten1111

    lenten1111

    Joined:
    Jun 10, 2016
    Posts:
    8
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Based on that error message, I believe you are running Unity 2017.2 however, at this time, there is no release for Unity 2017.2 or 2017.1 on the Asset Store. There is a release available for 2017.1 but you have to be running it with Unity 2017.1.

    Here is a link to the 2017.1 release of TMP.

    I should have a new release available for TMP over the weekend which will include a release for 2017.2. Links to these will be available in the same sticky thread in the Unity UI & TextMesh Pro section of the forum.
     
  4. lenten1111

    lenten1111

    Joined:
    Jun 10, 2016
    Posts:
    8
    Oh, :) seems 2007.1 working fine now. I always thought newest versions would be better then. So i will stick to stable version from now. Thank you
     
  5. 838nHex

    838nHex

    Joined:
    May 14, 2014
    Posts:
    9
    I have one and the same game running on two nearly identical PCs.
    On one PC some UI Texts are shown and on the other PC (running the same compiled version of thegame) these UI Texts is not showing up. No Error in logfiles. Unity 5.6.1f1 . Text Nesh Pr
    1.0.55.0b11

    ?
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    UI Text or TextMeshPro text object?

    What version of TMP are you using more specifically, is the dll names 1.0.55.56.0b11?

    The behavior should be identical unless there was an import error on one of the PC or some settings are different. I'll need more details to try to figure out why this is happening.
     
  7. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    90
    Is there anything that would have broken the functionality of Sprite Assets from b10 to b11? I wiped TMP from unity and reinstalled it and none of the sprite assets are working any longer that are in Resources/Sprites. They should simply be accessible with things like <sprite="balance_civil" name="balance_civil"> correct?
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Nothing changes that would affect this. However, the location of the sprites is defined in the TMP Settings file so it is possible that you had changed that location. By default it should be "Resources/Sprite Assets/"
     
    TSabos likes this.
  9. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    90
    Thanks, yet again. No idea why I would have changed that as I always try to leave defaults on assets so that I never have to keep track. Keep up the stellar support ;)
     
    Stephan_B likes this.
  10. 838nHex

    838nHex

    Joined:
    May 14, 2014
    Posts:
    9
    yes.DLL names is "1.0.55.56.0b11". of course it should not.
     
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    We need to figure out what the differences are between those two PCs.

    What is the target build platform?

    Is the compiled game running at the same resolution on both?

    Same graphic card?

    Try to see if you can isolate what is different between both setup.
     
  12. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    Hi!
    I just downloaded Textmesh Pro to a new project, but I get this error:

    error CS1704: An assembly with the same name `TextMeshPro-1.0.55.55.0b11' has already been imported. Consider removing one of the references or sign the assembly
    Assets/TextMesh Pro/Plugins/Runtime DLL/TextMeshPro-1.0.55.55.0b11.dll (Location of the symbol related to previous error)
    Assets/TextMesh Pro/Plugins/TextMeshPro-1.0.55.56.0b11.dll (Location of the symbol related to previous error)


    I removed TextMeshPro-1.0.55.55.0b11.dll in Plugins/Runtime DLL, then the error disappeared, But when I create a new Canvas Textmesh Pro text, it's just some square box, not letters. If I create 3D Object/Textmesh Pro, it works. It has nothing to do with the DLL I removed. I tried with and without. Maybe I don't need it. I use 3D Object/Textmesh Pro the most. But if you could give me an answer why this happen, I will be very grateful. :)
     
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    When upgrading to a new release and before importing the new package, you must first remove the previous version by deleting the "TextMesh Pro" folder. See the instructions / reminder information in this post / thread.
     
  14. escfoe2

    escfoe2

    Joined:
    Jun 4, 2017
    Posts:
    4
    Stephan. I have a question. I'm seeing all of the different events for the input field, but no keypress event. This is necessary for me because I need to be able to cancel the insertion of different characters. Here's an example of how I accomplished this in Windows Forms:

    Code (CSharp):
    1. private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
    2. {
    3.         char[] Chars = null;
    4.         string Str = null;
    5.  
    6.         if (e.KeyChar == (char)Keys.Enter)
    7.         {
    8.             e.Handled = true;
    9.             HandleCheckCommand(txtCmd, txtCmd.Text);
    10.         }
    11.  
    12.         //Check if last char entered was > and don't print it
    13.         if (e.KeyChar == '>')
    14.         {
    15.             e.Handled = true;
    16.         }
    17.  
    18.         //Check if the backspace key is getting rid of our > and disallow it
    19.         if (e.KeyChar == (char)Keys.Back)
    20.         {
    21.             Str = TextBox.Text;
    22.             Chars = Str.ToCharArray();
    23.             if (Chars[Chars.Count() - 1] == "\n")
    24.             {
    25.                 Str = TextBox.Text + ">";
    26.                 TextBox.Text = null;
    27.                 TextBox.AppendText(Str);
    28.             }
    29.         }
    30. }
    31.  
    As you can see, on KeyPress I can dictate whether or not the entered character actually gets inserted. Is there anyway to accomplish this with your Input Field?
     
  15. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Take a look at this post http://digitalnativestudios.com/forum/index.php?topic=1239.msg9350#msg9350
     
  16. escfoe2

    escfoe2

    Joined:
    Jun 4, 2017
    Posts:
    4
    Thanks, Stephan. That does everything I need except monitor and escape the backspace key. Do you have a post on that? This is what I meant by a KeyPress event. I need to be able to capture, and prevent if necessary, any keys pressed while the input field is focused.
     
  17. TubooBokBok

    TubooBokBok

    Joined:
    Mar 2, 2014
    Posts:
    30
    Hello,

    I am using Text Mesh Pro UGUI, and am having some trouble with the text appearing blury, incomplete, or as a white square.



    You can see the hierarchy of my canvas above. The "Main Buttons" Panel has a vertical layout group component. Each sub panel (Play Panel, Settings Panel, Panel (2), Panel (3)) has a Layout element.

    The Text Mesh text is using the default Bangers font.

    Font appears correctly when using Text Mesh Pro UGUI in another scene, however the text is not a child of any other object.

    Do you know how I can correct this problem?

    I am using Unity version 5.6.1f1

    Thanks!
     
  18. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    It looks like you might not be using the version of TextMesh Pro for Unity 5.6. If you are using the free version, check the name of the DLL's in the plugins folder. Their name should be something like "TextMeshPro-1.0.55.56.0bxx" where the .56 indicates this is the release for Unity 5.6.

    For additional testing, in Unity 5.6, "Addition Shader Channels" was added to the Canvas. Enable, Texcoord 1, Normal and Tangents and see if that makes a difference.
     
    TubooBokBok likes this.
  19. TubooBokBok

    TubooBokBok

    Joined:
    Mar 2, 2014
    Posts:
    30
    Thank you for your help.

    Enabling Texcoord 1, Normal and Tangents on the canvas fixed the issue.
     
  20. escfoe2

    escfoe2

    Joined:
    Jun 4, 2017
    Posts:
    4
    Hey Stephan_B. Any comment on capturing all other key presses in your input field? Specifically the backspace key. As I mentioned above, I need to be able to cancel the backspace submission.
     
  21. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    This also means that you are not using the correct version of TMP so you should consider upgrading. If you do so, make sure you read the Release and Upgrade notes to make sure the upgrade process goes smoothly.
     
  22. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Let me take a look.
     
  23. escfoe2

    escfoe2

    Joined:
    Jun 4, 2017
    Posts:
    4
    Anything?
     
  24. molson

    molson

    Joined:
    Feb 8, 2013
    Posts:
    5
    Quick question...and excuse me if this has been answered - but I couldn't find any posts that answered this:)

    I'm trying to set the fontstyles at runtime. When I set them in start, it's all good - but when I set them in the update loop only certain styles seem to work. Namely the uppercase + lowercase don't seem to work correctly. Am I setting the variable incorrectly?

    Thanks for the help!

    Here is my code example:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using TMPro;
    5.  
    6. public class TextMeshTest : MonoBehaviour {
    7.  
    8.     public GameObject TextMeshGo;
    9.     public TextMeshPro tmpro;
    10.     public FontStyles fontstyle;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.  
    15.         TextMeshGo = new GameObject ();
    16.         tmpro = TextMeshGo.AddComponent<TextMeshPro> ();
    17.         tmpro.SetText ("This is a test");
    18.         tmpro.fontStyle = fontstyle;
    19.  
    20.     }
    21.  
    22.     // Update is called once per frame
    23.     void Update () {
    24.  
    25.         if(Input.GetKeyDown(KeyCode.Space))
    26.         {
    27.             tmpro.fontStyle = fontstyle;
    28.         }
    29.  
    30.     }
    31. }
     
  25. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    64
    Hi Stephan,

    I'm looking to create a curved textfield for a project I am working on. I've Googled around and it seems like this is something that has been done using TextMeshPro already, but I can't seem to find an actual script that does it, though one called VertexAttributeModifier.cs seems to have been made at one point or another.

    This thread (http://digitalnativestudios.com/forum/index.php?topic=31.45) mentions "Make sure you get the revised version of the script located in this thread http://digitalnativestudios.com/forum/index.php?topic=712.msg5463#msg5463", however when you go to that thread, it just points back to the first one - "See the following thread http://digitalnativestudios.com/forum/index.php?topic=31.0 which contains the VertexAttributeModifier.cs."

    Some of this was from over a year ago so I feel like I might be missing something within the asset that would allow for curving of text and I'm just not seeing it - I searched for 'Curve' and 'VertexAttributeModifier' in the 'Add Component' menu in Unity but neither returned any results.

    I appreciate your help, thanks!
     
  26. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Take a look at the WarpTextExample.cs script included with TMP.

    Add the script to a text object. You will likely need to play with the scale of the script but this should bend / curve the text.

    This script is provided as an example of how similar things could be done so this is just for learning purposes. You will likely need to tweak it for your own needs.
     
  27. CBockes

    CBockes

    Joined:
    Feb 9, 2017
    Posts:
    3
    Hi,
    I am trying to create a text system sort of like Pokemon where the words appear one letter at a time until the page is full where it then waits for input from the user to move on to the next page.

    To start, I am wondering why when I use the <page> tag, text will not appear on page 0 (I am wondering if it is even using the 0 page) or page 1. The text starts on page 2 for me no matter what I try.

    Currently I can get it to make all the words appear one letter at a time on my first page of text and then wait for me to press the space bar before going to the next page. The problem I am having is that all future pages have the text completely there and do not appear one word at a time.

    Is there a variable I am missing somewhere to detect the whole pages character count to then reset my visible characters number to? I got to where I am by following the Old Computer Terminal example.

    Thanks for any help.
     
  28. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Page 1 is the first page in the Editor. When trying to access the page via code, in the pageInfo then the first page index is ZERO.

    Take a look at this user created example http://digitalnativestudios.com/forum/index.php?topic=1336.0 I have not looked at it myself but seems to be similar to what you seek.

    There should be other examples on the TMP user forum.
     
    CBockes likes this.
  29. CBockes

    CBockes

    Joined:
    Feb 9, 2017
    Posts:
    3
    Thanks, I actually just figured that out! It all became clear once I noticed how the index and page numbers are offset. It resulted in me checking the lastcharacterindex for the next page rather than my current page. I have my desired functionality working perfectly!
     
    Stephan_B likes this.
  30. VegaStudio_Kevin

    VegaStudio_Kevin

    Joined:
    Jun 11, 2014
    Posts:
    12
    Hello guys,
    i need your help. On my current project i need a rotating icon in my TMP textfield.
    Is ther a possibility to show a rotating icon in a textfield?
    Here is a picture from my texfield with a icon and a value. The icon should rotate.

    upload_2017-8-19_12-27-52.png

    Thank you .
     
  31. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    877
    Hi all,

    I'm just getting started with TMP, and I'm really - REALLY - impressed. I've watched the helpful tutorials, and was awestruck watching the 'Frozen Example', as linked in the asset store. I was a bit disappointed when I realized that this demo no longer is part of the examples. Is there an official location where I can get my hands on that demo scene? I'd love to take it further apart and (if I'm lucky :)) re-assemble it.

    Thanks,
    -ch
     
  32. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Yes. The <sprite> tag has an attribute called "anim" which allows you to define this animation. The format is as follows:
    <sprite="Name of Sprite Asset" anim="0, 15, -10"> where 0 is the first frame, 15 the last and -10 the frame rate and direction.

    For this to work, you need to create a sprite asset that contains a sequence of sprite arranged in the correct order (which you can do in the TMP sprite inspector).

    The sprite will only animated in Play mode.

    Here is an example of a sprite asset that contains a coin that spins.

     
  33. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    The example scene 25 is very similar in terms of setup. The Frozen demo was obviously using a different text on the face of the text and an ENV MAP (cube map) to create the shimmering FX. See if you can tweak that example scene.

    If you can't get acceptable results, I still have the Frozen example somewhere and I can dig it up.
     
  34. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    35
    what do I have to do, if I wanted the 3d trext to cast shadows on other objects?
     
  35. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Use one of the distance field Surface shader. There is a mobile one as well as full one.
     
  36. Xanatos_88

    Xanatos_88

    Joined:
    Apr 5, 2016
    Posts:
    5
    Should it be possible to assign a TextMeshPro object to the public variable in a script on the Inspector? Or is it only possible to assign through code?

    I just want to be able to assign my public objects from the UI for my 'GameManager' script in the Inspector.
     
  37. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    It is certainly possible. There are two types of TextMesh Pro components. The <TextMeshPro> which uses the mesh renderer and the <TextMeshProUGUI> which uses the canvas system. Both of these inherit from <TMP_Text>.

    TextMesh Pro uses a namespace so you have to be sure to include "using TMPro;"
     
  38. Xanatos_88

    Xanatos_88

    Joined:
    Apr 5, 2016
    Posts:
    5
    Funny thing is that I had done that. Reloaded Unity and it works. Must have been a weird fluke.
     
  39. Akatosh

    Akatosh

    Joined:
    Jun 27, 2017
    Posts:
    7
    @Stephan_B, another question
    When I use the Asset Creator to generate font atlas, it often causes a 'Fatal error in gc' :confused:.The font source is a Chinese font and the character file includes about 2500 characters.A screen capture...

    But sometimes the generate will succeed, the frequency is about one or two times in ten attempts. It's really frustrating. What could be the cause?
     
    Last edited: Aug 25, 2017
  40. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    I have run into that a few times over the years. Most frequently in some versions of Unity than others. Never really able to pin point the source of the issue.

    Having said that, when generating a font asset where you are trying to include 1000+ characters, using the Auto Sizing option will make this process much slower. What I usually do is switch to Manual size and use Hinted Smooth since it is fast to get some result / sense of whether or not the manual size I picked was too small or too big. You could most likely still test with Auto but with Hinted Smooth as this skips the SDF computation where take a while. Then when I have figured out what the optimum size is, I then (again) use manual size and switch to Distance Field 16.

    Given that I tend to do as I described above when generating these larger assets, it could be one of the reasons I haven't run into the GC issue more frequently.
     
  41. Akatosh

    Akatosh

    Joined:
    Jun 27, 2017
    Posts:
    7
    I tried to use Hinted Smooth and figured out the proper size is 33. Then switch back to DF16, generate, and crash again:rolleyes:. 5 errors in the next 5 attempts, but on 5 different progress bar values(LOL).

    Unity version 5.6.1f1 is installed on the company computer. Maybe I should get back home and try it with my own computer?
     
  42. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    Can you provide me with a link to the font file and the character file you are using to generate this? I can try it on my end and see if I get the same results.
     
  43. Akatosh

    Akatosh

    Joined:
    Jun 27, 2017
    Posts:
    7
    Last edited: Aug 28, 2017
  44. tcmeric

    tcmeric

    Joined:
    Dec 21, 2016
    Posts:
    181
    rrahim likes this.
  45. Igorexa

    Igorexa

    Joined:
    Sep 25, 2014
    Posts:
    22
    Can i made effect in TextMeshPro like 'floating text' in HTML?

    Something like this:
     
  46. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    TextMesh Pro doesn't currently support having text flow around other objects like an image. However, using the linked text overflow mode, you can achieve similar results. Take a look at example 16 included with TMP.
     
  47. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    97
    Stephan, is there a simple way to freeze an animated sprite in a TMP object? I noticed that the TMP_SpriteAnimator code has a StopAllAnimations method but I'm not sure whether that's really what I want. Essentially, I want to be able to start and stop a spritesheet and change which frames are looping at runtime.
     
  48. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
    Hello guys!

    https://fonts.google.com/specimen/Open+Sans?selection.family=Open+Sans

    I'm trying to make an atlas with this font. I want all the characters to be included. What settings do I have to give to the Font Asset Creator in order to not get any missing characters? I already tried Exted ASCII but I still have a good couple of fonts missing.

    Thanks <3
     
  49. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,517
    To define the characters to be included in a font asset, you can use the Unicode range option and define a range that will include all the characters you want. You could also use the characters from file option where such text file would include all the characters used in your project.

    Having said that and although you could define a range that includes all the characters from the font file, some font files include thousands of characters so it is not advisable to try to include all of them. Best option is to figure out all the text used in the project for the different language and just make sure those characters are included.
     
  50. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    97
    So that might be two separate issues.
     
Thread Status:
Not open for further replies.