def print_up_to(
        self,
        text: FormattedText,
        printer: ColorPrinter,
        y_pos: int,
        x_pos: int,
        max_len: int,
    ) -> Tuple[int, int]:
        """Attempt to print maxLen characters, returning a tuple
        (x, maxLen) updated with the actual number of characters
        printed"""
        if max_len <= 0:
            return x_pos, max_len

        max_printable = min(len(str(text)), max_len)
        text.print_text(y_pos, x_pos, printer, max_printable)
        return x_pos + max_printable, max_len - max_printable
Attempt to print maxLen characters, returning a tuple
        (x, maxLen) updated with the actual number of characters
        printed
src/pathpicker/line_format.py