Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. 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

TextMesh Pro Small fonts and clickable text issues

Discussion in 'UGUI & TextMesh Pro' started by drHogan, May 19, 2017.

  1. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hello guys,

    I slowly started porting all of our project UIs to TextMesh Pro, and I am having a couple if issues I am stuck with no matter the amount of googling.

    > Small fonts. We're not talking of tiny little ones, but a Trajan (1024x1024 atlas) and a Goudy Old Time (512x512 atlas) that even on 25-30 points looks like having the issues of small fonts rendering. I tried also supersampling, made them twice or thrice the size and then scaled down the transform, it got slightly better but not by much. I tried both the DF formats and the Smooth ones, but didn't seem to change. Any solution I might have missed?

    > Clickable text. I might be dumb in this one, but before i just had a text UI element with a Button component, and it worked perfectly. It did highligh, change color when pressed, etc etc. Now with TextMeshPro i seem to find absolutely no way to reproduce the same setup, any idea?

    Cheers,
    H
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,457
    When you created the SDF Font Asset, what was the resulting Sampling Point Size? What padding value did you use? If you are not familiar with these, make sure you watch the Font Asset Creation video as it covers this information.

    If you are using an SDF Font Asset, the text should render cleanly. No need to mess with scale or anything like that. Please post some images of the settings you are using on the text object and of the rendered text. Make sure I can see the setting on the material inspector as well.

    In terms of clickable text, again that should be working but would need more information about how you have this set up. For testing, just create a UI Button. Delete the UI Text component child. Then select the button and use right click context menu create to add a TextMesh Pro UI text object. It should be added as a child automatically and should behave as expect with highlight and all.
     
    drHogan likes this.
  3. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hi @Stephan_B , first of all thanks for answering. Tomorrow gonna check the video, take some screens and share, right now i am not at my machine any longer. as a first thing, i tried padding 5, then padding 1, but the result were the same.

    As for the clickable, my intention was to make the text itself clickable, not the button having the TextMeshProUI object as child (that one works without problem). For this specific case it works also like this, but if I wanna move our dialog system from the classic text to TMP, there I will have to have the text itself clickable (and highlightable)
     
    Last edited: May 20, 2017
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,457
    If the Ratio of Sampling Point Size to Padding is too small (less than 5%) it will greatly reduce the effective range of material properties like shadow, outline, etc. plus it might result in visual artifacts. See FAQ Question 2 & 11.

    This might not be the issue you are running into but important information to know. I'll wait to get images showing your settings.

    You should be able to interact with just a text object. Look into the Extra Settings panel of the text object in case, Raycast target is disabled.

    On a separate note, look at the Text Interaction Example scene in the examples folder as you might also find that interesting.
     
  5. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hi @Stephan_B , here should be more or less everything. I did experiment a bit with the settings you suggested and that are suggested in the video as well, but I can't seem to see a huge difference in results. Here's an example of one of my tooltips in 4 versions, one with the classic UI text, the other ones with TMP with different settings.



    Here's a comparison of the two Goudy Old Times SDF, the left one used for the lower left pic of the above comparison (the one I made before), the right one for the lower right one (the one I made now). (the Goudy is used for the long text in the tooltip, the other texts are in Trajan and have more or less the same stats, so first left one UGUI pure, the other ones with same padding percentage as the Goudy)



    And here's the inspector for the SDF, left fairly standard in settings (if the pic doesn't load - > http://www.empiresinruins.com/Screenshot_44.png)


    As for the clickable test, meanwhile i solved the problem, it was me being dumb as I expected (because TMP doesn't require you to set a size for the rect transform that contains it in order to work, i had mine left set to the defaul 0,0 so obviously it couldn't catch any mouse pointer.
     
  6. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Hi @Stephan_B , I had to work on some other stuff for a while, but now I am back on this, and also after watching the video I can't seem to solve the issue. Any idea based on all the screenshots I had posted?

    Cheers
     
unityunity