Generating static font assets from script

We have been using TextMesh Pro 1.3.0 for a long time but now we are looking into upgrading Unity to 2019.4 and this forces us to update TextMesh Pro to 2.0.1 or newer.

We have been using multiple static generated fonts to support multiple languages and we are using our custom script to generate all fonts from the command line. Originally this was made by following how TMPro_FontAssetCreatorWindow handles this, but after the update to 1.4.0 multiple classes and fields became unaccessible from our code, as they were changed to be internal.

We have tried optional approach using reflection with TMPro_FontAssetCreatorWindow to generate the fonts using/manipulating the editor window. But this fails as most of the font generation logic is actually inside DrawControls method and under GUILayout.Button block, so we cannot invoke it properly.

It is hard to believe that the font generation doesn’t have an API available. What would be the suggested way of handling font generation for static fonts? Manually update them whenever we have a need to update the fonts one at a time? Using dynamic fonts is not an option as the build size would grow significantly if we had to include all the fonts to our build that we require to cover all the languages we support. Does TextMesh Pro supports using device provided font file for dynamic fonts, similar how Unity’s Text component supports variety of characters?

I would also like to know more about this topic - especially a way on how to pass whitelist characters to the TMP_FontAsset generator, which is very limited with the input parameters.

Similar discussion was already mentioned discussed here: Generate Font atlas and Save Automatically but without any actual solution in the end.