summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/displayapp/fonts/neofont.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c
index d883ad2..b95d9ae 100644
--- a/src/displayapp/fonts/neofont.c
+++ b/src/displayapp/fonts/neofont.c
@@ -351,6 +351,8 @@ static bool neofont0mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
/* Get the bitmap of `unicode_letter` from `font`. */
static const uint8_t * neofont0mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
+ if (unicode_letter < 0x20) return NULL;
+
static const uint8_t spc[] = { 0, 0 };
static uint8_t custom[2];
/* Your code here */
@@ -447,6 +449,7 @@ static bool neofont1mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
static const uint8_t * neofont1mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
const uint8_t *u = neofont0mono_glyph_bitmap_cb(font, unicode_letter);
+ if (u == NULL) return NULL;
static uint8_t v[(10*10+7)/8];
uint8_t u0 = u[0];
uint8_t u1 = u[1];
@@ -502,6 +505,7 @@ static const uint8_t * neofont1mono_glyph_bitmap_cb(const lv_font_t * font, uint
static const uint8_t * neofont1mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
const uint8_t *u = neofont0mono_glyph_bitmap_cb(font, unicode_letter);
+ if (u == NULL) return NULL;
static uint8_t v[8];
uint8_t u0 = u[0];
uint8_t u1 = u[1];
@@ -601,6 +605,7 @@ static bool neofont15mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc
static const uint8_t * neofont15mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
const uint8_t *u = neofont0mono_glyph_bitmap_cb(font, unicode_letter);
+ if (u == NULL) return NULL;
static uint8_t v[17];
uint8_t u0 = u[0];
uint8_t u1 = u[1];
@@ -711,6 +716,7 @@ static bool neofont2mono_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
static const uint8_t * neofont2mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
const uint8_t *u = neofont0mono_glyph_bitmap_cb(font, unicode_letter);
+ if (u == NULL) return NULL;
static uint8_t v[30];
uint8_t u0 = u[0];
uint8_t u1 = u[1];
@@ -868,6 +874,7 @@ static void mono_bitmap_scale_4(
static const uint8_t * neofont3mono_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter)
{
const uint8_t *u = neofont1mono_glyph_bitmap_cb(font, unicode_letter);
+ if (u == NULL) return NULL;
static uint8_t v[120 /* = 40 * 24 / 8 */ ];
mono_bitmap_scale_4(u,v,6,10,u,u+(60+7)/8,v,v+120);
return v;