Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to Determine Biggest Text for 128 x 32 #86

Open
KungFuHaiku opened this issue Jan 28, 2022 · 1 comment
Open

Trying to Determine Biggest Text for 128 x 32 #86

KungFuHaiku opened this issue Jan 28, 2022 · 1 comment

Comments

@KungFuHaiku
Copy link

KungFuHaiku commented Jan 28, 2022

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.

@greiman
Copy link
Owner

greiman commented Jan 30, 2022

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":

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants