Import TMP font at runtime

You can most certainly import font assets at runtime from Addressables, AssetBundles, etc.

You can also create font assets at runtime using something similar to the following:

// Get paths to OS Fonts
string[] fontPaths = Font.GetPathsToOSFonts();

// Create new font object from one of those paths
Font osFont = new Font(fontPaths[index]);

// Create new dynamic font asset
TMP_FontAsset fontAsset = TMP_FontAsset.CreateFontAsset(osFont);

The above is from the following thread which also discusses the new Dynamic OS Font Asset type coming in the next release.

There is TMP_FontAsset API functions to add characters to font assets, etc.

3 Likes