Method: rich.text.Text.fit
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
3 (1)
Lines (1)
1def fit(self, width: int) -> Lines:
2 """Fit the text in to given width by chopping in to lines.
3
4 Args:
5 width (int): Maximum characters in a line.
6
7 Returns:
8 Lines: List of lines.
9 """
10 lines: Lines = Lines()
11 append = lines.append
12 for line in self.split():
13 line.set_length(width)
14 append(line)
15 return lines