Adding fonts to ILI9341_t3n, howto?

clinker8

Well-known member
I've been using the ILI9341_t3n library a while. It comes with four fonts. Need some fixed pitch fonts for displaying DRO data. (Digital Read Out for a lathe.) A variable width is not good for making things line up. My electronic lead screw project uses Arial for most of the display, but a fixed pitch would be better for the DRO/

I found this library of fonts https://github.com/PaulStoffregen/ILI9341_fonts which contain additional fonts, including a fixed pitch. What is the best way to use Paul's fonts with the t3n library? @KurtE what do you recommend? Really could use the CourierNew font series, normal, bold, italic... The extra fonts aren't really a library, how do I incorporate them, and have them available for other projects?
 
Would recommend that you download this version of the Fonts library as it was updated to work with different displays: https://github.com/mjs513/ILI9341_fonts and install it in your library folder.

If you look in the examples folder of the ILI9341_t3n you will see example _fonttest3. If you look all you have to do it include the fonts the fonts you want from the fonts library. Below are all from the library or rather fonts repository:
Code:
#include "font_Arial.h"
#include "font_ArialBold.h"
#include "font_ComicSansMS.h"
#include "font_OpenSans.h"
#include "font_DroidSans.h"
#include "font_Michroma.h"
#include "font_Crystal.h"
#include "font_ChanceryItalic.h"

Then you would use it like you currently use a font.
Code:
  tft.setTextColor(ILI9341_GREEN);
  tft.setFont(Chancery_24_Italic);
  tft.println("Chancery_24_Italic");
  displayStuff();

In your case it would be:
Code:
#include "font_CourierNew.h"
 
Thanks for that. I see there are additional mono fonts included. That's helpful. Should make the display look a little nicer than Courier New. Liberation Mono or Droid Sans Mono look worth trying.
 
Should also mention we can also use the fonts in the Adafruit GFX library.

Examples are shown I believe in same sketch
 
Back
Top