Creating custom styles in runtime

We have a glyph system with which we show keybinds, we do this by modifying the style templates in runtime to the current keybind and then rebuilding TMPro.

However its currently impossible by default to edit the styles in runtime, they are read-only. We are forced to download the source of the package and modify it to remove the readonly attribute, when we do it all works.

Is there anyway this could be officially supported?

What properties would you need to be R/W?

I have just reapplied our patches to the latest package. It certainly isnt ideal as an API, but it works for us.

I’ve made the constructor of TMP_Style public instead of internal, and added a method to TMP_StyleSheet to update the known styles. This basically sets _mStyleList and calls RefreshStyles.

So we make our own list of TMP_Styles and call Refresh on the current stylesheet. We’ve had some issues with setting the style opening tag to some different string, and the underlying hashcode-cache not updating, but other than that this has worked pretty well.