parameters: (
          self,
          text,
          font=None,
          spacing=4,
          direction=None,
          features=None,
          language=None,
          stroke_width=0,
      )
return_statement: return font.getsize(text, direction, features, language, stroke_width)
docstring: Get the size of a given string, in pixels.
docstring_summary: Get the size of a given string, in pixels.
docstring_tokens: Get the size of a given string in pixels .
function: def textsize(
          self,
          text,
          font=None,
          spacing=4,
          direction=None,
          features=None,
          language=None,
          stroke_width=0,
      ):
          """Get the size of a given string, in pixels."""
          if self._multiline_check(text):
              return self.multiline_textsize(
                  text, font, spacing, direction, features, language, stroke_width
              )
  
          if font is None:
              font = self.getfont()
          return font.getsize(text, direction, features, language, stroke_width)
function_tokens: def textsize ( self , text , font = None , spacing = 4 , direction = None , features = None , language = None , stroke_width = 0 , ) : if self . _multiline_check ( text ) : return self . multiline_textsize ( text , font , spacing , direction , features , language , stroke_width ) if font is None : font = self . getfont ( ) return font . getsize ( text , direction , features , language , stroke_width )