From 74a57b7de8f79959020bf30d37bc05410e79f942 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Sat, 11 Mar 2017 12:27:38 +0000 Subject: [PATCH] Easier custom font addition --- User_Setups/User_Custom_Fonts.h | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 User_Setups/User_Custom_Fonts.h diff --git a/User_Setups/User_Custom_Fonts.h b/User_Setups/User_Custom_Fonts.h new file mode 100644 index 0000000..5b02357 --- /dev/null +++ b/User_Setups/User_Custom_Fonts.h @@ -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 // CF_OL24 +#include // CF_OL32 +#include // CF_RT24 +#include // CF_S24 +#include // 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 +*/