docs: def print_rect(
          self,
          x: int,
          y: int,
          width: int,
          height: int,
          string: str,
          bg_blend: int = tcod.constants.BKGND_DEFAULT,
          alignment: Optional[int] = None,
      ) -> int:
          """Print a string constrained to a rectangle.
  
          If h > 0 and the bottom of the rectangle is reached,
          the string is truncated. If h = 0,
          the string is only truncated if it reaches the bottom of the console.
  
          Args:
              x (int): The x coordinate from the left.
              y (int): The y coordinate from the top.
              width (int): Maximum width to render the text.
              height (int): Maximum lines to render the text.
              string (str): A Unicode string.
              bg_blend (int): Background blending flag.
              alignment (Optional[int]): Alignment flag.
  
          Returns:
              int: The number of lines of text once word-wrapped.
  
          .. deprecated:: 8.5
              Console methods which depend on console defaults have been
              deprecated.
              Use :any:`Console.print_box` instead, calling this function will
              print a warning detailing which default values need to be made
              explicit.
          """
          self.__deprecate_defaults("print_box", bg_blend, alignment)
          alignment = self.default_alignment if alignment is None else alignment
          return int(
              lib.TCOD_console_printf_rect_ex(
                  self.console_c,
                  x,
                  y,
                  width,
                  height,
                  bg_blend,
                  alignment,
                  _fmt(string),
              )
          )