summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-15 13:37:40 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-15 23:37:39 +0100
commitc23ce62829d98c2dc78f1fd8a8810cefd0f10402 (patch)
treec96a73b513350dabc3d33df2df376d86daa6cac9 /firmware/export
parent84c7d6133bf8a43688f1ac56d774fb94b1d3eed5 (diff)
downloadrockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.zip
rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.gz
rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.bz2
rockbox-c23ce62829d98c2dc78f1fd8a8810cefd0f10402.tar.xz
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
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/font.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/export/font.h b/firmware/export/font.h
index ed003f2..d19e0b8 100644
--- a/firmware/export/font.h
+++ b/firmware/export/font.h
@@ -125,6 +125,13 @@ void font_unload(int font_id);
void font_unload_all(void);
void font_lock(int font_id, bool lock);
+/* Closes the file descriptor if the font file (if cached) but keeps
+ * the cache intact, so font_get_{bits,width} still work. */
+void font_disable_all(void);
+/* Re-opens the file descriptor of the font file. Should be called as
+ * counter-part of font_disable_all(); */
+void font_enable_all(void);
+
struct font* font_get(int font);
int font_getstringsize(const unsigned char *str, int *w, int *h, int fontnumber);