micropython-drivers
micropython-drivers copied to clipboard
Add support of drawing text
Hi, I've ported support of drawing text from py-gaugette, usage:
display.draw_text(10, 10, 'Test text!')
display.display()
Thanks for your contribution!
I just tested your code, but it looks like the x coordinate is off with 1 to the left. So if you specify display.draw_text(1, 0, "test") that it will start printing on x=0. If you specify x=0, then the first column of pixels will show on the outer right edge. Is this a small bug left, or intentional?
Yes, there's been a bug. Code from py-gaugette is a bit hackish and hard to maintain/understand (probably rewritten from C line-by-line), so I rewrote it. And now it's more pythonic and a lot simpler to understand.