pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.23k stars 474 forks source link

Text does not wrap when using vector (hershey) fonts #964

Open PeterCopeland opened 1 week ago

PeterCopeland commented 1 week ago

When I call display.text("Lorem ipsum dolor sit amet", x, y, 20, 1), the docs say it should wrap after 20 pixels, but it doesn't wrap at all. This function isn't implemented for vector fonts:

https://github.com/pimoroni/pimoroni-pico/blob/f18f1ba259e80e6b6fce534ba16d9d26701154aa/libraries/bitmap_fonts/bitmap_fonts.cpp#L150 https://github.com/pimoroni/pimoroni-pico/blob/f18f1ba259e80e6b6fce534ba16d9d26701154aa/libraries/hershey_fonts/hershey_fonts.cpp#L118

I don't do C++ so I haven't tried modifying that, but if there can't be support for wrapping vector fonts it should be in the readme.

Tested on an Inky Frame 7.3 with Pico W