At long last, the wait is over!
Today, I am pleased to announce the release of the first preview of TextMesh Pro version 1.4.0 for Unity 2018.3 with support for Dynamic SDF.
One of the most requested feature since the initial release of TMP has been support for Dynamic SDF which is now available in this new release.
Dynamic SDF makes it possible to add glyphs and characters to font assets at runtime thus significantly enhancing and simplifying workflows for handling localization and languages like CJK with large character sets. This new functionality is supported throughout TMP and its fallback system.
In order to support this new feature, structural changes to Font Assets and Sprite Asset have been necessary and will require existing font assets and sprite assets to be upgraded. This upgrade should be automatically handled by the system as these resources are loaded / accessed in your projects. Although I have been testing this process using dozens of user projects where everything worked fine, I am releasing this new version as a preview as I need your help in further testing and making sure this process works as expected. With that said ā¦
Steps to Upgrade to this new release
(1) Backup your project first. This is a preview release so letās not take any chances.
(2) Open this backup of your project in Unity 2018.3.
(3) Close any scene that may already be opened in Unity. Although the asset migration process should still work. It is preferable to close any opened scenes.
(4) Open Package Manager UI via the āWindow - Package Managerā menu and as per the image below select the latest preview version available for version 1.4.0.
(5) Start opening scenes to see if everything works as expected. If not please report these issues in this thread and as usual Iāll get those addressed.
(6) If your project contains many large font assets where many of them happen to be assigned as fallbacks in the TMP Settings, opening the TMP Settings which would force all these font assets to converted as a group might appear to lock up the editor. So if you run into this, instead of accessing the TMP Settings, just select each of these font assets one at a time in the project tab. Wait for each of them to be converted before selecting the next one.
This should be it in terms of the migration.
Next is getting familiar with the new Dynamic SDF system and added flexibility it will offer and new potential workflows in regards to managing these resources. I have already published the following video which covers a big chunk of the new Dynamic System and Fallback.
The following new video covers the upgrade process as well as provides insight on the structural changes to Font Assets and Sprite Assets. The video also covers some new additional functionality that had not previously been shown / discussed.
FAQ
Question 1
Can the content of a font asset be cleared / reset?
Yes. In the Editor, you can use the Context Menu option Reset which will clear the Character, Glyph and Glyph Adjustment Tables as well as reset the atlas texture back to size 0.
Via scripting you can use the following function.
public void ClearFontAssetData(bool setAtlasSizeToZero = false)
Question 2
I am trying to switch a previously created font asset to dynamic mode and getting a warning about the atlas texture not being readable. How do I set the texture to readable?
In the font asset inspector, double click on the Font Atlas to navigate to the atlas texture. Then switch the inspector to debug mode where the Is Readable flag will now be exposed.
Question 3
Can a font asset be created at runtime?
Yes. The font asset can be created using the following function.
public static TMP_FontAsset CreateFontAsset(Font font, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode = AtlasPopulationMode.Dynamic)
As more questions or suggestions come up, Iāll add those to the FAQ.
Feedback
Please report any issues in this thread. Feel free to ask questions if anything is unclear. I am here and available to help.