- Text
- ListBox
- Canvas
Sometimes you want some text and image together, you need to
use canvas. However, there's no way to calculate the length
of text and wrap them properly. Simo's dashboard provide a
solution to this using his akntextutils C++ extension.
from akntextutils import wrap_text_to_array # long_str is a long string to be wrapped lines = wrap_text_to_array(long_str, 'dense', 176) x, y = 2, 0 for line in lines: y += 14 canvas.text((x, y), line, font='dense')