'Get the size of a given string, in pixels.'

def textsize(self, text, font=None, spacing=4, direction=None, features=None):

    if self._multiline_check(text):
        return self.multiline_textsize(text, font, spacing, direction, features)
    if (font is None):
        font = self.getfont()
    return font.getsize(text, direction, features)
