Is there a way to get the size of text?

Is there a function for getting the size of a string of text with a specified font and style?

Something similar to the Windows function GetTextExtentPoint32.

Yes, two: