SSD1306Wire - font alignment problem

I'm using the ThingPulse esp8266-oled-ssd1306 library v4.3.0 for a thermometer project.

I've created a Sans Serif 34 font to max out the two temp readings on a 128x64 OLED.

However, no matter how I try, the display.drawString() cannot utilize the first pixels of the top of the display.

I've inserted two images that I believe provides good samples of the problem

This is the code that does not draw at the top of the display:
display.setFont(SansSerif_Plain_34);
display.drawString(0, 0, "12.3°");

This is the code that show that a smaller font is able to get closer, but not close enough.
display.setFont(ArialMT_Plain_10);
display.drawString(95,0, "toprow");
display.drawLine(0,0,128,0);

image1

The second image is two temp readings with a display.drawRect(0,0,128,64);

image2

I don't see them. I see a couple of links, I'd rather not click on those, in case this post is a phishing attempt. Please insert them properly!

I'm a new user and not allowed to upload anything... :frowning:
I'm also banned from having more than two links in the same post... sigh

I then uploaded the two images to https://sv.imgbb.com which returned these two URLs to embed:

What are my other options? A bit rusty on how to make posts...

Ahh... just pasting the IMG url worked well
Here is the second image

I don't use this library but...
Doesn't 0 to 64 actually reference 65 pixels?

same with 0 to 128

John

Yes, you are correct - but how can I get the text to start on the first pixel row?

Or rather, how can I make as much use of the display's Y-range for my two thermometer readings? I can draw a line at the top row but I cannot get display.drawString(0, 0... to do it?

Negative Y values like display.drawString(0, -2... does not work,

Any suggestions for another library to use with the 128x64 OLED?

I use the SSD1306 library from Bill Greiman. It ONLY Prints TEXT no graphics. But I find it works great. I don't know if the fonts can be made to meet your requirement of full screen.

I have submitted a bug report on GitHub

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.