-
Notifications
You must be signed in to change notification settings - Fork 38
Show a better message when exceeding max_glpyhs / initial text length #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Given the nature of the Label, I would suggest this should either truncate the input text in the property setter method, or otherwise have a more graceful recovery. |
I believe this behavior is currently as-designed. Label needs the maximum number of characters, or pixel width using the bounding box based on the current font. Enlarging the allocation, auto-truncation option, even a scrolling text option would be great. This gets tricky with multi-line text though. I often use dynamic label text, so currently have to pre-calculate the width of the new text and create a replacement Label rather than just changing the text of an existing Label. |
If you pass in |
I just encountered this too. I'd suggest either it just truncates or we catch the "Group full" exception and throw with a more meaningful exception message like "Text too long" or "Text exceeds max_glyphs". |
Agree with above two comments - this issue is just a suggestion for better fail behavior. And once implemented, update the displayio guide. Would truncating be the more user friendly option? |
The Added later: I've just realised this is due to a fairly recent change in fb0cfee as I had a look into a feedback report for https://learn.adafruit.com/clue-sensor-plotter-circuitpython being broken. I put a simple example in Adafruit Forums: label.Label max_glyphs behaviour has changed |
Closing this for now. Looks like it was nominally fixed with #48. |
Maybe I'm incorrectly assuming the mutability of a Label? You can reassign the text, but if it is longer than the original text, then you exceed a Group limit.
The text was updated successfully, but these errors were encountered: