You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that some spaces are being deleted when word-wrapping text using the wrap_text_to_pixels function in the adafruit_display_text library. Library is pulled from bundle adafruit-circuitpython-bundle-7.x-mpy-20220131.
I use a long string with long words and a narrow pixel width, and it causes some spaces to be deleted , such as in:
importterminaliofromadafruit_display_textimportbitmap_label, wrap_text_to_pixelstext_string="CircuitPython is a programming language designed to simplify experimenting and learning to code on low-cost microcontroller boards."text_string=text_string+("\n\nWith CircuitPython, there are no upfront desktop downloads needed. Once you get your board set up, open any text editor, and start editing code. It's that simple.")
width=75text_lines=wrap_text_to_pixels(text_string, width, terminalio.FONT)
print("width: {}".format(width))
print('text_lines: {}'.format(text_lines))
whileTrue:
pass
The text was updated successfully, but these errors were encountered:
This code should add a space before placing a word if it’s not the initial word in a line. This can be detected by seeing if partial == indent0 when firstword == True or partial == indent1 when firstword==False.
I noticed that some spaces are being deleted when word-wrapping text using the
wrap_text_to_pixels
function in theadafruit_display_text
library. Library is pulled from bundleadafruit-circuitpython-bundle-7.x-mpy-20220131
.I use a long string with long words and a narrow pixel width, and it causes some spaces to be deleted , such as in:
Here's the output I'm getting:
Here's my code:
The text was updated successfully, but these errors were encountered: