def console_print_rect(
    con: tcod.console.Console, x: int, y: int, w: int, h: int, fmt: str
) -> 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.



    Returns:
        int: The number of lines of text once word-wrapped.

    .. deprecated:: 8.5
        Use :any:`Console.print_rect` instead.
    """
    return int(
        lib.TCOD_console_printf_rect(_console(con), x, y, w, h, _fmt(fmt))
    )
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.



    Returns:
        int: The number of lines of text once word-wrapped.

    .. deprecated:: 8.5
        Use :any:`Console.print_rect` instead.