diff options
Diffstat (limited to 'firmware/export/font.h')
-rw-r--r-- | firmware/export/font.h | 23 |
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 @@ | |||
22 | #define _FONT_H | 22 | #define _FONT_H |
23 | 23 | ||
24 | #include "inttypes.h" | 24 | #include "inttypes.h" |
25 | #include "stdbool.h" | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Incore font and image definitions | 28 | * Incore font and image definitions |
@@ -46,18 +47,14 @@ | |||
46 | * Fonts are specified in firmware/font.c. | 47 | * Fonts are specified in firmware/font.c. |
47 | */ | 48 | */ |
48 | enum { | 49 | enum { |
49 | FONT_SYSFIXED, /* system fixed pitch font*/ | 50 | FONT_SYSFIXED = -1, /* system fixed pitch font*/ |
50 | FONT_UI, /* system porportional font*/ | 51 | FONT_FIRSTUSERFONT = 0, /* first id for the user fonts */ |
51 | #ifdef HAVE_REMOTE_LCD | ||
52 | FONT_UI_REMOTE, /* UI font for remote LCD */ | ||
53 | #endif | ||
54 | SYSTEMFONTCOUNT, /* Number of fonts reserved for the system and ui */ | ||
55 | FONT_FIRSTUSERFONT = 2 | ||
56 | }; | 52 | }; |
57 | #define MAXUSERFONTS 8 | 53 | #define MAXUSERFONTS 8 |
58 | 54 | ||
59 | /* SYSFONT, FONT_UI, FONT_UI_REMOTE + MAXUSERFONTS fonts in skins */ | 55 | /* SYSFONT, FONT_UI, FONT_UI_REMOTE + MAXUSERFONTS fonts in skins */ |
60 | #define MAXFONTS (SYSTEMFONTCOUNT + MAXUSERFONTS) | 56 | #define MAXFONTS (FONT_FIRSTUSERFONT + MAXUSERFONTS) |
57 | #define FONT_UI MAXFONTS | ||
61 | 58 | ||
62 | /* | 59 | /* |
63 | * .fnt loadable font file format definition | 60 | * .fnt loadable font file format definition |
@@ -105,7 +102,7 @@ struct font { | |||
105 | unsigned char *buffer_start; /* buffer to store the font in */ | 102 | unsigned char *buffer_start; /* buffer to store the font in */ |
106 | unsigned char *buffer_position; /* position in the buffer */ | 103 | unsigned char *buffer_position; /* position in the buffer */ |
107 | unsigned char *buffer_end; /* end of the buffer */ | 104 | unsigned char *buffer_end; /* end of the buffer */ |
108 | int buffer_size; /* size of the buffer in bytes */ | 105 | int buffer_size; /* size of the buffer in bytes */ |
109 | #ifndef __PCTOOL__ | 106 | #ifndef __PCTOOL__ |
110 | struct font_cache cache; | 107 | struct font_cache cache; |
111 | uint32_t file_width_offset; /* offset to file width data */ | 108 | uint32_t file_width_offset; /* offset to file width data */ |
@@ -117,17 +114,13 @@ struct font { | |||
117 | 114 | ||
118 | /* font routines*/ | 115 | /* font routines*/ |
119 | void font_init(void) INIT_ATTR; | 116 | void font_init(void) INIT_ATTR; |
120 | #ifdef HAVE_REMOTE_LCD | 117 | const char* font_filename(int font_id); |
121 | /* Load a font into the special remote ui font slot */ | 118 | int font_load(const char *path); |
122 | int font_load_remoteui(const char* path); | ||
123 | #endif | ||
124 | int font_load(struct font* pf, const char *path); | ||
125 | int font_glyphs_to_bufsize(const char *path, int glyphs); | 119 | int font_glyphs_to_bufsize(const char *path, int glyphs); |
126 | void font_unload(int font_id); | 120 | void font_unload(int font_id); |
127 | 121 | ||
128 | struct font* font_get(int font); | 122 | struct font* font_get(int font); |
129 | 123 | ||
130 | void font_reset(struct font *pf); | ||
131 | int font_getstringsize(const unsigned char *str, int *w, int *h, int fontnumber); | 124 | int font_getstringsize(const unsigned char *str, int *w, int *h, int fontnumber); |
132 | int font_get_width(struct font* ft, unsigned short ch); | 125 | int font_get_width(struct font* ft, unsigned short ch); |
133 | const unsigned char * font_get_bits(struct font* ft, unsigned short ch); | 126 | const unsigned char * font_get_bits(struct font* ft, unsigned short ch); |