I’d like to find a way to tell the size of text in pixel unit. The method I’m using is:
- Create a shadow TextMeshProUGUI component somewhere and hide it.
- Copy the properties of a showing TextMeshProUGUI component to the shadow.
- Set the text I was going to measure to the shadow. Call ForceMeshUpdate on it and then get the result by GetRenderedValues.
Basically it’s working in this way but I’m not sure if there were some better approachs since the ForceMeshUpdate seems to be a bit heavier. No need to be very precisely an approximate value would be acceptable.