Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

label.Label max_glyphs behaviour has changed
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

label.Label max_glyphs behaviour has changed

by kevinjwalters on Sat Jun 27, 2020 9:33 am

I just had a quick look into a report of the code for https://learn.adafruit.com/clue-sensor- ... n/overview being broken. A simple REPL recreation of this is:

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>> import terminalio, displayio, board
>>> from adafruit_display_text import label
>>> text_area = label.Label(terminalio.FONT,
...                         text="", max_glyphs=5, color=0x800000)
>>> text_area.y = 120
>>> board.DISPLAY.show(text_area)
>>> text_area.text = "HELL"
>>> text_area.text = "HELLO"  ### this used to work
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_display_text/label.py", line 314, in text
RuntimeError: Text length exceeds max_glyphs


It appears to related to the change in https://github.com/adafruit/Adafruit_Ci ... fbdaad0843 . Is that change as it was intended? I think this is going to break a fair number of applications. Also, this new requirement for + 1 beyond the length of the string is not documented at the moment.

kevinjwalters
 
Posts: 634
Joined: Sun Oct 01, 2017 3:15 pm

Re: label.Label max_glyphs behaviour has changed

by kevinjwalters on Mon Jun 29, 2020 3:45 pm


kevinjwalters
 
Posts: 634
Joined: Sun Oct 01, 2017 3:15 pm

Please be positive and constructive with your questions and comments.