Create TMPro Font asset at runtime

There are a few posts about this already. Here is one of those posts / threads .

// 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);

Having said that, Dynamic OS Font Asset support is coming which will make this process even easier. The post linked above also contains information about that.