summaryrefslogtreecommitdiff
path: root/firmware/export/font.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-24 13:19:34 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-24 13:19:34 +0000
commitaa0f4a4bbe370032d8166628f456709be1330118 (patch)
tree597c91fb16493881d7a281ef3c28e274a899022b /firmware/export/font.h
parentf323300b82aa945dd4cadb20d8d7e23a6602ef49 (diff)
FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/font.h')
-rw-r--r--firmware/export/font.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/firmware/export/font.h b/firmware/export/font.h
index a85f95e6ae..6c9e6163af 100644
--- a/firmware/export/font.h
+++ b/firmware/export/font.h
@@ -22,6 +22,7 @@
#define _FONT_H
#include "inttypes.h"
+#include "stdbool.h"
/*
* Incore font and image definitions
@@ -46,18 +47,14 @@
* Fonts are specified in firmware/font.c.
*/
enum {
- FONT_SYSFIXED, /* system fixed pitch font*/
- FONT_UI, /* system porportional font*/
-#ifdef HAVE_REMOTE_LCD
- FONT_UI_REMOTE, /* UI font for remote LCD */
-#endif
- SYSTEMFONTCOUNT, /* Number of fonts reserved for the system and ui */
- FONT_FIRSTUSERFONT = 2
+ FONT_SYSFIXED = -1, /* system fixed pitch font*/
+ FONT_FIRSTUSERFONT = 0, /* first id for the user fonts */
};
#define MAXUSERFONTS 8
/* SYSFONT, FONT_UI, FONT_UI_REMOTE + MAXUSERFONTS fonts in skins */
-#define MAXFONTS (SYSTEMFONTCOUNT + MAXUSERFONTS)
+#define MAXFONTS (FONT_FIRSTUSERFONT + MAXUSERFONTS)
+#define FONT_UI MAXFONTS
/*
* .fnt loadable font file format definition
@@ -105,7 +102,7 @@ struct font {
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 */
+ 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 */
@@ -117,17 +114,13 @@ struct font {
/* font routines*/
void font_init(void) INIT_ATTR;
-#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);
+const char* font_filename(int font_id);
+int font_load(const char *path);
int font_glyphs_to_bufsize(const char *path, int glyphs);
void font_unload(int font_id);
struct font* font_get(int font);
-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);