External fonts

At present, I don’t believe there is a way to load a Font object from an external source (such as a Stream). The TextCore.FontEngine class offers a way to load external fonts from a byte[ ] array, but offers no way to get a Font object out of it.

The functionality must exist in the engine, as asset bundles appear to store raw .ttf/.otf files. I assume it’s possible to construct an asset bundle in memory by reverse engineering the format and load the font from that, but this approach is extremely fragile and quite ugly (not to mention forwards-incompatible!)

Currently I have a custom modified version of TextMeshPro that allows me to get a TMP_FontAsset from an external file, but this of course won’t be compatible with UIElements once runtime support is rolled out.

Would it be possible for this to be addressed during the 2020.x release cycle?

1 Like

Seconded. Having to rely on Asset Bundles or having to stitch together lower half of text rendering stack hampers modding and will probably break in the future, even more so when most of the needed stuff already exists in the engine, just inaccessible.