From 7b0ff04a2d3be9c5c3bdece50fb6fa30fb2831d2 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Tue, 26 Dec 2023 18:54:36 +0100 Subject: [PATCH] Graphics: removed 18pt and 24pt fonts Removing 18pt and 24pt fonts from graphics layer since currently are unused and take up flash space. On MD-380, removal freed up 12'928 bytes in the .text section. --- openrtx/include/core/graphics.h | 4 ++-- openrtx/src/core/graphics.c | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/openrtx/include/core/graphics.h b/openrtx/include/core/graphics.h index f633f659..423c68a1 100644 --- a/openrtx/include/core/graphics.h +++ b/openrtx/include/core/graphics.h @@ -86,8 +86,8 @@ typedef enum FONT_SIZE_10PT, FONT_SIZE_12PT, FONT_SIZE_16PT, - FONT_SIZE_18PT, - FONT_SIZE_24PT + + FONT_SIZE_NUM } fontSize_t; typedef enum diff --git a/openrtx/src/core/graphics.c b/openrtx/src/core/graphics.c index c13ae793..ce0f449f 100644 --- a/openrtx/src/core/graphics.c +++ b/openrtx/src/core/graphics.c @@ -71,8 +71,6 @@ static const GFXfont fonts[] = { TomThumb, // 5pt FreeSans10pt7b, // 10pt FreeSans12pt7b, // 12pt FreeSans16pt7b, // 16pt - FreeSans18pt7b, // 16pt - FreeSans24pt7b, // 24pt #elif defined FONT_UBUNTU_REGULAR UbuntuRegular6pt7b, // 6pt UbuntuRegular8pt7b, // 8pt @@ -80,8 +78,6 @@ static const GFXfont fonts[] = { TomThumb, // 5pt UbuntuRegular10pt7b, // 10pt UbuntuRegular12pt7b, // 12pt UbuntuRegular16pt7b, // 16pt - UbuntuRegular18pt7b, // 16pt - UbuntuRegular24pt7b, // 24pt #else #error Unsupported font family! #endif @@ -634,7 +630,7 @@ point_t gfx_drawSymbol(point_t start, symbolSize_t size, textAlign_t alignment, * * TODO: improve this. */ - int symSize = size + FONT_SIZE_24PT + 1; + int symSize = size + FONT_SIZE_NUM; char buffer[2] = {0}; buffer[0] = (char) symbol;