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

    HNKMaster

    Joined:
    Aug 31, 2012
    Posts:
    19
    Hi everybody.

    I'm having a huge problem after updating TextmeshPro today, because it made all my text disabled for some reason. I tried redownloading it, but it's no use. When I select some TMP object from the scene, the console put this:

    "Instance of TMP_UiEditorPanel couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder."

    What can I do to fix that?
     
    FaberVi likes this.
  2. FionaSarah

    FionaSarah

    Joined:
    Aug 26, 2015
    Posts:
    11
    I just had this and was about to post about it, but closing and reopening Unity fixed it for me. Hope it does for you too.
     
  3. HNKMaster

    HNKMaster

    Joined:
    Aug 31, 2012
    Posts:
    19
    I actually had a backup for that project, with the old TMP installed, so I copy/pasted that on my current project. I will try that next time I update TMP. Thanks anyway.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you had a scene using TMP opened when performing the upgrade, given the DLL's cannot be unloaded, it is possible that it puts Unity in a state of funk when importing the next package. Closing Unity and then reopening should solve that.

    Let me know if the issue persists after reopening Unity.
     
  5. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Any update on TMPro integration in Unity text pipeline?

    Basically I'm looking after a reliable way to detect if it's installed, a #define thing so TMP code can be automatically disabled and in case it's not available continue using the standard Text component as a fallback.

    Merry Christmas everyone btw.
     
    mgregoirelds likes this.
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Starting with Unity 2018.1.0b2 a new version of TextMesh Pro will be included along with the Unity Editor. This is not the new text system but this will ensure that TextMesh Pro is always present with versions of Unity going forward.
     
    hippocoder likes this.
  7. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Alright, thanks. Will check it by then.
     
  8. Neo-Dragon

    Neo-Dragon

    Joined:
    Feb 29, 2016
    Posts:
    17
    I didn't want to directly ask in this thread but after searching I've not found an answer.
    What is up with the bug on text moving when hitting Apply on a prefab? Is this a Unity or TextMeshPro issue? Any ETA on a fix?
     
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This issue is not specific to TextMesh Pro but as usual exposed by TMP. See the following post with more details on the issue.

    I should have an update today on when we might expect a fix for this.
     
  10. Neo-Dragon

    Neo-Dragon

    Joined:
    Feb 29, 2016
    Posts:
    17
    Thanks, Stephan.

    I have got a workaround.
    It's a horrible workaround but I found it (the bug) was only affecting the first text object in the prefab.
    Create a new textmeshpro object. Leave it all as the default except change the color to fully transparent (no color). It needs to be enabled.
    Click apply on your prefab.
    You'll have an invisible text object that will get screwed up instead.
     
    Deleted User likes this.
  11. dmdo

    dmdo

    Joined:
    Nov 13, 2017
    Posts:
    2
    Hi everybody,
    I've got a problem with deletion of selected text.
    For example, I have next text
    "Bold text 123 Normal text"
    If I select text in the middle with both font styles, i.e., "123 Normal" and delete it, the rest of text is going to be bold:
    "Bold text text".
    So, closing tag </b> was deleted, is there already workaround to fix it?
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I presume you are referring to this behavior in the TMP_InputField. Correct?

    If so, this is something that I will need to address when I have a chance. I might be able to work on this next week. I'll provide an update when I have more information.
     
  13. dmdo

    dmdo

    Joined:
    Nov 13, 2017
    Posts:
    2
    Right, It's in TMP_InputField. Thanks.
     
  14. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi,

    I am using Textmesh pro to display texts in my simulation. Its a global simulation user can enter the contents in their regional languages. In windows editor and build (Standalone - PC) its working fine, accepting all characters entered and displaying. When I build for MacOSX, the special characters are displaying as box, but it still working fine with MacOSX Unity editor. I am using BentonSans-Regular font for both platforms, tried different fonts like Goggle's Noto fonts and other Unicode fonts. The issue is still there and not resolved. Please help me to sort out this issue.

    Note: If I am using Unity's 3D Text its displaying perfectly with that same font. But I need some display quality on text with Textmesh pro's additional properties.

    I have attached the screenshot for reference.

    Regards, Ben SpecialCharDisplay.png
     
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide the exact string that you are using for that top line of text? The last word should "Plait" so so it looks like it might be trying to use a diacritical mark for the "î".

    If the text is not contained in a string but rather from some external file, please provide the file as this issue could be due to encoding.

    Once you provided the added information, I should be able to determine why this is behaving this way.
     
  16. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi,

    Thanks for the reply. I am using this word 'Oui, s'il vous plaît', its a french word. The words (title) in the tile and buttons names will be dynamic based on user input. It will be in any language.

    Regards,
    Ben
     
  17. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Is the text coming from a string or from a file? I am asking because you have "Plai□t" where the square is an extra character otherwise it would be the i with circumflex. I believe the extra square might be the diacritical mark \u0302 but I need to verify this by looking at the actual string.

    If you are using a string, please copy paste it.

    If the text is from a file, please provide the file so I can look at the actual unicode characters in the string.
     
    Last edited: Jan 14, 2018
  18. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi,

    These words (Title) are the folder names under Resources/Main folder. I just get those names using System.IO and display it in the tile. Those folders have assets like document, presentation, url etc. those file names will display over the buttons.
     
  19. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi, This issue happened in MacOSX build, not in Windows PC build. You can check in a new project in Unity MacOSX editor to replicate.
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The content of the string of text is likely the source of the issue. Unless you provide me with the exact string or source of the text, I cannot check what characters and unicode values are used.

    Can you reproduce the behavior in a new empty project? If so please submit a bug report along with this project so I can take a look at it. Please provide me with the case # of the bug report.
     
  21. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi, Please check the unity package attached.
    Case ID is 987738
    I am using Unity 2017.1.0f3
     

    Attached Files:

    Last edited: Jan 14, 2018
  22. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thank you for providing the test package.

    The text that you are using does in fact rely / contain diacritical marks as per the image below.



    This "^" is \u0302 which is not included in the font assets included with TMP nor one of the characters in the Extended ASCII Set option of the TextMeshPro Font Asset Creator. As such when this character is present in the Text Input Box or string and given it is not contained in the font asset, you get the missing glyph character which is the square glyph.

    When creating font assets, you need to make sure you include the characters that you will be using in your project otherwise if they are not contained in the font asset or any potentially assigned font asset as fallbacks, you will get this missing glyph showing up.

    To make sure the text is displayed correctly, you have two options. First, if you intend to use diacritical marks, you can certainly add them to your font assets by using either custom range or any of the other character set selection options in the font asset creator. If you are not familiar with those, please watch the following video.

    Alternatively, the LiberationSans SDF font asset included with TMP does include the Extended ASCII set which does contain those characters with accents. I don't know if you purposefully wanted to use Diacritical Marks instead of the "î" which is \u00EE.

    You can see in the image below, your original text which uses a Diacritical Mark for the "î" and then the second line of text which uses \u00EE.



    Since this \u00EE is already included in the LiberationSans SDF font asset, it renders as expected. Here is the same text "Oui, s'il vous plaît" which you can copy paste.

    Do you intend to use diacritical marks?
     
  23. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Thanks for the reply. No I am not intend to use diacritical marks.
     
  24. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    How can I get this work. There is LiberationSans SDF, which showing the same thing I reported. Is I need to made any settings or needs to enter \u00EE. Could you please share the unity-package you have worked.
     
  25. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Do I want to work with latest Unity 2017.3
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Copy / paste the string I provided to you in my previous post which was "Oui, s'il vous plaît". This string uses "î" which is unicode \u00EE.

    When entering your text make sure you use the characters with those accents which are contained in the Extended ASCII range.

    In a string of text, you can reference those characters like I did above or even reference them by using \u00EE in the case of UTF16 and \U000000EE for UTF32. This also works in the TMP Text Input Box. So typing the following "Oui, s'il vous pla\u00EEt" would also work.
     
  27. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    OK, Could you please share LiberationSans SDF with Extended ASCII or the package you worked. It will be more helpful.
     
  28. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    LiberationSans SDF is included with TMP and his the default font asset.

    Just create a new TextMesh Pro text object and copy / paste the text in quotes from my previous posts.
     
  29. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Thanks, Its working. So, If user copy paste words from web as folder name - will not work right? Needs to type it down.
     
  30. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    I just read through this and I hope I actually contribute to solving this ;)

    Ben reads a dictionary name he has no influence about. It might contain unsupported characters. Solution for display is to copy the string to a display string and replace those characters with the ones he wants to show instead (supported characters)

    If it is only this one specific characters, he could even change the fallback character (not good practice though)
     
  31. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I have been copy / pasting text from the web for years to test with different languages and have never run into a block of text that was using diacritical marks. Diacritical marks are easy to spot as you end up with "i" + "^" when you paste the text into a string or in the Text Input Box.
     
  32. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    But here its not static, user will enter whatever name they want and I am just getting those names and showing it.
    Example: this text 's'il vous plaît' causing error but the same 's'il vous plaît' not. I don't know why?
     
    Last edited: Jan 14, 2018
  33. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I explained why you were seeing the missing glyph square when a character like a diacritical mark (for instance) is not present in a font asset.

    I think it is extremely rare to have anyone type / use diacritical mark when typing text.

    If you are concerned about running into users using diacritical marks, simply add them to your font asset or to some fallback font asset(s). If you are not familiar with what are fallback font assets, then please watch the following video.

    There are also several posts discussing font asset creation, material presets, fallbacks and localization with TMP. There are also thousands of posts on the TextMesh Pro user forum with this type of information.
     
  34. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Thanks for the update.
     
  35. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi, Need one clarification, If we place any language text in 3D Text, its working perfectly fine. Issue is it look and feel. The same I am expecting with Text Mesh Pro, why its is not working?
     
  36. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    3D Text which is also known as TextMesh, uses the Unity fonts which by default are set to Dynamic where at runtime missing glyphs will be added into the font atlas texture. This is convenient but does come with performance overhead which can be very significant.

    When using TextMesh Pro, you need to prepare / create your font asset ahead of time and make sure they contain the characters you are expecting to use. For Latin based languages and Cyrillic this is simple since their character set is small and limited. For the Chinese, Japanese and Korean languages, their character sets are much larger so this requires creating additional font assets which are assigned as fallback to the primary font asset of the given language. There are several posts detailing this information already here and on the TextMesh Pro user forum. This information is also provided in the video about Font Asset Creation which I linked to you before.

    Having to create the font assets is an extra step but it does provide for best performance and quality assurance as you know exactly how everything will look on all platforms.

    Again make sure you watch the videos that I linked as they explain all of this in detail. You should also watch the Working with Material Preset video.

    There are videos about almost every aspect of TextMesh Pro so take the time to watch all these things as it will give you a much better understanding of the tool. There are also lots of examples included with TextMesh Pro, also take the time to review those as they also cover a lot of the functionality.
     
    flashframe likes this.
  37. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi, Thanks for the updates. I did added required language fonts as fallback.
     
  38. jlanisdev

    jlanisdev

    Joined:
    Jan 18, 2016
    Posts:
    76
    Is there any ETA for dynamic font support? Apparently it was in the works, but that was over a year ago. Just wondering if it is still being planned. It would be nice to have, even if it comes at a performance cost. Frankly, there are many situations/games where creating a font atlas is overkill for the amount of text in the game.
     
    Last edited: Jan 17, 2018
  39. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See the following post which provides details about this.
     
  40. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    Hi,
    we are using Unity 2017.3.0f3 and the newest TextMesh Pro from asset store and we have problem in builds - every textmesh pro text is completely broken. In editor, everything is fine.

    Here is how it looks in build https://c2n.me/3RbfL6e.jpg

    Thanks for your help! :)
     
  41. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What build platform? Most of the time, this is the result of some compression being applied on the font atlas texture which doesn't work for SDF.
     
  42. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    Windows. We tried to move fonts with atlases to folder which should make sure that unity doesn't compress it but even then it still creates same result.
     
  43. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you see if you get the same behavior with some of the examples scenes included with TMP? For instance, try example 17 - Old Computer Terminal.
     
  44. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    Your scenes are ok even with font atlases we created with a font creator.
     
  45. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Do you see the issue only with certain font assets or with certain scenes? Trying to narrow down what it could be.
     
  46. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Th
    I found this to happen when we instantiate canvas with the text component from prefab. Do we have to do something special after instantiating to make it work?
     
  47. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You should not have to do anything special. Make sure the "Additional Shader Channels" on the Canvas are set correctly.

    Manually select these new text object to check if the correct material is assigned and shader. Look into the debug section of the Material properties / inspector to make sure the correct font atlas texture is still being used.

    If you can't figure it out, please provide me with a repro project so I can take a closer look.
     
  48. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    For everyone: problem was with resources file larger than 4GB limit. :)
     
    Stephan_B likes this.
  49. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    @Stephan_B,
    Not sure this matters anymore but,

    TMPPRO_UGUI_Private.cs: (around line 1230)
    Code (csharp):
    1.  
    2.   if (glyph == null)
    3.   {
    4.     //Use Space (32) Glyph from the currently assigned font asset.
    5.     c = chars[i] = 32;
    6.     tempFontAsset = TMP_FontUtilities.SearchForGlyph(m_currentFontAsset, c, out glyph);
    7.     if (!TMP_Settings.warningsDisabled) Debug.LogWarning("Character with ASCII value of " + c + " was not found in the Font Asset Glyph Table. It was replaced by a space.", this);
    8.   }
    9.  
    Your code had warning after reassignment here, so it always warned about missing character 32 (which is space). If that code still exists and stuff, might wanna fix very confusing when it's telling you that it can't find space in glyph table so it's replacing with space ;D
     
  50. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Hi there,
    I am trying to get a point light to show up on some text I am creating and am doing something wrong.
    I was hoping someone on here might be able to instruct me a little bit on how to get point lights to show up on a UI setup.
    I have a canvas setup in Screen Space - Camera on the UI layer showing up just fine. When I add a point light to the scene it doesn't show up on the panel or TextMesh Pro text. The point light is on the UI layer as well and the ranges cover the panel. The UI camera is setup as Depth only culling the UI layer using the forward render path.

    I imagine I am not setting something right. I am attaching a screenshot to show the setup as best I can. Capture.PNG
     
Thread Status:
Not open for further replies.