olikraus / ucglib

Arduino True Color Library for TFTs and OLEDs
https://github.com/olikraus/ucglib/wiki
Other
261 stars 76 forks source link

Font Rendering Issue #151

Open a-v-s opened 2 years ago

a-v-s commented 2 years ago

I am using an SD1331 display. When I draw a string there are additional pixels set over the text. I have traced the issue to an attempt to draw a line with length 0, which actually gets drawn as a pixel. I have resolved the issue by adding

if (len == 0) return;

to ucg_Draw90Line, skipping these zero length lines.

a-v-s commented 2 years ago

Additional... using my first proposal to fix, everything is too wide, Another proposal would be

  ucg->arg.len--;
  ucg->arg.pixel.pos.x++;

right before the call into the driver.

I might have to test with a different display to see whether the Draw Line is even the place to be looking, rather then the driver drawing incorrectly. Also, getting a 0 length draw request, is suspicious.