Open jamesSaporito opened 2 years ago
@tuupola Hey there, just wanted to ask if you'd like me to close this PR? No worries if this functionality isn't needed!
@jamesSaporito Sorry I did not mean to ignore you. I have the usual usual "started to work for my own company and much less time for open source" thing going on.
I want to add something like this but I also have not decided how the text styling API would look. @CHiPs44 has created one idea about this https://github.com/tuupola/hagl/pull/96. There is also couple of related issues https://github.com/tuupola/hagl/issues/39 and https://github.com/tuupola/hagl/issues/42.
Main problem for me is that I do not want to open a can of worms and bloat the core library. I want to keep it reasonably small and there can be endless font styling options. So either have to choose a core set of styling rules or make an easily extendable styling API. One option could also be to make the font rendering an external library and core library would only have the 8 bit rendering style.
Lets keeps this open for now so it also works as a TODO list entry for me.
@tuupola Oh no worries at all, just wanted to follow up!
Yep I totally get not wanting the bloat. Sounds good to me, I will leave it open. Thank you!
Overview
Added a function
hagl_put_wrap_text
that will automatically wrap the text to the next line, but without splitting a word into multiple lines. Only full words will be printed on a single line, unless the word is too long to fit. In the scenario where it is too long to fit, it will wrap around mid-word for that word only.As of now, this was only tested using a small 160x80 ST7735S display with an ESP32 development board.
Testing
Sample program for testing a few scenarios: