SSD1306Ascii icon indicating copy to clipboard operation
SSD1306Ascii copied to clipboard

Trying to Determine Biggest Text for 128 x 32

Open KungFuHaiku opened this issue 2 years ago • 1 comments

Hi there,

First off, thanks for the fantastic library - it's so much snappier than the Adafruit one and has alleviated some blocking issues I had with a real-time application.

My question is whether you know which font and scale combination (e.g. set2X) I can use to capitalise on the screen's real-estate? I'd like the biggest text possible. At the moment I'm using fixednums8x16 with a set2X multiplier, but it could be bigger (or at least bold).

Also, how would I display both some large centred text and then a smaller string next to it (see attached image)? All my attempts are simply replacing one with the other.

oled-example-text

Many thanks.

KungFuHaiku avatar Jan 28 '22 14:01 KungFuHaiku

I can't help with a choice for a better font than fixednums8x16 with a set2X multiplier. A few people have edited fonts with this font editor:

See openGLCDFontCreator.zip here:

https://bitbucket.org/bperrybap/openglcd/downloads/

See this "issue":

https://github.com/greiman/SSD1306Ascii/issues/85

There are several tools that help position text. The key idea is to determine the length of text and then position the cursor correctly.

Use size_t strWidth(const char* str) to determine the size of each section of text in pixels and then position the cursor to the appropriate position for the text. You may need to erase the area.

greiman avatar Jan 30 '22 12:01 greiman