summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/font.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 534fa922fd..804d3895b1 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -380,7 +380,7 @@ static bool internal_load_font(struct font* pf, const char *path,
380 } 380 }
381 return true; 381 return true;
382} 382}
383 383
384#ifdef HAVE_REMOTE_LCD 384#ifdef HAVE_REMOTE_LCD
385/* Load a font into the special remote ui font slot */ 385/* Load a font into the special remote ui font slot */
386int font_load_remoteui(const char* path) 386int font_load_remoteui(const char* path)
@@ -484,7 +484,7 @@ load_cache_entry(struct font_cache_entry* p, void* callback_data)
484 struct font* pf = callback_data; 484 struct font* pf = callback_data;
485 unsigned short char_code = p->_char_code; 485 unsigned short char_code = p->_char_code;
486 unsigned char tmp[2]; 486 unsigned char tmp[2];
487 487
488 if (pf->file_width_offset) 488 if (pf->file_width_offset)
489 { 489 {
490 int width_offset = pf->file_width_offset + char_code; 490 int width_offset = pf->file_width_offset + char_code;
@@ -495,7 +495,7 @@ load_cache_entry(struct font_cache_entry* p, void* callback_data)
495 { 495 {
496 p->width = pf->maxwidth; 496 p->width = pf->maxwidth;
497 } 497 }
498 498
499 int32_t bitmap_offset = 0; 499 int32_t bitmap_offset = 0;
500 500
501 if (pf->file_offset_offset) 501 if (pf->file_offset_offset)
@@ -547,7 +547,7 @@ int font_get_width(struct font* pf, unsigned short char_code)
547 font_cache_get(&pf->cache,char_code,load_cache_entry,pf)->width: 547 font_cache_get(&pf->cache,char_code,load_cache_entry,pf)->width:
548 pf->width? pf->width[char_code]: pf->maxwidth; 548 pf->width? pf->width[char_code]: pf->maxwidth;
549} 549}
550 550
551const unsigned char* font_get_bits(struct font* pf, unsigned short char_code) 551const unsigned char* font_get_bits(struct font* pf, unsigned short char_code)
552{ 552{
553 const unsigned char* bits; 553 const unsigned char* bits;
@@ -614,8 +614,8 @@ void glyph_cache_save(struct font* pf)
614 if (cache_fd < 0) return; 614 if (cache_fd < 0) return;
615 615
616 lru_traverse(&pf->cache._lru, glyph_file_write); 616 lru_traverse(&pf->cache._lru, glyph_file_write);
617 617
618 if (cache_fd < 0) 618 if (cache_fd >= 0)
619 { 619 {
620 close(cache_fd); 620 close(cache_fd);
621 cache_fd = -1; 621 cache_fd = -1;
@@ -677,7 +677,7 @@ int font_get_width(struct font* pf, unsigned short char_code)
677 677
678 return pf->width? pf->width[char_code]: pf->maxwidth; 678 return pf->width? pf->width[char_code]: pf->maxwidth;
679} 679}
680 680
681const unsigned char* font_get_bits(struct font* pf, unsigned short char_code) 681const unsigned char* font_get_bits(struct font* pf, unsigned short char_code)
682{ 682{
683 const unsigned char* bits; 683 const unsigned char* bits;
@@ -691,7 +691,7 @@ const unsigned char* font_get_bits(struct font* pf, unsigned short char_code)
691 bits = pf->bits + (pf->offset? 691 bits = pf->bits + (pf->offset?
692 ((uint16_t*)(pf->offset))[char_code]: 692 ((uint16_t*)(pf->offset))[char_code]:
693 (((pf->height + 7) / 8) * pf->maxwidth * char_code)); 693 (((pf->height + 7) / 8) * pf->maxwidth * char_code));
694 694
695 return bits; 695 return bits;
696} 696}
697 697