From 37be80a1a5eefd862f7ee132083723cef03ceb3c Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 26 Jan 2014 13:56:53 +0100 Subject: fonts: Fix regression(s) caused by c23ce62. The builtin sysfont does not have an associated buflib_alloc_data (because it's builtin right?). font_get_{width,bits} accessed a field of it for all fonts which crashed on some systems but not on mine. Solution: Move this field to struct font directly. The cache size calculated was also busted. Fixes FS#12944 and most likely FS#12938. Change-Id: I32303c4335a12a6c421fdca34f7ece851aac12ca --- firmware/export/font.h | 1 + 1 file changed, 1 insertion(+) (limited to 'firmware/export/font.h') diff --git a/firmware/export/font.h b/firmware/export/font.h index d19e0b87ad..ad72cb52c7 100644 --- a/firmware/export/font.h +++ b/firmware/export/font.h @@ -107,6 +107,7 @@ struct font { unsigned char *buffer_position; /* position in the buffer */ unsigned char *buffer_end; /* end of the buffer */ size_t buffer_size; /* size of the buffer in bytes */ + bool disabled; /* font disabled (use blank as fallback if not in cache) */ #ifndef __PCTOOL__ struct font_cache cache; uint32_t file_width_offset; /* offset to file width data */ -- cgit v1.2.3