summaryrefslogtreecommitdiff
path: root/firmware/export/font.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-02-14 06:26:16 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-02-14 06:26:16 +0000
commit1c2aa35371aed8d895b3448dad865b913da57cfb (patch)
tree8a790ad8efe5d0abd73eaf77adc854d336ce0ef4 /firmware/export/font.h
parented21ab1c8c9b16ec62933313c3d36a93d9255f62 (diff)
FS#10984 - multifont! 2 major additions:
1) seperate UI font for the remote and main displays 2) allow individual skins to load additional fonts for use in the skin (Uo to 7 extra in this first version) see CustomWPS for info on how to load a font in the skins. Code should always use FONT_UI+screen_number to get the correct user font git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24644 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/font.h')
-rw-r--r--firmware/export/font.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/firmware/export/font.h b/firmware/export/font.h
index 0fe6c30f2c..e9bf086423 100644
--- a/firmware/export/font.h
+++ b/firmware/export/font.h
@@ -30,6 +30,7 @@
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
#ifndef __PCTOOL__
+#include "font_cache.h"
#include "sysfont.h"
#endif
@@ -47,9 +48,14 @@
enum {
FONT_SYSFIXED, /* system fixed pitch font*/
FONT_UI, /* system porportional font*/
- MAXFONTS
+#ifdef HAVE_REMOTE_LCD
+ FONT_UI_REMOTE, /* UI font for remote LCD */
+#endif
+ SYSTEMFONTCOUNT /* Number of fonts reserved for the system and ui */
};
+#define MAXFONTS 10
+
/*
* .fnt loadable font file format definition
*
@@ -89,17 +95,38 @@ struct font {
const unsigned char *width; /* character widths or NULL if fixed*/
int defaultchar; /* default char (not glyph index)*/
int32_t bits_size; /* # bytes of glyph bits*/
+
+ /* file, buffer and cache management */
+ int fd; /* fd for the font file. >= 0 if cached */
+ unsigned char *buffer_start; /* buffer to store the font in */
+ unsigned char *buffer_position; /* position in the buffer */
+ unsigned char *buffer_end; /* end of the buffer */
+ int buffer_size; /* size of the buffer in bytes */
+#ifndef __PCTOOL__
+ struct font_cache cache;
+ uint32_t file_width_offset; /* offset to file width data */
+ uint32_t file_offset_offset; /* offset to file offset data */
+ int long_offset;
+#endif
+
};
/* font routines*/
void font_init(void);
-struct font* font_load(const char *path);
+#ifdef HAVE_REMOTE_LCD
+/* Load a font into the special remote ui font slot */
+int font_load_remoteui(const char* path);
+#endif
+int font_load(struct font* pf, const char *path);
+void font_unload(int font_id);
+
struct font* font_get(int font);
-void font_reset(void);
+
+void font_reset(struct font *pf);
int font_getstringsize(const unsigned char *str, int *w, int *h, int fontnumber);
int font_get_width(struct font* ft, unsigned short ch);
const unsigned char * font_get_bits(struct font* ft, unsigned short ch);
-void glyph_cache_save(void);
+void glyph_cache_save(struct font* pf);
#else /* HAVE_LCD_BITMAP */