Adding Fonts for TFT Output

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wiki
Normal user
Posts: 420
Joined: 23 Apr 2018, 17:55
Location: Germany

Adding Fonts for TFT Output

#1 Post by Wiki » 21 Aug 2024, 10:24

Moin,

after years I finally succeeded in setting up the development environment in Visual Studio / Platformio resulting in being able to produce customized builds according to my special needs.
I highly appreciate the work you have done.

Question: Is there a way to include additional fonts for TFT displays using Custom.h? Build size almost doesn't matter, the devices will be installed once and no OTA will be needed.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Adding Fonts for TFT Output

#2 Post by Ath » 21 Aug 2024, 10:49

Hi ;)

First point to make: Please use an ESP32, best with 8MB (S3, C6) or 16MB (ESP32 Classic, S3, C6) Flash memory, that'll make life much easier.

1)
In your Custom.h file, enable all plugins and features you'll need.
2)
Also add enablers for the font size(s) you want:

Code: Select all

// # define ADAGFX_FONTS_EXTRA_8PT_INCLUDED  // 8 extra 8pt fonts, should probably only be enabled in a private custom build, adds ~15.4 kB
// # define ADAGFX_FONTS_EXTRA_12PT_INCLUDED // 9 extra 12pt fonts, should probably only be enabled in a private custom build, adds ~28 kB
// # define ADAGFX_FONTS_EXTRA_16PT_INCLUDED // 5 extra 16pt fonts, should probably only be enabled in a private custom build, adds ~19.9 kB
// # define ADAGFX_FONTS_EXTRA_18PT_INCLUDED // 3 extra 18pt fonts, should probably only be enabled in a private custom build, adds ~13.8 kB
// # define ADAGFX_FONTS_EXTRA_20PT_INCLUDED // 1 extra 20pt fonts, should probably only be enabled in a private custom build, adds ~5.3 kB
// # define ADAGFX_FONTS_EXTRA_24PT_INCLUDED // 2 extra 24pt fonts, should probably only be enabled in a private custom build, adds ~11.1 kB
The extra fonts for each font-size will then be enabled by default, for an exact list you can check in src/src/Helpers/AdafruitGFX_helper.h/.cpp. For ESP8266 some fonts are still excluded (actually: not included by default) to not explode the binary size too much.
3)
Then build a matching Custom build from the PlatformIO environments list.

(Sometimes the first build fails for no obvious reasons during the Linking phase, then just build it again)

NB: These fonts can be used on P095, P096 (ePaper display), P116, P131 (though not very useful) and P141 (monochrome display). P095 and P116 displays can be equipped with a touch panel, so you'll need either P099 or P123 (or both :)) to support that.
/Ton (PayPal.me)

Wiki
Normal user
Posts: 420
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Adding Fonts for TFT Output

#3 Post by Wiki » 27 Aug 2024, 22:31

Hi,

pretty busy during the past few days with other non-catastrophic problems my answer:

Thank you very much, I appreciate again, one more time.

I'll play around with these new opportunities a while.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Adding Fonts for TFT Output

#4 Post by Ath » 27 Aug 2024, 22:33

I didn't state it explicitly, but for the #define lines you need enabled, remove the leading // characters ;)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests