As mentioned in rP22134 / D844 / #5442, the getTextSize function has some issues:
- It can only work for few GUI Types (those with a caption string), but the function is exposed to all GUI types.
- It is a copypaste of what happens in the users of GUITextOwner (most notably CText) without this being apparent unless happening to look at both places (so likely that futuer improvements to one of the copies will not be applied to the other copies, and it's more to maintain).
- The CSize conversion should use ToJSVal / FromJSVal to avoid redundancy and improve abstraction / shorten.
So moving the function to GUITextOwner removes the code duplication, removes redundant DrawText calls and improves encapsulation / separation of concernis.