Checking the length of a string

How would I go about seeing how long a string is on the screen? Not the amount of characters, but like 20 units wide or w/e.

I’m not sure if there is a way, I had to calculate it by hand. :\

**[Surface.GetTextSize

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Surface.GetTextSize)** should do it.

[editline]3rd January 2011[/editline]

The font that you will be using needs to be set before you call this.

Thanks, I just learned something. :smiley:

Thanks.