From ec97f4903f580961c2347eb45394dc6342a51128 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sat, 22 Nov 2025 16:30:16 +0100 Subject: [PATCH] don't include any font when building with WLED_DISABLE_2D saves up to 12Kb program space in flash --- wled00/wled_fonts.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wled00/wled_fonts.hpp b/wled00/wled_fonts.hpp index f1ffa8d3..13d9059d 100644 --- a/wled00/wled_fonts.hpp +++ b/wled00/wled_fonts.hpp @@ -9,6 +9,7 @@ #undef WLED_ENABLE_FULL_FONTS #endif +#if !defined(WLED_DISABLE_2D) // don't include any font in 1D-only builds - saves up to 12Kb of flash // pull in all fonts #include "src/font/console_font_4x6.h" @@ -17,6 +18,7 @@ #include "src/font/console_font_6x8.h" #include "src/font/console_font_7x9.h" +#endif // fontInfo struct returned by getFontInfo typedef struct { @@ -35,6 +37,7 @@ inline FontInfo_t getFontInfo(unsigned width, unsigned height) { unsigned pixels = width * height; switch (pixels) { +#if !defined(WLED_DISABLE_2D) // no fonts in 1D-only builds // WLED standard fonts (PROGMEM) case 24: // 4x6 font font.raw = console_font_4x6; @@ -74,6 +77,7 @@ inline FontInfo_t getFontInfo(unsigned width, unsigned height) { // you can add any custom fonts here +#endif default: // no font font.raw = nullptr; font.isProgMem = false;