Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Migrating from Legacy / Asset Store to Package Manager Releases

Discussion in 'UGUI & TextMesh Pro' started by Stephan_B, Jan 9, 2018.

  1. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    As per the title and assuming all goes well, a new version of TextMesh Pro will be included by default in Unity 2018.1. Most likely starting with Beta 2 or Beta 3. (See Updated Notes below about 2018.2 and additional information )

    This new version of TMP will be made available via the new Unity Package Manager (also part of Unity 2018.1). These new Unity Package Manager (UPM) packages are shared between all projects. This new version of TMP includes source code and uses the new Assembly Definition feature introduced in Unity 2017.3.

    Due to how this package manager works, it is important to understand this new version of TextMesh Pro will be using a completely different / unique set of GUIDs and FileIDs which was necessary to make sure it did not conflict with the current sets of GUIDs and FileIDs used by the source code and DLL only versions of TMP currently out there. As such project files and assets created with previous versions of TMP will require the use of a utility to convert these existing projects to use the new sets of GUIDs and FileIDs.

    During the beta period for 2018.1, I would love to get your feedback and most importantly assistance to test this project conversion utility to make sure it correctly handles the conversion process.

    My suggested upgrade steps are as follows but expect these may change based on your feedback.

    1. Before installing Unity 2018.1 or newer, open your project in your current version of Unity and close all scenes you might have opened. Using "File -> New Scene" will close current scenes. In this step we are trying to avoid having any TMP resources or DLLs loaded when you first open Unity 2018.1 or newer. Failing to do so will just confuse the crap out of Unity and make the upgrade process more complex.

    2. Due to an important change in Unity 2018.3 related to Prefabs, you must switch Asset Serialization mode to Force Text in your current version of Unity prior to opening the project in Unity 2018.3 or newer releases of Unity.

    3. Since the latest releases of the TMP package for Unity 2018.3 or newer require .Net 4.x, you should also change this in the Project Settings - Player - Other Settings.

    4. As usual, please backup your project before upgrading to this new version of TMP and Unity 2018.1 or newer.

    5. Install Unity 2018.1 or newer. Personally, I always install new major versions of Unity in separate folders which allows me to use multiple versions of Unity for testing and what not.

    6. Open the latest release of Unity and expect to see lots of error messages since the older version and new versions of TMP are present thus resulting in class conflicts. This could be avoided by deleting the "TextMesh Pro" folder in step (1) but it isn't necessary as once the previous / older version of TMP is removed by deleting the "TextMesh Pro" folder these errors will go away. That is provided you did close any open scene using TMP in step (1). Once the "TextMesh Pro" folder is deleted, Unity will go through an Assembly Reload and the new version of TMP will finally be loaded.

      Note that I could have used a new namespace for this new version but this would have required updating all the scripts referencing the "TMPro" namespace which given these errors only show up during this upgrade process, going thru all the scripts to change the namespace would have been more complicated in my opinion.

    7. Now we need to import the Essential Resources that TextMesh Pro needs. These are the default font asset, sprite asset, stylesheet, shaders, etc. You can add these to your project by going to the "Window - TextMeshPro - Import TMP Essential Resources" menu. These resources will be added to your project in the "TextMesh Pro" folder.



      Note: These resources could have been contained inside the new TMP UPM package but these would have be hidden and given they would be inside a Resources folder to make it possible to access them at runtime, they would have been part of any build whether or not TMP is used. As such I thought it would be better to make those visible to users by adding them into the local project and giving you control over them.

    8. Lastly, since this new version of TMP uses a new set of GUIDs and FileIDs, we will need to convert your existing project files and resources to use this new set. To convert the project, go to "Window - TextMeshPro - Project Files GUID Remapping Tool". This will open the new Project GUID Remapping Tool which will enable you to Scan the Project to find the resources and files than need to be converted and then if you chose convert them to the new set of GUIDs and FileIDs used by this new version of TMP. Please be sure to following the instruction provided in the tool and to have made a backup of your project first.

    Please provide feedback on this process and most importantly let me know if you run into any unforeseen issues. I have run through this process many times with various projects and it worked fine. On the other hand, "Murphy's Law" is always in full force so provided you backed up your project first, we'll be able to iron out whatever issues and make sure we get all these projects converted over nicely.

    If you have any questions, suggestions, again please feel free to ask away.


    Update Notes
    1. Unity 2018.2 - The TMP UPM package is now included by default with Unity 2018.2. As such, if your project includes a previous version of the source code or dll version of TMP, you will be getting a lot of errors as a result of having two versions of the product in your project.

      These errors are temporary and will go away once you remove the previous version of TMP and complete the upgrade / migration procedure outlined above.

    2. The TMP UPM package (like all other packages) uses the new Assembly Definition feature (.asmdef) where the TMP scripts are compiled in their own assembly. There are two assemblies: Unity.TextMeshPro and Unity.TextMeshPro.Editor.

      If your scripts also use assembly definitions, you will need to manually edit your .asmdef files to add a reference to the appropriate TMP assembly. See the following post.

    3. The Test Runner also automatically creates and uses assembly definitions when it create a test folder. The .asmdef created and contained in this test folder also need to be manually edited to add a reference to the appropriate TMP assembly. See the same post as above.

    4. There appears to be issues related to project solution where the TMPro namespace or some of the scripts / class of TextMesh Pro might not be recognized in Visual Studio. If that is the case, upgrading to the latest release of Visual Studio 2017 which is currently 15.7.5 appears to resolve this issue.

      Similar issues can also happen with other code editors. In all cases, please update those editors to the latest / most recent versions and it should resolve these issues.

    5. The scanning process to identify which project files need to be modified to reference the new GUIDs and FileIDs used by the TMP package can be very slow. As such, I have modified the tool to allow specifying a target folder to scan. This way, you can target only the folders that you know contain TMP related stuff / references. Depending on the structure of your project, this can greatly speed up the conversion process.

      Please note the project files can be converted progressively. So even if you forgot some files / folders, you can always re-run the conversion tool to target these addition files / folders.

      Also note the scanning process does not modify any of the files. The modification only happens on the next step.

      This improved Project Files GUID Remapping tool will be included in version 1.2.5. Until version 1.2.5 is released, I have attached the modified code file for the scanning tool, which you can download and replace from the package cache.

      upload_2018-7-24_15-32-59.png

    6. Some users may have manually re-assigned script referenced in the past. In some cases, the incorrect dll / script was re-assigned. So if it appears that some of the files that you suspect contain TMP related stuff are not getting converted which you think you might have manually re-assigned in the past, then download the replacement GUID conversion file found in this post.

    7. Uncovered potential issue with Prefabs where even though a project serialization mode may be set to Force Text in the Project Settings - Editor - Asset Serialization, the prefabs might have remained serialized in Binary which would result in the GUID Remapping Tool ignoring these prefabs since they are still in binary format.

      In order to make sure prefabs are handled correctly, you can open the backup of your project in the previous version of Unity (prior to undergoing the upgrade process) and switching serialization mode back to Mixed Mode and then back to Force Text which would force these prefabs to get re-serialized as text. To make sure the re-serialization worked correctly, you can open in some text editor the prefab file to see if it is indeed in text format. Once it appear the prefabs and other assets are all in Force Text mode, the process with the upgrade process as per the instruction above.
     

    Attached Files:

    Last edited: May 3, 2019
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Looking forward to it :)
     
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307
    What types of things can we expect from this new version?
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The usual minor bug fixes with the addition of revised TMP Shaders to support the new UNITY_UI_CLIP_RECT shader keyword which on some devices can provide a noticeable performance improvement.

    Also made improvements to Kerning which now provides control over the x and y offsets as well as xAdvance of the first and second glyph in the defined pair. This change will enable users to define / setup diacritical marks correctly and other glyph adjustment pairs.

    The table has also been renamed "Glyph Adjustment Table" which now also features a search bar to make it easier to find / edit those adjustment pairs.

    upload_2018-1-9_19-13-2.png
     
    kreso, Laicasaane and CDF like this.
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    I have a question that I was thinking for some time.

    Would you change at some time that Text and TextMeshProUGUI inherits both from a base class? Now we can't support Unity text and text mesh pro at the same time. Unity text will disappear at same time or they will be both available?
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    No major changes will be done to UI.Text.

    There are no plans for major changes / improvements on the TextMesh Pro components but I do reserve the right to maybe sneak in new stuff if it will make users happy and if it doesn't slow down or affect getting the new Text System done and released :)
     
    StefanoCecere and hippocoder like this.
  7. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307
    Fingers crossed for getting the SDF texture generation time down ;)

    Will editing SDF fonts be much more streamlined now? Kinda frustrating with the current system if you ever need to change a font, like including more characters. I never remember what all my settings are for the SDF generator :(

    Anyway, looking forward to it
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    With the Hybrid Dynamic system, that should become much easier and I have some thoughts on additional coolness that will make that easier :)
     
    CDF likes this.
  9. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    So just tested it in 2018.1.b3... .. upgraded a project that was already in 2018... it mostly worked fine.

    The import TMP essential resources step seems like no brainer, as to why that isn't just done anyway on importing the package really if that is the only way you can use the package.. I kinda missed doing it after scanning project and updating it...only to open the scene and find nothing was there :D ...Anyway maybe Unity upgrade the entire Project Window ,make it less S*** (like proper details column with file/folder size, last modified, sorting headers etc) while also adding a global like Asset folder to show package stuff (source/resources/examples) that are used in the project etc.. that way we don't need to import extra things from the package into the project kinda somewhat defeating the whole point of global packages in a way.

    Also I had a custom font material left in the old TMP resource folder that got moved out of the project along with old TMP version.. it seems after scanning and fixing the guuid stuff it just defaulted the material back liberation.. not sure if it would have done that if I hadn't forgotten about the custom font material I was using for everything in project before doing that??? , but the good thing was the guuid remapping tool worked again and found that one material and fixed it so it was recognized in the materials for tmp components.. the bad thing is well a bunch ton of tmp components to go fix again with modified font mats...and dealing with Unity's awful prefab system that needs everything draggin into a scene just to fix lower hierarchies, so yeh nested prefabs what a wondeful solution that could be right now..

    I did get like 200 errors of this and similar.. things work and run fine now and haven't seen these errors again after clearing them..
    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. TMPro.TextMeshProUGUI.UpdateSDFScale (Single lossyScale) (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMPro_UGUI_Private.cs:4172)
    3. TMPro.TextMeshProUGUI.LateUpdate () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMPro_UGUI_Private.cs:1562)
    4.  
    Code (CSharp):
    1. UnassignedReferenceException: The variable m_mesh of TextMeshProUGUI has not been assigned.
    2. You probably need to assign the m_mesh variable of the TextMeshProUGUI script in the inspector.
    3. UnityEngine.Mesh.SetSizedArrayForChannel (InternalShaderChannel channel, InternalVertexChannelType format, Int32 dim, System.Array values, Int32 valuesCount) (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:78)
    4. UnityEngine.Mesh.SetArrayForChannel[Vector2] (InternalShaderChannel channel, UnityEngine.Vector2[] values) (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:91)
    5. UnityEngine.Mesh.set_uv2 (UnityEngine.Vector2[] value) (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:154)
    6. TMPro.TextMeshProUGUI.UpdateSDFScale (Single lossyScale) (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMPro_UGUI_Private.cs:4192)
    7. TMPro.TextMeshProUGUI.LateUpdate () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMPro_UGUI_Private.cs:1562)
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. TMPro.MaterialReference..ctor (Int32 index, TMPro.TMP_FontAsset fontAsset, TMPro.TMP_SpriteAsset spriteAsset, UnityEngine.Material material, Single padding) (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/MaterialReferenceManager.cs:545)
    3. TMPro.TextMeshProUGUI.SetArraySizes (System.Int32[] chars) (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMPro_UGUI_Private.cs:1045)
    4. TMPro.TMP_Text.ParseInputText () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMP_Text.cs:1696)
    5. TMPro.TMP_Text.GetPreferredHeight () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TMP_Text.cs:3545)
    6. TMPro.TextMeshProUGUI.CalculateLayoutInputVertical () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.0.26/Scripts/Runtime/TextMeshProUGUI.cs:115)
    7. UnityEngine.UI.LayoutRebuilder.<Rebuild>m__4 (UnityEngine.Component e) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:72)
    8. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:133)
    9. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:130)
    10. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:130)
    11. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:130)
    12. UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:130)
    13. UnityEngine.UI.LayoutRebuilder.Rebuild (CanvasUpdate executing) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:72)
    14. UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:123)
    15. UnityEngine.Canvas:SendWillRenderCanvases()
    Last thing for now that TMP is kinda in 2018.. can you start adding the presets for TextMeshPro - Toggle, TextMeshPro - Button etc. . stuff that should really be in imo.

    -----------------------------------------------------
    ..Was about the post the above until I just found a reason I won't be bothering with this package... mainly I could blame Visual Studio's garbage assembly viewer that doesn't show much of anything..

    I might have mistaken that for TMP having source code (that could be USEABLE in the project directly through packman) ....and it does have source when you can find it in the package location (which is another area of package manager under development.. there is not even a button in unity packman that opens the folder location of a particular selected package version content/source files) for quick and ease of access. I can't stand dumb design that tries to simplify everything by just not having the options for things it should, comes across as lazy design imo.

    To top this annoyance off if you've got TMP source and project to work with already... and I'll be honest it is very useful to have (outside of minor tweaks to bits of it) because the documentation on the api stuff on functions isn't really there, hugely beneficial just to be able to navigate to those method calls and see how they are being used and what calls them etc... (just yesterday I was trying to find the best the addlistener script stuff to use for some tmp components.. and there is no manual documentation on it really (2016 manual that mainly just for editor component stuff).. and some parts of the public api doesn't even have summary text)... so for me hugely helpful that I can navigate and find references to where that code is used in Visual Studio directly in TMP that is in the project.. Now because of this package implementation and features so far.. and combined with fking MS Visual Studios own practically garbage and effing useless assembly browsing viewer, (how in the hell does monodevelop have something far better and more useable built in for developers to use when working with poorly documented dll crap, and that's not even supplied with 2018 now ).....

    Anyway if you navigate to a TMP method now.. you'll end up on something like this
    #region Assembly com.unity.textmeshpro.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    // ....\Library\ScriptAssemblies\com.unity.textmeshpro.Runtime.dll
    #endregion

    I'd gladly take a symlink of this C:\ProgramData\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.0.26... into the asset folder of the project... And Unity just automate the linking of it into a project that uses that package.. than how it works right now.

    Because for people with source in there project folder how this works is just step backwards with absolutely no benefit and advantage imo.. maybe what a minor compile time boost? sure as option to switch to when you're done developing in those areas... not worth it .. either documentation/api gets better or packman/package implementation gets better..

    For me I'll just revert the project back to how it was before.. what a waste of time. Sorry this was a total fail for me. I assumed it was going to work better than it turned out... Package manager current design and implementation in Unity (and improving in other areas like project window etc as mentioned earlier to make certain packages completely fit into the editor and project workflow properly) is just S*** no other words.

    Sorry for rage :) I don't think hybrid dynamic font system is going to make up for this packman stuff right now.
     
  10. holgk

    holgk

    Joined:
    Aug 26, 2013
    Posts:
    10
    Hi!

    I'm working on a plugin (it's an UI extention framework for my company) and would like to know against which dll i have to link against so i can use it inside that plugin.
     
  11. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    So I just threw most the stuff from the com.unity.textmeshpro@1.0.26 dir into the asset TMP folder and removed the package from project, at least it works for me this way with VS, hopefully it will continue to work this with future releases of TMP from packman or it gets improved to where I don't need to this manual copying of its files over.

    Question now is where do you setup the hybrid dynamic font stuff.. is that actually in this version?

    And as I'm looking at generating fonts for other languages now.. in the Font Creator, is there not an option for the Character Set option to be just every letter/symbol in the Font Source I'm feeding it? It maybe overkill but still I'd like to see the results of doing it that way :)
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    @Stephan_B thanks for the painless upgrade process, worked fine. Even found my prefabs.
     
  13. stansison

    stansison

    Joined:
    Feb 20, 2016
    Posts:
    28
    Very much looking forward to this. If it would take some time for the patch 2018 to come out, would you recommend grabbing the free version for now?
     
  14. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Is the TextMes Pro folder going to stay in our Assets folder or is it going to be moved into hidden PackageManager cache folder?
     
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The "TextMesh Pro" folder in the local project contains the Essential Resources needed by TMP and Examples & Extras (if you elected to add those).

    Since these resources could be modified by users and likely to be included in builds, they are placed in the local project to make them visible to users.
     
  16. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Does the tool remove all the obsolete Text Container components?
     
  17. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The tool simply converts the old GUIDs and FileIDs to the new set of GUIDs and FileID.

    It does not remove or alter any of the objects / components.
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Hey I tried the upgrade tool right now, and it's complaining about not having "Visible Meta Files" on version control.

    I use collaborate and the "Version Control" option is greyed out for me. It does show Hidden Meta Files as selected, but I think it's bogus, since collaborate uses visible meta files anyway (and I do have .meta files all over my project), but I think that's what's tripping up the tool.

    (EDIT: Also, is the tool supposed to take HOURS, or is there something wrong? (the project is big-ish))
     
    Last edited: Jan 27, 2018
  19. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Oh, the leftover text containers spam into the log that they are obsolete. I've got tonnes of them buried everywhere in my prefabs. What would be the easiest way to remove them all?
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I’ll double check the visible meta requirement. I use Collaborate as well and did not have that issue.

    In terms of the process time, it should not be that long. Perhaps this meta thing is confusing the tool.

    When I get home, I can tell you what file to edit to get around the meta part.
     
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You can remove them by deleting the TextContainer component from those prefabs Or create some editor script to do it.

    Right now I would wait until the RectTranform / Prefab apply issue is resolved.
     
  22. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    I got it working for the time being (I'm not really trying to get any work done with 2018 atm, so I can be messier than usual). I just had to disable collaborate so I could change that visible meta option.

    And then it took for the tool 2-3 hours to find everything. My project is not small, but it's not that big either. It's fine either way, it worked fine in the end, I was just expecting the process to be quick, so I kept fighting the feeling that something really wrong was going on. But it worked in the end.
     
  23. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Any chance you could submit a Bug Report or provide me with a Repro of that project so I can take a look at why it is taking that long?
     
  24. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Stephan_B likes this.
  25. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    I don’t think I can share the whole project.

    I’ll try to create a minimal retro in the next couple of days, but I think it may have something to do with my machine too. I’ll see if I can try on a different machine as well, but no promises.
     
  26. ClancyM

    ClancyM

    Joined:
    Jan 30, 2018
    Posts:
    6
    Will the new TMP make the task of creating crisp text with small font sizes (9-12 point) easier or improve their rendering quality?

    At the moment I have not been able to find any way to display small fonts in a clear manner as the text always looks either blurry or inconsistent in size.
     
  27. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    For point sizes like 9 to 12, using a bitmap font asset with hinted smooth is as good as you can get. You can still get good results using SDF with certain fonts but in the end that is not a lot of pixels to work with.

    Keep in mind that given most devices now have retina / higher resolution / pixel density, the need to render at those small sizes is going away. For instance, Apple's new San Francisco font no longer uses hinting as hinting was mostly only beneficial at small point sizes which at higher pixel density / resolution like retina displays is no longer really necessary. The key issue with hinting and small point sizes was essentially making all fonts pretty much look the same (again due to limited number of pixels to work with). As resolution increases, to maintain the same physical size, we will be sampling that 9 point at 36 points where the shape and visual appearance of the font will be better maintained using anti-aliasing and SDF will once again be great for those perceived small point sizes.

    P.S. Keep in mind that some fonts look better than other at small sizes. Apple's new font is an example of this. So pick you font carefully for those small sizes as some of them can still look good at 9 point using SDF.
     
    dadude123 likes this.
  28. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    At least "pixel-fonts" can be rendered perfectly crisp.
    You need a relatively high distance in your SDF font (8 or higher). And then you increase the scaleX and scaleY in the debug settings of the SDF shader.

    Even selecting those intended values like "Raster Hinted", will only give bad results in many situations.
    A normal SDF with scale increased will give you pixel perfect fonts + the ability to set outlines and shadows.

    However I have not found a good way to get good rendering with very small fonts.
    Or maybe that's just because I'm so used to clear-type rendering?

    edit:
    Just saw Stephans post above. Higher pixel density is definitely an advantage as TMP (the SDF technique) becomes unbeatable in quality as the font size increases.
     
  29. PyrO1706

    PyrO1706

    Joined:
    Jun 24, 2014
    Posts:
    3
    Stehan_B I am wondering if you would / could include rsp files in the essentials to define a compiler symbol so in case people wanting to provide assets they would get the option to support Text and TextMeshPro (if the essentials are existing in the project)
     
  30. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The latest release of TMP should include the "TMP_PRESENT" define.
     
    TeagansDad and PyrO1706 like this.
  31. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    When we try to debug in 2018.1b5 with the new TMP from PackageManager and VS for Mac.

    Build FAILED.

    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_UpdateManager.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_UpdateRegistery.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_XmlTagStack.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_EventManager.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_ExtensionMethods.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_MeshUtilities.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAsset.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_Private.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_DefaultControls.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TextMeshProUGUI.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SubMeshUI.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_FontUtilities.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_LineInfo.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_ShaderUtilities.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAssetImportFormats.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Dropdown.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Asset.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_UGUI_Private.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ListPool.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/MaterialReferenceManager.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Style.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Text.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/PackageResourceImporterWindow.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TextContainer.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextElement.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontAsset.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_StyleSheet.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ColorGradient.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ScrollbarEventHandler.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_MaterialManager.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TextMeshPro.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Compatibility.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SelectionCaret.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_MeshInfo.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_InputField.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SubMesh.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextInfo.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_CoroutineTween.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Sprite.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/FastAction.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Settings.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ObjectPool.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAnimator.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_InputValidator.cs' could not be found.
    CSC : error CS2001: Source file '/Volumes/OSX/Projects/Unity/Musicuso/Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextUtilities.cs' could not be found.
    0 Warning(s)
    45 Error(s)
     
  32. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Does this happen consistently? Was this happening with beta 4?

    I am traveling today but will look into it over the weekend or on my flight if I can.
     
  33. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    I just installed TextMesh Pro 1.1.0 using the Package Manager in 2018.1.0b6 and noticed it can't be referenced by my custom assemblies in the project.

    To make it work, I manually edited my asmdef files to add references to "com.unity.textmeshpro.Editor" and/or "com.unity.textmeshpro.Runtime"

    It seemed to work and the project compiles.
    Is this the correct way to approach this? I imagine the package manager, when further fleshed out, will offer to add the references, or at least inform the user of their existence.
     
  34. Belleal

    Belleal

    Joined:
    Jan 11, 2016
    Posts:
    17
    I followed the guide without too many troubles until step 6. The problem the is that Version Control Mode is not available in Collaborate mode, therefore, the GUID remapping tool is not able to do its job. Any ideas on how to overcome this limitation?
     
  35. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I need to look into this part...

    Update
    To get around this behavior, you can temporarily disable Collaborate which will allow you to go change the Editor Settings in the menu "Edit - Project Settings - Editor - Version Control Mode to Visible Meta Files". As soon as this is done, re-enable Collaborate and then re-scan the project for conversion.

    Collaborate will then track the changed files including the modifications to the EditorSettings.asset.

    As usual, please be sure to back up your project before doing any of this.
     
    Last edited: Feb 13, 2018
    Belleal likes this.
  36. Belleal

    Belleal

    Joined:
    Jan 11, 2016
    Posts:
    17
    Thanks, I'll try this as soon as I am able and will let you know.
     
    Stephan_B likes this.
  37. JSwigartPlayful

    JSwigartPlayful

    Joined:
    Feb 29, 2016
    Posts:
    18
    Looking for recommendations for avoiding a big performance issue with TMP.

    Why does the OnEnable of TextMeshPro call SetVerticesDirty ? This causes the object be queued for a graphics rebuild, which in some cases we're using is very expensive. It seems completely unnecessary to rebuild the graphics when in essence one just wants to show/hide it using the unity standard ways of doing so.

    I also tried turning off the sub meshes(via SetActiveSubMeshes and renderer.enabled), but that appears to be unreliable, because I think something within the precompiled assembly is turning it back on again.

    It seems reasonable to expect a mesh not to be rebuilt simply by enabling/disabling the component.
     
  38. JSwigartPlayful

    JSwigartPlayful

    Joined:
    Feb 29, 2016
    Posts:
    18
    Think I've found a suitable workaround by making SetMeshFilters public
     
  39. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Enabling and disabling objects can actually be pretty expensive depending on how many are being enabled and disabled and especially so with the Canvas system if using Layout components as disabling or enabling a single object can affect many.

    Depending on what you are trying to achieve and if you are using the normal TextMeshPro component with the MeshRenderer, disabling the MeshRenderer has always been much cheaper than disabling / re-enabling the object itself.
     
  40. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    At some point, the Reference object picker in the Assembly Definition Inspector will allow you to see and pick package assemblies like those of TMP. Until then, as you have done, users will need to manually edit their .asmdef to add references to the package assemblies they want to reference.
     
  41. Skjalg

    Skjalg

    Joined:
    May 25, 2009
    Posts:
    211
    I can't get that workaround to work using Unity 2018.1.0b7

    AssemblyDefinitionException: Could not find assembly reference 'com.unity.textmeshpro.Runtime'
    edit: Got it working by adding "Unity.TextMeshPro" instead of "com.unity.textmeshpro.Runtime"
     
    Last edited: Feb 20, 2018
  42. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The assemblies were renamed to a new naming convention as you have uncovered. The current names should remain consistent going forward.
     
  43. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,817
    Does this mean that there will no longer be a difference between the paid (old) version and the asset store version? If so that is great :)
     
  44. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That is correct.
     
    petey likes this.
  45. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi Stephan, 2018.1b8 and we still have that Apply Prefab issue. :-(
     
  46. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I would assume the fix for it would land in the next beta.
     
  47. Yunkyu-Choi

    Yunkyu-Choi

    Joined:
    Oct 20, 2012
    Posts:
    5
    I find Korean word wrapping is wrong. It should be same as English. Korean use spacing between words like English and most other western languages. Chinese and Japanese don't do that but Korean do. I look into the Unity 2018 code and just commented out some Hangul (Korean language character set) handling of wrapping along with Japanese and Chinese (called CJK). It seems working well but I need it on Unity 2017.3. So plz let me know how can I do it on Unity 2017.3 or plz patch the Plugin on Asset Store. I'm attaching the current (wrong) version of Korean wrapping and corrected version movie files. Also an image file of the 9 lines I commented out for the correction.

    Correct One: https://drive.google.com/open?id=1u19XVCrNtbkzuLRs2OAa1DC3LziLqNAy
    Wrong One: https://drive.google.com/open?id=1Cv49KgsvZBsD8lho5XrTRsDvz-eqAe9z
     

    Attached Files:

    Last edited: Mar 1, 2018
  48. Yunkyu-Choi

    Yunkyu-Choi

    Joined:
    Oct 20, 2012
    Posts:
    5
    I figured out by myself. Just replacing Unity2017 TextMesh Pro from Asset Store with Unity2018.1 TextMesh Pro source package seems work. Just delete all textmesh dll in Unity 2017 project and use Project Files GUID Remapping Tool to convert old font files.
     
    Stephan_B likes this.
  49. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I'll take a look. The current handling of word wrapping for Korean has been in there for several years with many Korean customers providing feedback and using it based on the current implementation. I thought Korean didn't use spacing either but that it was also accepted to use spacing.

    Revising the handling is simple as you have discovered. I just need to make sure which handling is correct and if both are required, add some flag / toggle in the TMP Settings to handle that.
     
  50. Yunkyu-Choi

    Yunkyu-Choi

    Joined:
    Oct 20, 2012
    Posts:
    5
    Thank you for quick replay. Yes Korean use both ways. Usually title or some formal document are preferred to be written without breaking words. Adding option will be nice.