micropython-drivers icon indicating copy to clipboard operation
micropython-drivers copied to clipboard

Add support of drawing text

Open nvbn opened this issue 11 years ago • 2 comments

Hi, I've ported support of drawing text from py-gaugette, usage:

display.draw_text(10, 10, 'Test text!')
display.display()

nvbn avatar Dec 20 '14 18:12 nvbn

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?

khenderick avatar Dec 23 '14 06:12 khenderick

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.

nvbn avatar Dec 28 '14 22:12 nvbn