From c23ce62829d98c2dc78f1fd8a8810cefd0f10402 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 15 Jan 2014 13:37:40 +0100 Subject: fonts: Do not unload completely on USB. The font engine can now perform cache lookups even if the font file is closed, if the font was disabled with the new font_disable_all() function. It is highly probable that the lookup succeeds but in the cache-miss case a blank, full-width glyph will be returned. Change-Id: I3c97e747d2a0ba30c7b495c6118c9f029d265b56 --- firmware/font_cache.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/font_cache.c') diff --git a/firmware/font_cache.c b/firmware/font_cache.c index 4604d15..0b03eda 100644 --- a/firmware/font_cache.c +++ b/firmware/font_cache.c @@ -125,6 +125,7 @@ static int search(struct font_cache* fcache, struct font_cache_entry* font_cache_get( struct font_cache* fcache, unsigned short char_code, + bool cache_only, void (*callback) (struct font_cache_entry* p, void *callback_data), void *callback_data) { @@ -166,6 +167,8 @@ struct font_cache_entry* font_cache_get( } /* not found */ + if (cache_only) + return NULL; /* find index to replace */ short lru_handle_to_replace = fcache->_lru._head; -- cgit v1.1