GithubHelp home page GithubHelp logo

Comments (8)

makermelissa avatar makermelissa commented on June 9, 2024 1

If you pass in max_glyphs=30 or whatever number is your largest size, then it will handle this correctly. If not specified, it assumes the length of the default text is the max_glyphs. I believe this issue is more about having it degrade with a better message since "Group full" is a little misleading.

from adafruit_circuitpython_display_text.

iraytrace avatar iraytrace commented on June 9, 2024

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.

from adafruit_circuitpython_display_text.

anecdata avatar anecdata commented on June 9, 2024

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.

from adafruit_circuitpython_display_text.

dhalbert avatar dhalbert commented on June 9, 2024

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".

from adafruit_circuitpython_display_text.

caternuson avatar caternuson commented on June 9, 2024

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?

from adafruit_circuitpython_display_text.

kevinjwalters avatar kevinjwalters commented on June 9, 2024

I just got confused with this too. I agree with @dhalbert and @jepler in Discord, a re-throw with a clearer exception would be a good thing.

from adafruit_circuitpython_display_text.

kevinjwalters avatar kevinjwalters commented on June 9, 2024

max_glyphs is also problematic as this is not documented in enough detail for the user to know that this needs to be maximum(all possible text lengths) + 1 - note the + 1.

The raise RuntimeError("Please provide a max size, or initial text") in the code doesn't really help here either as it mentions a max size.

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
. This was fixed by 5fe2117

from adafruit_circuitpython_display_text.

caternuson avatar caternuson commented on June 9, 2024

Closing this for now. Looks like it was nominally fixed with #48.

from adafruit_circuitpython_display_text.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.