Skip to content

Exception with multiple consecutive newlines in bitmap label #183

Closed
@jepler

Description

@jepler
>>> l = adafruit_display_text.bitmap_label.Label(terminalio.FONT)
>>> l.text = '1\n\n\n\n\n\n\n\n\n\n1'
Warning: Glyph clipped, exceeds descent property: "1"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_display_text/__init__.py", line 416, in text
  File "adafruit_display_text/bitmap_label.py", line 539, in _set_text
  File "adafruit_display_text/bitmap_label.py", line 206, in _reset_text
  File "adafruit_display_text/bitmap_label.py", line 443, in _place_text
  File "adafruit_display_text/bitmap_label.py", line 469, in _blit
ValueError: out of range of target

This may be because _text_bounding_box does not correctly account for multiple consecutive newlines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions