lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
MIT License
655 stars 125 forks source link

All fonts render garbage #79

Closed amyspark closed 5 years ago

amyspark commented 5 years ago

Describe the bug With current master, all fonts render garbage in my toy clock application. This bug was introduced in 67ffeb4a738e677fb93338ef1373ab4193400411 as per git bisect starting from v1.7.12; I don't know specifically what causes it.

To Reproduce Upload the following sample to your board of choice (mine is an Arduino Uno, with a ST7735 LCD panel connected):

#include <ssd1306.h>

void setup() {
  st7735_128x160_spi_init(8, 10, 9);
  ssd1306_fillScreen(0x00);
  ssd1306_setFixedFont(comic_sans_font24x32_123);
  ssd1306_printFixed(0, 0, "111", STYLE_NORMAL);
}

void loop()
{

}

Expected behavior I wanted to see "asd" in the screen. Instead, I get what is shown in the photo below.

Screenshots

Please complete the following information:

Additional context I edited the original description to use supported characters.

lexus2k commented 5 years ago

Thank you for reporting. I confirm, the issue exists

lexus2k commented 5 years ago

Can you try the following code instead?

#include <ssd1306.h>

void setup() {
  st7735_128x160_spi_init(8, 10, 9);
  ssd1306_fillScreen8(0x00);
  ssd1306_setFixedFont(comic_sans_font24x32_123);
  ssd1306_printFixed8(0, 0, "111", STYLE_NORMAL);
}

void loop()
{

}

It should work for you. Use suffix 8 for color displays.

amyspark commented 5 years ago

I can confirm this works with printFixed8. What's the issue here?

lexus2k commented 5 years ago

I reverted last 3 commits. So, now original example from your description should work as is. The issue was related to the functionality, which I removed from the library. Thank you for reporting, I will think on how to do changes to the library more carefully.