mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-06 14:14:44 +02:00
Easier custom font addition
This commit is contained in:
36
User_Setups/User_Custom_Fonts.h
Normal file
36
User_Setups/User_Custom_Fonts.h
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
// Custom "Adafruit" compatible font files can be added to the "TFT_eSPI/Fonts/Custom" folder
|
||||
// Fonts in a suitable format can be created using a Squix blog web based tool here:
|
||||
/*
|
||||
https://blog.squix.org/2016/10/font-creator-now-creates-adafruit-gfx-fonts.html
|
||||
*/
|
||||
|
||||
// Note: At the time of writing there is a last character code definition bug in the
|
||||
// Squix font file format so do NOT try and print the tilda (~) symbol (ASCII 0x7E)
|
||||
// Alternatively look at the end of the font header file and edit: 0x7E to read 0x7D
|
||||
/* e.g. vvvv
|
||||
(uint8_t *)Orbitron_Light_32Bitmaps,(GFXglyph *)Orbitron_Light_32Glyphs,0x20, 0x7D, 32};
|
||||
^^^^
|
||||
*/
|
||||
|
||||
// When font files are placed in the Custom folder then they must also be #included here:
|
||||
|
||||
// The comment added is a shorthand reference but this is not essential
|
||||
|
||||
// New custom font file #includes
|
||||
#include <Fonts/Custom/Orbitron_Light_24.h> // CF_OL24
|
||||
#include <Fonts/Custom/Orbitron_Light_32.h> // CF_OL32
|
||||
#include <Fonts/Custom/Roboto_Thin_24.h> // CF_RT24
|
||||
#include <Fonts/Custom/Satisfy_24.h> // CF_S24
|
||||
#include <Fonts/Custom/Yellowtail_32.h> // CF_Y32
|
||||
|
||||
// Shorthand references - any coding scheme can be used, here CF_ = Custom Font
|
||||
// The #defines below MUST be added to sketches to use shorthand references, so
|
||||
// they are only put here for reference and copy+paste purposes!
|
||||
/*
|
||||
#define CF_OL24 &Orbitron_Light_24
|
||||
#define CF_OL32 &Orbitron_Light_32
|
||||
#define CF_RT24 &Roboto_Thin_24
|
||||
#define CF_S24 &Satisfy_24
|
||||
#define CF_Y32 &Yellowtail_32
|
||||
*/
|
Reference in New Issue
Block a user