[AdaGFX Helper] Add TomThumb 3x5 font

This commit is contained in:
Ton Huisman
2024-04-16 23:43:26 +02:00
parent 0f1587feff
commit 339f0f656c
3 changed files with 27 additions and 2 deletions
+1
View File
@@ -116,6 +116,7 @@
* *sevenseg24* A rather large 7-segment 21 * 48 font
* *sevenseg18* A somewhat less large 7-segment 16 * 34 font
* *freesans* A sans-serif 10 * 21 font
* *tomthumb* A small 3 * 5 font, for use on a 5x29 NeoPixel display. Not available in limited builds.
Usually disabled fonts: (can be enabled in a Custom build, default enabled in the MAX builds)
+16 -1
View File
@@ -11,6 +11,11 @@
# include "../Static/Fonts/Seven_Segment24pt7b.h"
# include "../Static/Fonts/Seven_Segment18pt7b.h"
# include "../Static/Fonts/FreeSans9pt7b.h"
# ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
# include <Fonts/TomThumb.h> // Available in Adafruit_GFX library
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_ANGELINA
# include "../Static/Fonts/angelina8pt7b.h"
@@ -836,6 +841,11 @@ enum class adagfx_commands_e : int8_t {
// *** Don't forget to add the | separator at the end of a (new) font-name! (except for the last one in the list)
const char adagfx_fonts[] PROGMEM =
"default|sevenseg24|sevenseg18|freesans|"
# ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
"tomthumb|"
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_ANGELINA
"angelina8prop|"
@@ -956,6 +966,11 @@ constexpr tFontArgs fontargs[] =
{ &Seven_Segment24pt7b, 21, 42, 35, true },
{ &Seven_Segment18pt7b, 16, 33, 26, true },
{ &FreeSans9pt7b, 10, 16, 12, false },
# ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
{ &TomThumb, 5, 6, 5, false },
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
# endif // ifdef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_INCLUDED
# ifdef ADAGFX_FONTS_EXTRA_8PT_ANGELINA
{ &angelina8pt7b, 6, 16, 12, true },
@@ -1886,7 +1901,7 @@ bool AdafruitGFX_helper::processCommand(const String& string) {
# if ADAGFX_ARGUMENT_VALIDATION
const int16_t curWin = getWindow();
if (curWin != 0) { selectWindow(0); } // Validate against raw window coordinates
if (curWin != 0) { selectWindow(0); } // Validate against raw window coordinates
if (argCount == 6) { setRotation(nParams[5]); } // Use requested rotation
+10 -1
View File
@@ -12,6 +12,8 @@
***************************************************************************/
/************
* Changelog:
* 2024-04-16 tonhuisman: Add font TomThumb, 3x5 pixel font to be used on a NeoMatrix 5x29 display. Disabled by LIMIT_BUILD_SIZE.
* This font is already available via the Adafruit_GFX_Library
* 2023-12-30 tonhuisman: Optimization of font handling, also reducing code-size
* Add some additional 7-segment/LCD-like fonts (18 pt enabled by default for ESP32 builds using this helper)
* - sevenseg18b (7segment 18 pt) (very few non-alphanumeric characters, slightly slanted)
@@ -98,6 +100,7 @@
# define ADAGFX_ENABLE_GET_CONFIG_VALUE 1 // Enable getting values features
# endif // ifndef ADAGFX_ENABLE_GET_CONFIG_VALUE
# define ADAGFX_FONTS_EXTRA_5PT_INCLUDED // 1 extra 5pt font, should only be enabled in non-LIMIT_BUILD_SIZE builds, adds ~0.3 kB
// # 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
@@ -105,8 +108,11 @@
// # 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
// To enable/disable 8pt fonts separately: (will only be enabled if ADAGFX_FONTS_EXTRA_5PT_INCLUDED is defined)
# define ADAGFX_FONTS_EXTRA_5PT_TOMTHUMB
// To enable/disable 8pt fonts separately: (will only be enabled if ADAGFX_FONTS_EXTRA_8PT_INCLUDED is defined)
# define ADAGFX_FONTS_EXTRA_8PT_ANGELINA // This font is proportinally spaced!
# define ADAGFX_FONTS_EXTRA_8PT_ANGELINA // This font is proportinally spaced!
# define ADAGFX_FONTS_EXTRA_8PT_NOVAMONO
# define ADAGFX_FONTS_EXTRA_8PT_UNISPACE
# define ADAGFX_FONTS_EXTRA_8PT_UNISPACEITALIC
@@ -181,6 +187,9 @@
# endif // ifdef LIMIT_BUILD_SIZE
# ifdef PLUGIN_SET_MAX // Include all fonts in MAX builds
# ifndef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# define ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# endif // ifndef ADAGFX_FONTS_EXTRA_5PT_INCLUDED
# ifndef ADAGFX_FONTS_EXTRA_8PT_INCLUDED
# define ADAGFX_FONTS_EXTRA_8PT_INCLUDED
# endif // ifndef ADAGFX_FONTS_EXTRA_8PT_INCLUDED