<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_height_rect( self, x: int, y: int, width: int, height: int, string: str ) -> int: """Return the height of this text word-wrapped into this rectangle. 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. Returns: int: The number of lines of text once word-wrapped. """

        string_ = string.encode("utf-8")
        return int(
            lib.get_height_rect(
                self.console_c, x, y, width, height, string_, len(string_)
            )
        )