Scrunching Text

I’ve actually got my display showing text now. This turned out to be a bit more difficult than I expected. Drawing text was easy, there’s a built in 6x9 font. But of course I wanted a bigger one, so I scaled the text to double size. Then I discovered that, because there are now two pixels between each character, the text wouldn’t fit on the screen. So I rewrote the display code to place each character individually and draw them only one pixel apart. Then I noticed that the redraw was a bit slow and made the display flicker. So I improved the driver to only draw changed characters rather than the entire text. And then I found that characters redrawn in the middle of a line overwrote a part of the characters next to them because they were now one pixel closer than they should have been. So I modified my draw function to redraw all the characters “downstream” of an updated character and put back the missing bits.

And now it works.

And I have another problem. The display is not “fire and forget”. It works because the computer controlling it is continuously clocking the red, green and blue data to turn on each pixel in turn. This means that when the ESP 32 goes off to read the WiFi and get the message to be displayed the whole display falls apart and, if I’m really unlucky, the whole thing crashes.

Oh well. I’ll leave that for tomorrow.