From 215da2609748603e03ae242f4f61f314898d49e7 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Date: Fri, 13 Jan 2017 10:19:40 +0530 Subject: [PATCH] lv_misc: Rename FONT_ICONS to FONT_SYMBOL_30 Define USE_FONT_SYMBOL_30 to enable symbol fonts of 30px. FONT_ICONS renamed to FONT_SYMBOL_30 Signed-off-by: Ajay Bhargav --- lv_misc/font.c | 8 ++--- lv_misc/font.h | 4 +-- lv_misc/fonts/icons.h | 44 -------------------------- lv_misc/fonts/{icons.c => symbol_30.c} | 16 +++++----- lv_misc/fonts/symbol_30.h | 44 ++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 lv_misc/fonts/icons.h rename lv_misc/fonts/{icons.c => symbol_30.c} (99%) create mode 100644 lv_misc/fonts/symbol_30.h diff --git a/lv_misc/font.c b/lv_misc/font.c index 22331b8e2..ed3b23dc1 100644 --- a/lv_misc/font.c +++ b/lv_misc/font.c @@ -16,7 +16,7 @@ #include "fonts/dejavu_40.h" #include "fonts/dejavu_60.h" #include "fonts/dejavu_80.h" -#include "fonts/icons.h" +#include "fonts/symbol_30.h" /********************* * DEFINES @@ -102,9 +102,9 @@ const font_t * font_get(font_types_t font_id) break; #endif -#if USE_FONT_ICONS != 0 - case FONT_ICONS: - font_p = icons_get_dsc(); +#if USE_FONT_SYMBOL_30 != 0 + case FONT_SYMBOL_30: + font_p = symbol_30_get_dsc(); break; #endif default: diff --git a/lv_misc/font.h b/lv_misc/font.h index 366115054..9294988c7 100644 --- a/lv_misc/font.h +++ b/lv_misc/font.h @@ -47,8 +47,8 @@ typedef enum #if USE_FONT_DEJAVU_80 != 0 FONT_DEJAVU_80, #endif -#if USE_FONT_ICONS != 0 - FONT_ICONS, +#if USE_FONT_SYMBOL_30 != 0 + FONT_SYMBOL_30, #endif FONT_TYPE_NUM, }font_types_t; diff --git a/lv_misc/fonts/icons.h b/lv_misc/fonts/icons.h deleted file mode 100644 index 96573174a..000000000 --- a/lv_misc/fonts/icons.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ICONS_H -#define ICONS_H - -/*Use ISO8859-1 encoding in the IDE*/ - -#include "lv_conf.h" -#if USE_FONT_ICONS != 0 - - -#include -#include "../font.h" - -#define ICON_DRIVE "a" -#define ICON_FILE "b" -#define ICON_FOLDER "c" -#define ICON_DELETE "d" -#define ICON_SAVE "e" -#define ICON_EDIT "f" -#define ICON_OK "g" -#define ICON_CLOSE "h" -#define ICON_DOWN "i" -#define ICON_LEFT "j" -#define ICON_RIGHT "k" -#define ICON_UP "l" -#define ICON_BT "m" -#define ICON_THERM "n" -#define ICON_GPS "o" -#define ICON_WARN "p" -#define ICON_INFO "q" -#define ICON_BATT1 "r" -#define ICON_BATT2 "s" -#define ICON_BATT3 "t" -#define ICON_BATT4 "u" -#define ICON_BATTCH "v" -#define ICON_HELP "w" -#define ICON_POWER "x" -#define ICON_SETUP "y" -#define ICON_WIFI "z" - -const font_t * icons_get_dsc(void); - -#endif - -#endif diff --git a/lv_misc/fonts/icons.c b/lv_misc/fonts/symbol_30.c similarity index 99% rename from lv_misc/fonts/icons.c rename to lv_misc/fonts/symbol_30.c index fb4c19de2..17119114f 100644 --- a/lv_misc/fonts/icons.c +++ b/lv_misc/fonts/symbol_30.c @@ -1,10 +1,10 @@ #include "lv_conf.h" -#if USE_FONT_ICONS != 0 +#if USE_FONT_SYMBOL_30 != 0 #include #include "../font.h" -static const uint8_t icons_bitmaps[3120] = +static const uint8_t symbol_30_bitmaps[3120] = { // ASCII: 97, char width: 30 0x00, 0x00, 0x00, 0x00, // ------------------------------.. @@ -839,7 +839,7 @@ static const uint8_t icons_bitmaps[3120] = 0x00, 0x00, 0x00, 0x00, // -------------------------------- }; -static const uint8_t icons_widths[26] = +static const uint8_t symbol_30_widths[26] = { 30, 26, 32, 24, 26, 26, 30, 24, 30, 21, 21, 30, 17, 17, 24, 30, @@ -847,20 +847,20 @@ static const uint8_t icons_widths[26] = 26, 34, }; -static const font_t icons_dsc = +static const font_t symbol_30_dsc = { 26, // Letter count 97, // First ascii code 4, // Letters width (bytes) 30, // Letters height (row) 0, // Fixed width or 0 if variable - icons_widths, - icons_bitmaps + symbol_30_widths, + symbol_30_bitmaps }; -const font_t * icons_get_dsc(void) +const font_t * symbol_30_get_dsc(void) { - return &icons_dsc; + return &symbol_30_dsc; } diff --git a/lv_misc/fonts/symbol_30.h b/lv_misc/fonts/symbol_30.h new file mode 100644 index 000000000..991635811 --- /dev/null +++ b/lv_misc/fonts/symbol_30.h @@ -0,0 +1,44 @@ +#ifndef SYMBOL_30_H +#define SYMBOL_30_H + +/*Use ISO8859-1 encoding in the IDE*/ + +#include "lv_conf.h" +#if USE_FONT_SYMBOL_30 != 0 + + +#include +#include "../font.h" + +#define SYMBOL_30_DRIVE "a" +#define SYMBOL_30_FILE "b" +#define SYMBOL_30_FOLDER "c" +#define SYMBOL_30_DELETE "d" +#define SYMBOL_30_SAVE "e" +#define SYMBOL_30_EDIT "f" +#define SYMBOL_30_OK "g" +#define SYMBOL_30_CLOSE "h" +#define SYMBOL_30_DOWN "i" +#define SYMBOL_30_LEFT "j" +#define SYMBOL_30_RIGHT "k" +#define SYMBOL_30_UP "l" +#define SYMBOL_30_BT "m" +#define SYMBOL_30_THERM "n" +#define SYMBOL_30_GPS "o" +#define SYMBOL_30_WARN "p" +#define SYMBOL_30_INFO "q" +#define SYMBOL_30_BATT1 "r" +#define SYMBOL_30_BATT2 "s" +#define SYMBOL_30_BATT3 "t" +#define SYMBOL_30_BATT4 "u" +#define SYMBOL_30_BATTCH "v" +#define SYMBOL_30_HELP "w" +#define SYMBOL_30_POWER "x" +#define SYMBOL_30_SETUP "y" +#define SYMBOL_30_WIFI "z" + +const font_t * symbol_30_get_dsc(void); + +#endif + +#endif