TFT/OLED: Adjusting font size between 1 and 2 possible?

Having recently created my first Arduino sketch with a small .96" OLED one thing I noticed is the very small font used on these screens.
Of course, on a small screen this is necessary if you want to display several lines of text.

Now I am working on my next sketch using a 2" 320x240 TFT.
I notice that the amout of text one can put on the screen is still limited if you want a reasonably readable font.
The display I am using is this one:
(https://www.waveshare.com/wiki/2inch_LCD_Module?Amazon)

When using the tft.textsize(1), the font is very small.
Using tft.txtsize(2), the font is a bit too big to fit a reasonable text on the screen.

Is there not a way to adjust the fontsize to something between size 1 and 2?
It would make reading a lot easier on the eyes.

No there is no way to do this, at least like that.

What you will have to do is to download another font that is different from the default font. Fonts come in various sizes, typically is an 8 by 8 font but you can also get 5 by 7 and sometimes even smaller. The smaller the basic font the less nice it looks but you can get more text on the screen.

Unless you draw your own font - no

No.
Pixels are the fundamental building blocks.
You would have to supply a font look up table for your own fonts, which is no different from downloading one.
Unless you are talking of constructing a font by drawing the individual strokes with line drawing commands, and that would be madness in terms of storage and efficiency.

i don't quite understand... my English is not very good.
"no" about what?

As "draw" I mean to construct your own font as font lookup table.
Of course, you can download it somewhere, but there are many formats of font tables, so it very likely that the downloaded fonts will be incompatibles with the library.

It is always wise to post links to your display(s). e.g. Ebay sale page(s)

Life is easier if you say which library you are using. e.g.
Adafruit_SSD1306 for the 0.96 inch OLED.
Adafruit_ILI9341 for the 240x320 TFT

Adafruit_GFX style libraries can use FreeFonts which come in different sizes.
e.g. #include <Fonts/FreeSans9pt7b.h>

U8g2lib has many different fonts in many sizes.
And you can use them with Adafruit libraries e.g. U8g2_for_Adafruit_GFX.h

In which case I said:-

Implying that this is not an alternate way to what I described

They are more standard than you think.

Agreed. But life is simpler if you just say which OLED or TFT library you are using.

Then we can point to real-life fonts that work with your chosen library.
Especially if you specify how many letters you want to print on one line.

e.g. standard GFX monospaced 7x5 font uses 6 pixels per letter i.e. 53 letters on a 320x240 screen. Or 26 letters at double-size.

Proportional fonts look nicer. They often fit more letters into a 320 pixel row. (unless you have lots of Ms and Ws )

David.

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