Greg Haerr's new loadable font. No more #ifdef font-style, removed old
propfont and loadable font code. New font file format.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2269 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/credits.c b/apps/credits.c
index f3bbd59..f8b060f 100644
--- a/apps/credits.c
+++ b/apps/credits.c
@@ -19,6 +19,7 @@
 
 #include "credits.h"
 #include "lcd.h"
+#include "font.h"
 #include "kernel.h"
 #include "button.h"
 #include "sprintf.h"
@@ -64,6 +65,7 @@
     "Chad Lockwood",
     "John Pybus",
     "Randy Wood",
+    "Gregory Haerr",
 };
 
 #ifdef HAVE_LCD_BITMAP
@@ -111,15 +113,15 @@
     int height;
     int width;
 
-    lcd_getfontsize(0, &width, &height);
+    lcd_getfontsize(FONT_UI, &width, &height);
 
     while(1) {
       lcd_clear_display();
       for ( i=0; i <= (64-y)/height; i++ )
-        lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"", 0);
+        lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"", FONT_UI);
       snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d  ",
               line+1, numnames);
-      lcd_putsxy(0, 0, buffer, 0);
+      lcd_putsxy(0, 0, buffer, FONT_UI);
       lcd_update();
 
       if (button_get_w_tmo(HZ/20))
diff --git a/apps/main.c b/apps/main.c
index 22fd8f6..4b8c9e1 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -45,9 +45,7 @@
 #include "debug_menu.h"
 #include "version.h"
 #include "sprintf.h"
-#ifdef LOADABLE_FONTS
-#include "unicode.h"
-#endif
+#include "font.h"
 
 
 char appsversion[]=APPSVERSION;
@@ -65,10 +63,8 @@
 void init(void)
 {
     init_threads();
-#ifdef LOADABLE_FONTS
-    unicode_init();
-#endif
     lcd_init();
+    font_init();
     show_logo();
     settings_reset();
     settings_load();
@@ -93,6 +89,10 @@
     
     lcd_init();
 
+    // FIXME should call font_init before this, 
+    // because may use loadable font in show_logo().
+    // I didn't call font_init here, since
+    // disk system isn't up yet.
     show_logo();
 
 #ifdef DEBUG
@@ -160,10 +160,7 @@
     status_init();
     usb_start_monitoring();
     power_init();
-#ifdef LOADABLE_FONTS
-    unicode_init();
-    lcd_init_fonts();
-#endif
+    font_init();
 }
 
 int main(void)
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 464b514..8c0b6a0 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -23,6 +23,7 @@
 #include "tree.h"
 #include "credits.h"
 #include "lcd.h"
+#include "font.h"
 #include "button.h"
 #include "kernel.h"
 #include "main_menu.h"
@@ -96,9 +97,9 @@
 #endif
 
     snprintf(version, sizeof(version), "Ver. %s", appsversion);
-    lcd_getfontsize(0, &font_w, &font_h);
+    lcd_getfontsize(FONT_SYSFIXED, &font_w, &font_h);
     lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
-               height+10+font_h, version, 0);
+               LCD_HEIGHT-font_h, version, FONT_SYSFIXED);
     lcd_update();
 
 #else
diff --git a/apps/menu.c b/apps/menu.c
index f690a1a..dd5b9ba 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -19,6 +19,7 @@
 #include <stdbool.h>
 
 #include "lcd.h"
+#include "font.h"
 #include "backlight.h"
 #include "menu.h"
 #include "button.h"
@@ -34,10 +35,6 @@
 #include "widgets.h"
 #endif
 
-#ifdef LOADABLE_FONTS
-#include "ajf.h"
-#endif
-
 struct menu {
     int top;
     int cursor;
@@ -54,8 +51,10 @@
 
 #define LINE_X      0 /* X position the entry-list starts at */
 #define LINE_Y      (global_settings.statusbar ? 1 : 0) /* Y position the entry-list starts at */
-#define LINE_HEIGTH 8 /* pixels for each text line */
 
+//FIXME remove
+#define LINE_HEIGTH 8 /* pixels for each text line */
+//FIXME remove
 #define MENU_LINES  (LCD_HEIGHT / LINE_HEIGTH - LINE_Y)
 
 #define CURSOR_X    (global_settings.scrollbar ? 1 : 0)
@@ -89,17 +88,12 @@
 static struct menu menus[MAX_MENUS];
 static bool inuse[MAX_MENUS] = { false };
 
-/* count in letter posistions, NOT pixels */
+/* count in letter positions, NOT pixels */
 void put_cursorxy(int x, int y, bool on)
 {
 #ifdef HAVE_LCD_BITMAP
-#ifdef LOADABLE_FONTS
-    int fh;
-    unsigned char* font = lcd_getcurrentldfont();
-    fh = ajf_get_fontheight(font);
-#else 
-    int fh = 8;
-#endif
+    int fh, fw;
+    lcd_getfontsize(FONT_UI, &fw, &fh);
 #endif
 
     /* place the cursor */
@@ -131,11 +125,10 @@
 static void menu_draw(int m)
 {
     int i = 0;
-#ifdef LOADABLE_FONTS
+#if LCD_PROPFONTS
+    int fw, fh;
     int menu_lines;
-    int fh;
-    unsigned char* font = lcd_getcurrentldfont();
-    fh = ajf_get_fontheight(font);
+    lcd_getfontsize(FONT_UI, &fw, &fh);
     if (global_settings.statusbar)
         menu_lines = (LCD_HEIGHT - STATUSBAR_HEIGHT) / fh;
     else
@@ -148,7 +141,7 @@
     lcd_clear_display(); /* ...then clean the screen */
 #ifdef HAVE_LCD_BITMAP
     lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and icon */
-    lcd_setfont(0);
+    lcd_setfont(FONT_UI);
 #endif
     /* correct cursor pos if out of screen */
     if (menus[m].cursor - menus[m].top >= menu_lines)
@@ -182,18 +175,18 @@
 static void put_cursor(int m, int target)
 {
     bool do_update = true;
-#ifdef LOADABLE_FONTS
+#if LCD_PROPFONTS
+    int fw, fh;
     int menu_lines;
-    int fh;
-    unsigned char* font = lcd_getcurrentldfont();
-    fh = ajf_get_fontheight(font);
+    lcd_getfontsize(FONT_UI, &fw, &fh);
     if (global_settings.statusbar)
-        menu_lines = (LCD_HEIGHT-STATUSBAR_HEIGHT)/fh;
+        menu_lines = (LCD_HEIGHT - STATUSBAR_HEIGHT) / fh;
     else
         menu_lines = LCD_HEIGHT/fh;
 #else
     int menu_lines = MENU_LINES;
 #endif
+
     put_cursorxy(CURSOR_X, menus[m].cursor - menus[m].top, false);
     menus[m].cursor = target;
     menu_draw(m);
diff --git a/apps/recorder/bounce.c b/apps/recorder/bounce.c
index 9629106..999ba47 100644
--- a/apps/recorder/bounce.c
+++ b/apps/recorder/bounce.c
@@ -136,7 +136,6 @@
           lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20],
                      xtable[xx%71], table[yy&63],
                      11, 16, false);
-
         lcd_update();
 
         ysanke+= values[NUM_YSANKE].num;
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index 0501a3f..fbfaf6c 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -16,8 +16,9 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
-#include <lcd.h>
 #include <string.h>
+#include "lcd.h"
+#include "font.h"
 #include "kernel.h"
 #include "sprintf.h"
 #include "rtc.h"
@@ -233,15 +234,7 @@
         /* display volume lever numerical? */
         if (TIME_BEFORE(current_tick,switch_tick)) { 
             snprintf(buffer, sizeof(buffer), "%2d", percent);
-#if defined(LCD_PROPFONTS)
-            lcd_getstringsize(buffer, 0, &width, &height);
-#elif defined(LOADABLE_FONTS)
-            font = lcd_getcurrentldfont();
-            lcd_getstringsize(buffer, font, &width, &height);
-#else
-            width = 6*strlen(buffer);
-            height = 8;
-#endif
+            lcd_getstringsize(buffer, FONT_UI, &width, &height);
             if (height <= STATUSBAR_HEIGHT)
                 lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 -
                            width/2, STATUSBAR_Y_POS, buffer, 0);
@@ -316,15 +309,7 @@
         strncpy(buffer, "--:--", sizeof buffer);
     }
 
-#if defined(LCD_PROPFONTS)
-    lcd_getstringsize(buffer, 0, &width, &height);
-#elif defined(LOADABLE_FONTS)
-    font = lcd_getcurrentldfont();
-    lcd_getstringsize(buffer, font, &width, &height);
-#else
-    width = 6*strlen(buffer);
-    height = 8;
-#endif
+    lcd_getstringsize(buffer, FONT_UI, &width, &height);
     if (height <= STATUSBAR_HEIGHT)
         lcd_putsxy(TIME_X_END - width, STATUSBAR_Y_POS, buffer, 0);
 }
diff --git a/apps/recorder/wormlet.c b/apps/recorder/wormlet.c
index ba96f6b..84ee550 100644
--- a/apps/recorder/wormlet.c
+++ b/apps/recorder/wormlet.c
@@ -67,11 +67,7 @@
 /* size of the field the worm lives in */
 #define FIELD_RECT_X 1
 #define FIELD_RECT_Y 1
-#ifdef LCD_PROPFONTS
 #define FIELD_RECT_WIDTH  (LCD_WIDTH - 39)
-#else
-#define FIELD_RECT_WIDTH  (LCD_WIDTH - 46)
-#endif
 #define FIELD_RECT_HEIGHT (LCD_HEIGHT - 2)
 
 /* size of the ring of the worm 
diff --git a/apps/settings.c b/apps/settings.c
index a1bbe4a..ce2b28f 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -40,6 +40,7 @@
 #include "atoi.h"
 #ifdef HAVE_LCD_BITMAP
 #include "icons.h"
+#include "font.h"
 #endif
 
 struct user_settings global_settings;
@@ -772,15 +773,10 @@
     int realyear;
     int julianday;
     int i;
-#if defined(LOADABLE_FONTS) || defined(LCD_PROPFONTS)
     unsigned char reffub[5];
     unsigned int width, height;
     unsigned int separator_width, weekday_width;
     unsigned int line_height, prev_line_height;
-#if defined(LOADABLE_FONTS)
-    unsigned char *font = lcd_getcurrentldfont();
-#endif
-#endif
 
 #ifdef HAVE_LCD_BITMAP
     if(global_settings.statusbar)
@@ -817,65 +813,35 @@
                  timedate[1],
                  timedate[2]);
         lcd_puts(0, 1, buffer);
-#if defined(LCD_PROPFONTS)
+
         /* recalculate the positions and offsets */
-        lcd_getstringsize(string, 0, &width, &prev_line_height);
-        lcd_getstringsize(buffer, 0, &width, &line_height);
-        lcd_getstringsize(":", 0, &separator_width, &height);
+        lcd_getstringsize(string, FONT_UI, &width, &prev_line_height);
+        lcd_getstringsize(buffer, FONT_UI, &width, &line_height);
+        lcd_getstringsize(":", FONT_UI, &separator_width, &height);
 
         strncpy(reffub, buffer, 2);
         reffub[2] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[0][INDEX_X] = 0;
         cursor[0][INDEX_Y] = 1 + prev_line_height + 1;
         cursor[0][INDEX_WIDTH] = width;
 
         strncpy(reffub, buffer + 3, 2);
         reffub[2] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width;
         cursor[1][INDEX_Y] = 1 + prev_line_height + 1;
         cursor[1][INDEX_WIDTH] = width;
 
         strncpy(reffub, buffer + 6, 2);
         reffub[2] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width +
                              cursor[1][INDEX_WIDTH] + separator_width;
         cursor[2][INDEX_Y] = 1 + prev_line_height + 1;
         cursor[2][INDEX_WIDTH] = width;
 
-        lcd_getstringsize(buffer, 0, &width, &prev_line_height);
-#elif defined(LOADABLE_FONTS)
-        /* recalculate the positions and offsets */
-        lcd_getstringsize(string, font, &width, &prev_line_height);
-        lcd_getstringsize(buffer, font, &width, &line_height);
-        lcd_getstringsize(":", font, &separator_width, &height);
-        
-        strncpy(reffub, buffer, 2);
-        reffub[2] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[0][INDEX_X] = 0;
-        cursor[0][INDEX_Y] = prev_line_height;
-        cursor[0][INDEX_WIDTH] = width;
-
-        strncpy(reffub, buffer + 3, 2);
-        reffub[2] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[1][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width;
-        cursor[1][INDEX_Y] = prev_line_height;
-        cursor[1][INDEX_WIDTH] = width;
-
-        strncpy(reffub, buffer + 6, 2);
-        reffub[2] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[2][INDEX_X] = cursor[0][INDEX_WIDTH] + separator_width +
-                             cursor[1][INDEX_WIDTH] + separator_width;
-        cursor[2][INDEX_Y] = prev_line_height;
-        cursor[2][INDEX_WIDTH] = width;
-
-        lcd_getstringsize(buffer, font, &width, &prev_line_height);
-#endif
+        lcd_getstringsize(buffer, FONT_UI, &width, &prev_line_height);
 
         snprintf(buffer, sizeof(buffer), "%s 20%02d %s %02d ",
                  dayname[timedate[6]],
@@ -883,24 +849,24 @@
                  monthname[timedate[4] - 1],
                  timedate[5]);
         lcd_puts(0, 2, buffer);
-#if defined(LCD_PROPFONTS)
+
         /* recalculate the positions and offsets */
-        lcd_getstringsize(buffer, 0, &width, &line_height);
+        lcd_getstringsize(buffer, FONT_UI, &width, &line_height);
         strncpy(reffub, buffer, 3);
         reffub[3] = '\0';
-        lcd_getstringsize(reffub, 0, &weekday_width, &height);
-        lcd_getstringsize(" ", 0, &separator_width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &weekday_width, &height);
+        lcd_getstringsize(" ", FONT_UI, &separator_width, &height);
 
         strncpy(reffub, buffer + 4, 4);
         reffub[4] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[3][INDEX_X] = weekday_width + separator_width;
         cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1;
         cursor[3][INDEX_WIDTH] = width;
 
         strncpy(reffub, buffer + 9, 3);
         reffub[3] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[4][INDEX_X] = weekday_width + separator_width +
                              cursor[3][INDEX_WIDTH] + separator_width;
         cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height + 1;
@@ -908,7 +874,7 @@
 
         strncpy(reffub, buffer + 13, 2);
         reffub[2] = '\0';
-        lcd_getstringsize(reffub, 0, &width, &height);
+        lcd_getstringsize(reffub, FONT_UI, &width, &height);
         cursor[5][INDEX_X] = weekday_width + separator_width +
                              cursor[3][INDEX_WIDTH] + separator_width +
                              cursor[4][INDEX_WIDTH] + separator_width;
@@ -919,48 +885,7 @@
                        cursor[cursorpos][INDEX_Y] + lcd_getymargin(),
                        cursor[cursorpos][INDEX_WIDTH],
                        line_height);
-#elif defined(LOADABLE_FONTS)
-        /* recalculate the positions and offsets */
-        lcd_getstringsize(buffer, font, &width, &line_height);
-        strncpy(reffub, buffer, 3);
-        reffub[3] = '\0';
-        lcd_getstringsize(reffub, font, &weekday_width, &height);
-        lcd_getstringsize(" ", font, &separator_width, &height);
 
-        strncpy(reffub, buffer + 4, 4);
-        reffub[4] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[3][INDEX_X] = weekday_width + separator_width;
-        cursor[3][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
-        cursor[3][INDEX_WIDTH] = width;
-
-        strncpy(reffub, buffer + 9, 3);
-        reffub[3] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[4][INDEX_X] = weekday_width + separator_width +
-                             cursor[3][INDEX_WIDTH] + separator_width;
-        cursor[4][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
-        cursor[4][INDEX_WIDTH] = width;
-
-        strncpy(reffub, buffer + 13, 2);
-        reffub[2] = '\0';
-        lcd_getstringsize(reffub, font, &width, &height);
-        cursor[5][INDEX_X] = weekday_width + separator_width +
-                             cursor[3][INDEX_WIDTH] + separator_width +
-                             cursor[4][INDEX_WIDTH] + separator_width;
-        cursor[5][INDEX_Y] = cursor[0][INDEX_Y] + prev_line_height;
-        cursor[5][INDEX_WIDTH] = width;
-
-        lcd_invertrect(cursor[cursorpos][INDEX_X],
-                       cursor[cursorpos][INDEX_Y] + lcd_getymargin(),
-                       cursor[cursorpos][INDEX_WIDTH],
-                       line_height);
-#else
-        lcd_invertrect(cursor[cursorpos][INDEX_X],
-                       cursor[cursorpos][INDEX_Y] + lcd_getymargin(),
-                       cursor[cursorpos][INDEX_WIDTH],
-                       8);
-#endif
         lcd_puts(0, 4, "ON  to set");
         lcd_puts(0, 5, "OFF to revert");
 #ifdef HAVE_LCD_BITMAP
diff --git a/apps/tree.c b/apps/tree.c
index 47853f0..21aa78c 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -26,6 +26,7 @@
 #include "dir.h"
 #include "file.h"
 #include "lcd.h"
+#include "font.h"
 #include "backlight.h"
 #include "button.h"
 #include "kernel.h"
@@ -49,10 +50,6 @@
 #include "widgets.h"
 #endif
 
-#ifdef LOADABLE_FONTS
-#include "ajf.h"
-#endif
-
 #define NAME_BUFFER_SIZE (AVERAGE_FILENAME_LENGTH * MAX_FILES_IN_DIR)
 
 char name_buffer[NAME_BUFFER_SIZE];
@@ -190,17 +187,16 @@
     int i;
     int tree_max_on_screen;
     bool dir_buffer_full;
-#ifdef LOADABLE_FONTS
-    int fh;
-    unsigned char *font = lcd_getcurrentldfont();
-    fh  = ajf_get_fontheight(font);
+
+#ifdef HAVE_LCD_BITMAP
+    int fw, fh;
+    lcd_getfontsize(FONT_UI, &fw, &fh);
     tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
     line_height = fh;
 #else
     tree_max_on_screen = TREE_MAX_ON_SCREEN;
 #endif
 
-
     /* new dir? cache it */
     if (strncmp(path,lastdir,sizeof(lastdir))) {
         DIR *dir = opendir(path);
@@ -339,7 +335,7 @@
     lcd_clear_display();
 #ifdef HAVE_LCD_BITMAP
     lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and icon */
-    lcd_setfont(0);
+    lcd_setfont(FONT_UI);
 #endif
 
     for ( i=start; i < start+tree_max_on_screen; i++ ) {
@@ -573,10 +569,9 @@
     bool lastfilter = global_settings.mp3filter;
     bool lastsortcase = global_settings.sort_case;
     bool lastshowhidden = global_settings.show_hidden_files;
-#ifdef LOADABLE_FONTS
-    int fh;
-    unsigned char *font = lcd_getcurrentldfont();
-    fh  = ajf_get_fontheight(font);
+#ifdef HAVE_LCD_BITMAP
+    int fw, fh;
+    lcd_getfontsize(FONT_UI, &fw, &fh);
     tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
 #else
     tree_max_on_screen = TREE_MAX_ON_SCREEN;
@@ -743,10 +738,8 @@
                             reload_root = true;
                             global_settings.resume_index = -1;
                         }
-#ifdef LOADABLE_FONTS
+#ifdef HAVE_LCD_BITMAP
                         tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
-#else
-                        tree_max_on_screen = TREE_MAX_ON_SCREEN;
 #endif
                     }
                 }
@@ -836,10 +829,8 @@
                     lcd_stop_scroll();
                     if (wps_show() == SYS_USB_CONNECTED)
                         reload_root = true;
-#ifdef LOADABLE_FONTS
+#ifdef HAVE_LCD_BITMAP
                     tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
-#else
-                    tree_max_on_screen = TREE_MAX_ON_SCREEN;
 #endif
                     restore = true;
                 }
@@ -855,10 +846,9 @@
             case BUTTON_F3:
                 if (f3_screen())
                     reload_root = true;
-#ifdef LOADABLE_FONTS
+
+#ifdef HAVE_LCD_BITMAP
                 tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
-#else
-                tree_max_on_screen = TREE_MAX_ON_SCREEN;
 #endif
                 restore = true;
                 break;
diff --git a/apps/wps-display.c b/apps/wps-display.c
index 5d6290d..8d33c72 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 
 #include "lcd.h"
+#include "font.h"
 #include "mpeg.h"
 #include "id3.h"
 #include "settings.h"
@@ -42,10 +43,6 @@
 #include "widgets.h"
 #endif
 
-#ifdef LOADABLE_FONTS
-#include "ajf.h"
-#endif
-
 #define WPS_CONFIG ROCKBOX_DIR "/default.wps"
 
 #ifdef HAVE_LCD_BITMAP
@@ -551,11 +548,7 @@
 #else
                 int w,h;
                 int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
-#ifdef LCD_PROPFONTS
-                lcd_getstringsize("M",0,&w,&h);
-#else
-                lcd_getfontsize(0,&w,&h);
-#endif
+                lcd_getstringsize("M",FONT_UI,&w,&h);
                 slidebar(0, i*h + offset + 1, LCD_WIDTH, 6, 
                          (id3->elapsed + ff_rewind_count) * 100 / id3->length,
                          Grow_Right);
@@ -581,15 +574,6 @@
 
 void wps_display(struct mp3entry* id3)
 {
-    int font_height;
-
-#ifdef LOADABLE_FONTS
-    unsigned char *font = lcd_getcurrentldfont();
-    font_height = ajf_get_fontheight(font);
-#else
-    font_height = 8;
-#endif
-
     lcd_clear_display();
 
     if (!id3 && !mpeg_is_playing())
diff --git a/apps/wps.c b/apps/wps.c
index 4ac2476..d10eb92 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -22,6 +22,7 @@
 
 #include "file.h"
 #include "lcd.h"
+#include "font.h"
 #include "backlight.h"
 #include "button.h"
 #include "kernel.h"
@@ -40,10 +41,6 @@
 #include "icons.h"
 #endif
 
-#ifdef LOADABLE_FONTS
-#include "ajf.h"
-#endif
-
 #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ 
                                 /* 3% of 30min file == 54s step size */
 
@@ -634,21 +631,17 @@
     char buf[32];
 
     /* Get the font height */
-#ifdef LCD_PROPFONTS
-        lcd_getstringsize("A",0,&w,&h);
-#else
-        lcd_getfontsize(0,&w,&h);
-#endif
+    lcd_getstringsize("A",FONT_UI,&w,&h);
 
     lcd_stop_scroll();
 
     while (!exit) {
         lcd_clear_display();
 
-        lcd_putsxy(0, LCD_HEIGHT/2 - h*2, "Shuffle", 0);
-        lcd_putsxy(0, LCD_HEIGHT/2 - h, "mode:", 0);
+        lcd_putsxy(0, LCD_HEIGHT/2 - h*2, "Shuffle", FONT_UI);
+        lcd_putsxy(0, LCD_HEIGHT/2 - h, "mode:", FONT_UI);
         lcd_putsxy(0, LCD_HEIGHT/2, 
-                   global_settings.playlist_shuffle ? "on" : "off", 0);
+                   global_settings.playlist_shuffle ? "on" : "off", FONT_UI);
         lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], 
                    LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true);
 
@@ -656,13 +649,8 @@
                  global_settings.mp3filter ? "on" : "off");
 
         /* Get the string width and height */
-#ifdef LCD_PROPFONTS
-        lcd_getstringsize(buf,0,&w,&h);
-#else
-        lcd_getfontsize(0,&w,&h);
-        w *= strlen(buf);
-#endif
-        lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, buf, 0);
+        lcd_getstringsize(buf,FONT_UI,&w,&h);
+        lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, buf, FONT_UI);
         lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow],
                    LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true);
 
@@ -717,26 +705,20 @@
         char* ptr;
 
         ptr = "Status";
-#ifdef LCD_PROPFONTS
-        lcd_getstringsize(ptr,0,&w,&h);
-#else
-        lcd_getfontsize(0,&w,&h);
-        w *= strlen(ptr);
-#endif
-
+        lcd_getstringsize(ptr,FONT_UI,&w,&h);
         lcd_clear_display();
 
-        lcd_putsxy(0, LCD_HEIGHT/2 - h*2, "Scroll", 0);
-        lcd_putsxy(0, LCD_HEIGHT/2 - h, "bar:", 0);
+        lcd_putsxy(0, LCD_HEIGHT/2 - h*2, "Scroll", FONT_UI);
+        lcd_putsxy(0, LCD_HEIGHT/2 - h, "bar:", FONT_UI);
         lcd_putsxy(0, LCD_HEIGHT/2, 
-                   global_settings.scrollbar ? "on" : "off", 0);
+                   global_settings.scrollbar ? "on" : "off", FONT_UI);
         lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], 
                    LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true);
 
-        lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, ptr, 0);
-        lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, "bar:", 0);
+        lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, ptr, FONT_UI);
+        lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, "bar:", FONT_UI);
         lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, 
-                   global_settings.statusbar ? "on" : "off", 0 );
+                   global_settings.statusbar ? "on" : "off", FONT_UI);
         lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], 
                    LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true);
         lcd_update();
diff --git a/docs/AJF b/docs/AJF
index 6558dfc..9a3c86e 100644
--- a/docs/AJF
+++ b/docs/AJF
@@ -1,4 +1,4 @@
-Description of the binary AJF font file format
+Description of the binary AJF font file format (version 2)
 
 Index    Descripton
 
@@ -9,14 +9,27 @@
 23 - 24  "bound width"  (high 8 bits, low 8 bits)
 25 - 26  "bound height" (high 8 bits, low 8 bits)
 26 - 28  first character in the font
-29 - 2a  0x00ff (supposed number of characters in the font?)
-2b -     map offset table starts here. Each offset entry is supposed to be 
-         three bytes: width, offset highbyte, offset lowbyte
-         The offset is a relative offset, counted in bytes, to where in the
-         font data this particular char's bitmap image starts.
+29 - 2a  number of characters in the font (alwasys 0x00ff now)
+2b -     map offset table starts here. Each offset entry is two bytes:
+         offset highbyte, offset lowbyte
 
-         font data, in Rockbox-internal image-format. That means column-wise
+         The offset is number of bytes from the start of this file, to where
+         in the font data this particular char's font data starts.
+
+         There is one offset entry for each character in this font, starting
+         with 'first character' (set above) and ending when all the 'number
+         of characters' have been stored.
+
+?? -     Font data. First four bytes width, height, dispx and dispy and then
+         the glyph in Rockbox-internal image-format. That means column-wise
          left-to-right for the full width, the first 8 pixels of height. Then
          follows the next 8 pixels of height left-to-right.
 
-         We don't currently support fonts larger than 16 pixels.
+         We don't currently support fonts larger than 16 pixels. (This font
+         file format would have no problem with bigger sizes, but the internal
+         bitmap function has.)
+
+References
+
+        The BDF file format
+        http://partners.adobe.com/asn/developer/pdfs/tn/5005.BDF_Spec.pdf
\ No newline at end of file
diff --git a/firmware/X5x8.bdf b/firmware/X5x8.bdf
new file mode 100644
index 0000000..adb452a
--- /dev/null
+++ b/firmware/X5x8.bdf
@@ -0,0 +1,1967 @@
+STARTFONT 2.1
+COMMENT $Xorg: 5x8.bdf,v 1.3 2000/08/18 15:17:39 xorgcvs Exp $
+COMMENT Copyright 1989 Cognition Corp.
+COMMENT 
+COMMENT Permission to use, copy, modify, and distribute this software and its
+COMMENT documentation for any purpose and without fee is hereby granted,
+COMMENT provided that the above copyright notice appear in all copies and that
+COMMENT both that copyright notice and this permission notice appear in
+COMMENT supporting documentation, and that the name of Cognition Corp. not be
+COMMENT used in advertising or publicity pertaining to distribution of the
+COMMENT software without specific, written prior permission.  Cognition Corp.
+COMMENT makes no representations about the suitability of this software for any
+COMMENT purpose.  It is provided "as is" without express or implied warranty.
+COMMENT 
+COMMENT COGNITION CORP. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+COMMENT INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+COMMENT EVENT SHALL COGNITION CORP.  BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+COMMENT CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+COMMENT USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+COMMENT OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+COMMENT PERFORMANCE OF THIS SOFTWARE.
+FONT -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO646.1991-IRV
+SIZE 11 75 75
+FONTBOUNDINGBOX 5 8 0 0
+STARTPROPERTIES 19
+FONTNAME_REGISTRY ""
+FOUNDRY "Misc"
+FAMILY_NAME "Fixed"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 8
+POINT_SIZE 80
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "C"
+AVERAGE_WIDTH 50
+CHARSET_REGISTRY "ISO646.1991"
+CHARSET_ENCODING "IRV"
+FONT_DESCENT 1
+FONT_ASCENT 7
+COPYRIGHT "Copyright 1989 by Cognition Corp."
+DEFAULT_CHAR 0
+ENDPROPERTIES
+CHARS 128
+STARTCHAR C000
+ENCODING 0
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C001
+ENCODING 1
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+70
+f8
+70
+20
+00
+00
+ENDCHAR
+STARTCHAR C002
+ENCODING 2
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+28
+50
+28
+50
+28
+50
+28
+ENDCHAR
+STARTCHAR C003
+ENCODING 3
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+50
+50
+70
+50
+50
+38
+10
+10
+ENDCHAR
+STARTCHAR C004
+ENCODING 4
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+e0
+80
+c0
+b8
+a0
+30
+20
+20
+ENDCHAR
+STARTCHAR C005
+ENCODING 5
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+60
+80
+60
+00
+30
+28
+30
+28
+ENDCHAR
+STARTCHAR C006
+ENCODING 6
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+80
+80
+80
+e0
+38
+20
+30
+20
+ENDCHAR
+STARTCHAR C007
+ENCODING 7
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+50
+20
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C010
+ENCODING 8
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+70
+20
+00
+70
+00
+00
+ENDCHAR
+STARTCHAR C011
+ENCODING 9
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+90
+d0
+b0
+90
+20
+20
+20
+38
+ENDCHAR
+STARTCHAR C012
+ENCODING 10
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+a0
+a0
+a0
+40
+38
+10
+10
+10
+ENDCHAR
+STARTCHAR C013
+ENCODING 11
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+e0
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C014
+ENCODING 12
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+e0
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C015
+ENCODING 13
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+38
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C016
+ENCODING 14
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+38
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C017
+ENCODING 15
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+f8
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C020
+ENCODING 16
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+f8
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C021
+ENCODING 17
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+f8
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C022
+ENCODING 18
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+f8
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C023
+ENCODING 19
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+f8
+00
+00
+00
+ENDCHAR
+STARTCHAR C024
+ENCODING 20
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+00
+f8
+00
+00
+ENDCHAR
+STARTCHAR C025
+ENCODING 21
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+38
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C026
+ENCODING 22
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+e0
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C027
+ENCODING 23
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+f8
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C030
+ENCODING 24
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+f8
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C031
+ENCODING 25
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR C032
+ENCODING 26
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+20
+40
+20
+10
+70
+00
+ENDCHAR
+STARTCHAR C033
+ENCODING 27
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+20
+10
+20
+40
+70
+00
+ENDCHAR
+STARTCHAR C034
+ENCODING 28
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+f8
+50
+50
+50
+50
+00
+00
+ENDCHAR
+STARTCHAR C035
+ENCODING 29
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+f8
+20
+f8
+40
+00
+00
+ENDCHAR
+STARTCHAR C036
+ENCODING 30
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+e0
+40
+48
+b0
+00
+ENDCHAR
+STARTCHAR C037
+ENCODING 31
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+20
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C040
+ENCODING 32
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR !
+ENCODING 33
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+20
+20
+20
+00
+20
+00
+ENDCHAR
+STARTCHAR "
+ENCODING 34
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+50
+50
+50
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR #
+ENCODING 35
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+50
+50
+f8
+50
+f8
+50
+50
+00
+ENDCHAR
+STARTCHAR $
+ENCODING 36
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+70
+a0
+70
+28
+70
+20
+00
+ENDCHAR
+STARTCHAR %
+ENCODING 37
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+50
+20
+50
+10
+00
+00
+ENDCHAR
+STARTCHAR &
+ENCODING 38
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+20
+50
+50
+20
+50
+50
+28
+00
+ENDCHAR
+STARTCHAR '
+ENCODING 39
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+20
+40
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR (
+ENCODING 40
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+20
+20
+20
+10
+00
+00
+ENDCHAR
+STARTCHAR )
+ENCODING 41
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+20
+20
+20
+40
+00
+00
+ENDCHAR
+STARTCHAR *
+ENCODING 42
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+30
+78
+30
+48
+00
+00
+ENDCHAR
+STARTCHAR +
+ENCODING 43
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+20
+f8
+20
+20
+00
+00
+ENDCHAR
+STARTCHAR ,
+ENCODING 44
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+30
+20
+40
+00
+ENDCHAR
+STARTCHAR -
+ENCODING 45
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+78
+00
+00
+00
+ENDCHAR
+STARTCHAR .
+ENCODING 46
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+20
+70
+20
+00
+ENDCHAR
+STARTCHAR /
+ENCODING 47
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+08
+08
+10
+20
+40
+40
+00
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+50
+50
+50
+50
+20
+00
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+60
+20
+20
+20
+70
+00
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+08
+30
+40
+78
+00
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+10
+08
+48
+30
+00
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+30
+50
+78
+10
+10
+00
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+78
+40
+70
+08
+48
+30
+00
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+40
+50
+68
+48
+30
+00
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+78
+08
+10
+10
+20
+20
+00
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+30
+48
+48
+30
+00
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+58
+28
+08
+30
+00
+ENDCHAR
+STARTCHAR :
+ENCODING 58
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+30
+00
+30
+30
+00
+00
+ENDCHAR
+STARTCHAR ;
+ENCODING 59
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+30
+00
+30
+20
+40
+00
+ENDCHAR
+STARTCHAR <
+ENCODING 60
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+20
+40
+40
+20
+10
+00
+ENDCHAR
+STARTCHAR =
+ENCODING 61
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+70
+00
+70
+00
+00
+00
+ENDCHAR
+STARTCHAR >
+ENCODING 62
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+20
+10
+10
+20
+40
+00
+ENDCHAR
+STARTCHAR ?
+ENCODING 63
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+50
+10
+20
+00
+20
+00
+ENDCHAR
+STARTCHAR @
+ENCODING 64
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+30
+48
+98
+a8
+a8
+90
+40
+30
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+48
+78
+48
+48
+00
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+48
+70
+48
+48
+70
+00
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+40
+40
+48
+30
+00
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+48
+48
+48
+48
+70
+00
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+78
+40
+70
+40
+40
+78
+00
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+78
+40
+70
+40
+40
+40
+00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+40
+58
+48
+30
+00
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+48
+78
+48
+48
+48
+00
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+20
+20
+20
+20
+70
+00
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+38
+08
+08
+08
+48
+30
+00
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+50
+60
+50
+50
+48
+00
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+40
+40
+40
+40
+70
+00
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+78
+78
+48
+48
+48
+00
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+68
+78
+58
+58
+48
+00
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+48
+48
+48
+30
+00
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+48
+48
+70
+40
+40
+00
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+48
+68
+58
+30
+08
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+48
+48
+70
+58
+48
+00
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+30
+48
+20
+10
+48
+30
+00
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+f8
+20
+20
+20
+20
+20
+00
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+48
+48
+48
+48
+30
+00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+48
+48
+48
+30
+30
+00
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+48
+48
+78
+78
+48
+00
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+48
+48
+30
+30
+48
+48
+00
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+88
+88
+50
+20
+20
+20
+00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+78
+08
+10
+20
+40
+78
+00
+ENDCHAR
+STARTCHAR [
+ENCODING 91
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+40
+40
+40
+40
+70
+00
+ENDCHAR
+STARTCHAR \
+ENCODING 92
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+40
+20
+10
+08
+08
+00
+ENDCHAR
+STARTCHAR ]
+ENCODING 93
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+70
+10
+10
+10
+10
+70
+00
+ENDCHAR
+STARTCHAR ^
+ENCODING 94
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+50
+50
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR _
+ENCODING 95
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+78
+ENDCHAR
+STARTCHAR `
+ENCODING 96
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+60
+40
+20
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+28
+58
+58
+28
+00
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+40
+70
+48
+48
+70
+00
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+30
+40
+40
+30
+00
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+08
+08
+28
+58
+58
+28
+00
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+30
+78
+40
+30
+00
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+28
+20
+70
+20
+20
+00
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+30
+48
+38
+08
+30
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+40
+70
+48
+48
+48
+00
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+00
+60
+20
+20
+70
+00
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+10
+00
+10
+10
+10
+50
+20
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+40
+40
+48
+70
+48
+48
+00
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+60
+20
+20
+20
+20
+70
+00
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+50
+a8
+a8
+88
+00
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+70
+48
+48
+48
+00
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+30
+48
+48
+30
+00
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+70
+48
+70
+40
+40
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+38
+48
+38
+08
+08
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+50
+68
+40
+40
+00
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+70
+60
+10
+70
+00
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+20
+70
+20
+28
+10
+00
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+48
+48
+48
+38
+00
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+50
+50
+50
+20
+00
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+88
+a8
+a8
+70
+00
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+48
+30
+30
+48
+00
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+48
+48
+38
+48
+30
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+78
+10
+20
+78
+00
+ENDCHAR
+STARTCHAR {
+ENCODING 123
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+18
+20
+10
+60
+10
+20
+18
+00
+ENDCHAR
+STARTCHAR |
+ENCODING 124
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+20
+20
+20
+20
+20
+20
+00
+ENDCHAR
+STARTCHAR }
+ENCODING 125
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+60
+10
+20
+18
+20
+10
+60
+00
+ENDCHAR
+STARTCHAR ~
+ENCODING 126
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+28
+50
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR C177
+ENCODING 127
+SWIDTH 1 0
+DWIDTH 5 0
+BBX 5 8 0 -1
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+ENDFONT
diff --git a/firmware/X5x8.c b/firmware/X5x8.c
new file mode 100644
index 0000000..6422cc8
--- /dev/null
+++ b/firmware/X5x8.c
@@ -0,0 +1,2853 @@
+/* Generated by convbdf on Tue Sep 10 11:31:14 MDT 2002. */
+#include "config.h"
+#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
+#include "font.h"
+
+/* Font information:
+
+   name: -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO646.1991-IRV
+   pixel size: 8
+   ascent: 7
+   descent: 1
+*/
+
+/* Font character bitmap data. */
+static MWIMAGEBITS X5x8_bits[] = {
+
+/* Character (0x00):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x01):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | ***            |
+   |*****           |
+   | ***            |
+   |  *             |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x7000, 
+0xf800, 
+0x7000, 
+0x2000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x02):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  * *           |
+   | * *            |
+   |  * *           |
+   | * *            |
+   |  * *           |
+   | * *            |
+   |  * *           |
+   +----------------+ */
+0x0000, 
+0x2800, 
+0x5000, 
+0x2800, 
+0x5000, 
+0x2800, 
+0x5000, 
+0x2800, 
+
+/* Character (0x03):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   | * *            |
+   | * *            |
+   | ***            |
+   | * *            |
+   | * *            |
+   |  ***           |
+   |   *            |
+   |   *            |
+   +----------------+ */
+0x5000, 
+0x5000, 
+0x7000, 
+0x5000, 
+0x5000, 
+0x3800, 
+0x1000, 
+0x1000, 
+
+/* Character (0x04):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |***             |
+   |*               |
+   |**              |
+   |* ***           |
+   |* *             |
+   |  **            |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0xe000, 
+0x8000, 
+0xc000, 
+0xb800, 
+0xa000, 
+0x3000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x05):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   | **             |
+   |*               |
+   | **             |
+   |                |
+   |  **            |
+   |  * *           |
+   |  **            |
+   |  * *           |
+   +----------------+ */
+0x6000, 
+0x8000, 
+0x6000, 
+0x0000, 
+0x3000, 
+0x2800, 
+0x3000, 
+0x2800, 
+
+/* Character (0x06):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |*               |
+   |*               |
+   |*               |
+   |***             |
+   |  ***           |
+   |  *             |
+   |  **            |
+   |  *             |
+   +----------------+ */
+0x8000, 
+0x8000, 
+0x8000, 
+0xe000, 
+0x3800, 
+0x2000, 
+0x3000, 
+0x2000, 
+
+/* Character (0x07):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | * *            |
+   |  *             |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x5000, 
+0x2000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x08):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | ***            |
+   |  *             |
+   |                |
+   | ***            |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x7000, 
+0x2000, 
+0x0000, 
+0x7000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x09):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |*  *            |
+   |** *            |
+   |* **            |
+   |*  *            |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  ***           |
+   +----------------+ */
+0x9000, 
+0xd000, 
+0xb000, 
+0x9000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x3800, 
+
+/* Character (0x0a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |* *             |
+   |* *             |
+   |* *             |
+   | *              |
+   |  ***           |
+   |   *            |
+   |   *            |
+   |   *            |
+   +----------------+ */
+0xa000, 
+0xa000, 
+0xa000, 
+0x4000, 
+0x3800, 
+0x1000, 
+0x1000, 
+0x1000, 
+
+/* Character (0x0b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |***             |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0xe000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x0c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |***             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0xe000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x0d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  ***           |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3800, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x0e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |  ***           |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0x3800, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x0f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |*****           |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0xf800, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x10):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |*****           |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0xf800, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x11):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |*****           |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0xf800, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x12):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |*****           |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0xf800, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x13):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |*****           |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0xf800, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x14):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |*****           |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0xf800, 
+0x0000, 
+0x0000, 
+
+/* Character (0x15):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |  ***           |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0x3800, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x16):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |***             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0xe000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x17):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |*****           |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0xf800, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x18):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |*****           |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0xf800, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x19):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   +----------------+ */
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+
+/* Character (0x1a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |  *             |
+   | *              |
+   |  *             |
+   |   *            |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x2000, 
+0x1000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x1b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   |  *             |
+   |   *            |
+   |  *             |
+   | *              |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x2000, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x1c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |*****           |
+   | * *            |
+   | * *            |
+   | * *            |
+   | * *            |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0xf800, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x1d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |*****           |
+   |  *             |
+   |*****           |
+   | *              |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0xf800, 
+0x2000, 
+0xf800, 
+0x4000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x1e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   |***             |
+   | *              |
+   | *  *           |
+   |* **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0xe000, 
+0x4000, 
+0x4800, 
+0xb000, 
+0x0000, 
+
+/* Character (0x1f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  *             |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x2000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x20):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x21):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |                |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x0000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x22):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | * *            |
+   | * *            |
+   | * *            |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x23):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   | * *            |
+   | * *            |
+   |*****           |
+   | * *            |
+   |*****           |
+   | * *            |
+   | * *            |
+   |                |
+   +----------------+ */
+0x5000, 
+0x5000, 
+0xf800, 
+0x5000, 
+0xf800, 
+0x5000, 
+0x5000, 
+0x0000, 
+
+/* Character (0x24):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   | ***            |
+   |* *             |
+   | ***            |
+   |  * *           |
+   | ***            |
+   |  *             |
+   |                |
+   +----------------+ */
+0x2000, 
+0x7000, 
+0xa000, 
+0x7000, 
+0x2800, 
+0x7000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x25):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | * *            |
+   |  *             |
+   | * *            |
+   |   *            |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x5000, 
+0x2000, 
+0x5000, 
+0x1000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x26):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  *             |
+   | * *            |
+   | * *            |
+   |  *             |
+   | * *            |
+   | * *            |
+   |  * *           |
+   |                |
+   +----------------+ */
+0x2000, 
+0x5000, 
+0x5000, 
+0x2000, 
+0x5000, 
+0x5000, 
+0x2800, 
+0x0000, 
+
+/* Character (0x27):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   |  *             |
+   | *              |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x2000, 
+0x4000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x28):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |  *             |
+   |  *             |
+   |  *             |
+   |   *            |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x1000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x29):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   |  *             |
+   |  *             |
+   |  *             |
+   | *              |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x4000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x2a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   |  **            |
+   | ****           |
+   |  **            |
+   | *  *           |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x3000, 
+0x7800, 
+0x3000, 
+0x4800, 
+0x0000, 
+0x0000, 
+
+/* Character (0x2b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   |  *             |
+   |*****           |
+   |  *             |
+   |  *             |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x2000, 
+0xf800, 
+0x2000, 
+0x2000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x2c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |  **            |
+   |  *             |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x3000, 
+0x2000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x2d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   | ****           |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x7800, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x2e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |  *             |
+   | ***            |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x2000, 
+0x7000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x2f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |    *           |
+   |    *           |
+   |   *            |
+   |  *             |
+   | *              |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0800, 
+0x0800, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x30):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | * *            |
+   | * *            |
+   | * *            |
+   | * *            |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x31):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | **             |
+   |  *             |
+   |  *             |
+   |  *             |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x6000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x32):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   |    *           |
+   |  **            |
+   | *              |
+   | ****           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x0800, 
+0x3000, 
+0x4000, 
+0x7800, 
+0x0000, 
+
+/* Character (0x33):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   |   *            |
+   |    *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x1000, 
+0x0800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x34):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |  **            |
+   | * *            |
+   | ****           |
+   |   *            |
+   |   *            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x3000, 
+0x5000, 
+0x7800, 
+0x1000, 
+0x1000, 
+0x0000, 
+
+/* Character (0x35):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ****           |
+   | *              |
+   | ***            |
+   |    *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7800, 
+0x4000, 
+0x7000, 
+0x0800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x36):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *              |
+   | * *            |
+   | ** *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4000, 
+0x5000, 
+0x6800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x37):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ****           |
+   |    *           |
+   |   *            |
+   |   *            |
+   |  *             |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7800, 
+0x0800, 
+0x1000, 
+0x1000, 
+0x2000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x38):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x39):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | * **           |
+   |  * *           |
+   |    *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x5800, 
+0x2800, 
+0x0800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x3a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   |  **            |
+   |                |
+   |  **            |
+   |  **            |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x3000, 
+0x0000, 
+0x3000, 
+0x3000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x3b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   |  **            |
+   |                |
+   |  **            |
+   |  *             |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x3000, 
+0x0000, 
+0x3000, 
+0x2000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x3c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |  *             |
+   | *              |
+   | *              |
+   |  *             |
+   |   *            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x4000, 
+0x2000, 
+0x1000, 
+0x0000, 
+
+/* Character (0x3d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   | ***            |
+   |                |
+   | ***            |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x7000, 
+0x0000, 
+0x7000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x3e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   |  *             |
+   |   *            |
+   |   *            |
+   |  *             |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x2000, 
+0x1000, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x3f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | * *            |
+   |   *            |
+   |  *             |
+   |                |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x5000, 
+0x1000, 
+0x2000, 
+0x0000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x40):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |  **            |
+   | *  *           |
+   |*  **           |
+   |* * *           |
+   |* * *           |
+   |*  *            |
+   | *              |
+   |  **            |
+   +----------------+ */
+0x3000, 
+0x4800, 
+0x9800, 
+0xa800, 
+0xa800, 
+0x9000, 
+0x4000, 
+0x3000, 
+
+/* Character (0x41):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   | ****           |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x7800, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x42):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   | *  *           |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x4800, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x7000, 
+0x0000, 
+
+/* Character (0x43):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | *              |
+   | *              |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x4000, 
+0x4000, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x44):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x7000, 
+0x0000, 
+
+/* Character (0x45):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ****           |
+   | *              |
+   | ***            |
+   | *              |
+   | *              |
+   | ****           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7800, 
+0x4000, 
+0x7000, 
+0x4000, 
+0x4000, 
+0x7800, 
+0x0000, 
+
+/* Character (0x46):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ****           |
+   | *              |
+   | ***            |
+   | *              |
+   | *              |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7800, 
+0x4000, 
+0x7000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x47):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | *              |
+   | * **           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x4000, 
+0x5800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x48):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | *  *           |
+   | ****           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x4800, 
+0x7800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x49):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x4a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  ***           |
+   |    *           |
+   |    *           |
+   |    *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3800, 
+0x0800, 
+0x0800, 
+0x0800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x4b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | * *            |
+   | **             |
+   | * *            |
+   | * *            |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x5000, 
+0x6000, 
+0x5000, 
+0x5000, 
+0x4800, 
+0x0000, 
+
+/* Character (0x4c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | *              |
+   | *              |
+   | *              |
+   | *              |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x4d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | ****           |
+   | ****           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x7800, 
+0x7800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x4e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | ** *           |
+   | ****           |
+   | * **           |
+   | * **           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x6800, 
+0x7800, 
+0x5800, 
+0x5800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x4f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x50):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | ***            |
+   | *              |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x7000, 
+0x4000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x51):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   | ** *           |
+   | * **           |
+   |  **            |
+   |    *           |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x6800, 
+0x5800, 
+0x3000, 
+0x0800, 
+
+/* Character (0x52):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | ***            |
+   | * **           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x7000, 
+0x5800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x53):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  **            |
+   | *  *           |
+   |  *             |
+   |   *            |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x3000, 
+0x4800, 
+0x2000, 
+0x1000, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x54):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |*****           |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0xf800, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x55):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x56):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x3000, 
+0x0000, 
+
+/* Character (0x57):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   | ****           |
+   | ****           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x7800, 
+0x7800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x58):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x59):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |*   *           |
+   |*   *           |
+   | * *            |
+   |  *             |
+   |  *             |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x8800, 
+0x8800, 
+0x5000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x5a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ****           |
+   |    *           |
+   |   *            |
+   |  *             |
+   | *              |
+   | ****           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7800, 
+0x0800, 
+0x1000, 
+0x2000, 
+0x4000, 
+0x7800, 
+0x0000, 
+
+/* Character (0x5b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   | *              |
+   | *              |
+   | *              |
+   | *              |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x4000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x5c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | *              |
+   |  *             |
+   |   *            |
+   |    *           |
+   |    *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x4000, 
+0x2000, 
+0x1000, 
+0x0800, 
+0x0800, 
+0x0000, 
+
+/* Character (0x5d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | ***            |
+   |   *            |
+   |   *            |
+   |   *            |
+   |   *            |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x7000, 
+0x1000, 
+0x1000, 
+0x1000, 
+0x1000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x5e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   | * *            |
+   | * *            |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x5000, 
+0x5000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x5f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   | ****           |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x7800, 
+
+/* Character (0x60):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | **             |
+   | *              |
+   |  *             |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x6000, 
+0x4000, 
+0x2000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x61):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  * *           |
+   | * **           |
+   | * **           |
+   |  * *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x2800, 
+0x5800, 
+0x5800, 
+0x2800, 
+0x0000, 
+
+/* Character (0x62):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | *              |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x4000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x7000, 
+0x0000, 
+
+/* Character (0x63):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  **            |
+   | *              |
+   | *              |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3000, 
+0x4000, 
+0x4000, 
+0x3000, 
+0x0000, 
+
+/* Character (0x64):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |    *           |
+   |    *           |
+   |  * *           |
+   | * **           |
+   | * **           |
+   |  * *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0800, 
+0x0800, 
+0x2800, 
+0x5800, 
+0x5800, 
+0x2800, 
+0x0000, 
+
+/* Character (0x65):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  **            |
+   | ****           |
+   | *              |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3000, 
+0x7800, 
+0x4000, 
+0x3000, 
+0x0000, 
+
+/* Character (0x66):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |  * *           |
+   |  *             |
+   | ***            |
+   |  *             |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x2800, 
+0x2000, 
+0x7000, 
+0x2000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x67):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  **            |
+   | *  *           |
+   |  ***           |
+   |    *           |
+   |  **            |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3000, 
+0x4800, 
+0x3800, 
+0x0800, 
+0x3000, 
+
+/* Character (0x68):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | *              |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x4000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x69):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   |                |
+   | **             |
+   |  *             |
+   |  *             |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x0000, 
+0x6000, 
+0x2000, 
+0x2000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x6a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |   *            |
+   |                |
+   |   *            |
+   |   *            |
+   |   *            |
+   | * *            |
+   |  *             |
+   +----------------+ */
+0x0000, 
+0x1000, 
+0x0000, 
+0x1000, 
+0x1000, 
+0x1000, 
+0x5000, 
+0x2000, 
+
+/* Character (0x6b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | *              |
+   | *              |
+   | *  *           |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x4000, 
+0x4000, 
+0x4800, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x6c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   | **             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x6000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x6d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | * *            |
+   |* * *           |
+   |* * *           |
+   |*   *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x5000, 
+0xa800, 
+0xa800, 
+0x8800, 
+0x0000, 
+
+/* Character (0x6e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | ***            |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x7000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x0000, 
+
+/* Character (0x6f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  **            |
+   | *  *           |
+   | *  *           |
+   |  **            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3000, 
+0x4800, 
+0x4800, 
+0x3000, 
+0x0000, 
+
+/* Character (0x70):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | ***            |
+   | *  *           |
+   | ***            |
+   | *              |
+   | *              |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x7000, 
+0x4800, 
+0x7000, 
+0x4000, 
+0x4000, 
+
+/* Character (0x71):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |  ***           |
+   | *  *           |
+   |  ***           |
+   |    *           |
+   |    *           |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x3800, 
+0x4800, 
+0x3800, 
+0x0800, 
+0x0800, 
+
+/* Character (0x72):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | * *            |
+   | ** *           |
+   | *              |
+   | *              |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x5000, 
+0x6800, 
+0x4000, 
+0x4000, 
+0x0000, 
+
+/* Character (0x73):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | ***            |
+   | **             |
+   |   *            |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x7000, 
+0x6000, 
+0x1000, 
+0x7000, 
+0x0000, 
+
+/* Character (0x74):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   |  *             |
+   | ***            |
+   |  *             |
+   |  * *           |
+   |   *            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x2000, 
+0x7000, 
+0x2000, 
+0x2800, 
+0x1000, 
+0x0000, 
+
+/* Character (0x75):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | *  *           |
+   | *  *           |
+   | *  *           |
+   |  ***           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x4800, 
+0x4800, 
+0x4800, 
+0x3800, 
+0x0000, 
+
+/* Character (0x76):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | * *            |
+   | * *            |
+   | * *            |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x5000, 
+0x5000, 
+0x5000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x77):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |*   *           |
+   |* * *           |
+   |* * *           |
+   | ***            |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x8800, 
+0xa800, 
+0xa800, 
+0x7000, 
+0x0000, 
+
+/* Character (0x78):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | *  *           |
+   |  **            |
+   |  **            |
+   | *  *           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x4800, 
+0x3000, 
+0x3000, 
+0x4800, 
+0x0000, 
+
+/* Character (0x79):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | *  *           |
+   | *  *           |
+   |  ***           |
+   | *  *           |
+   |  **            |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x4800, 
+0x4800, 
+0x3800, 
+0x4800, 
+0x3000, 
+
+/* Character (0x7a):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   | ****           |
+   |   *            |
+   |  *             |
+   | ****           |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x7800, 
+0x1000, 
+0x2000, 
+0x7800, 
+0x0000, 
+
+/* Character (0x7b):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |   **           |
+   |  *             |
+   |   *            |
+   | **             |
+   |   *            |
+   |  *             |
+   |   **           |
+   |                |
+   +----------------+ */
+0x1800, 
+0x2000, 
+0x1000, 
+0x6000, 
+0x1000, 
+0x2000, 
+0x1800, 
+0x0000, 
+
+/* Character (0x7c):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |  *             |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x2000, 
+0x0000, 
+
+/* Character (0x7d):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   | **             |
+   |   *            |
+   |  *             |
+   |   **           |
+   |  *             |
+   |   *            |
+   | **             |
+   |                |
+   +----------------+ */
+0x6000, 
+0x1000, 
+0x2000, 
+0x1800, 
+0x2000, 
+0x1000, 
+0x6000, 
+0x0000, 
+
+/* Character (0x7e):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |  * *           |
+   | * *            |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x2800, 
+0x5000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+
+/* Character (0x7f):
+   bbw=5, bbh=8, bbx=0, bby=-1, width=5
+   +----------------+
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   |                |
+   +----------------+ */
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+0x0000, 
+};
+
+/* Character->glyph mapping. */
+static unsigned long X5x8_offset[] = {
+  0,	/* (0x00) */
+  8,	/* (0x01) */
+  16,	/* (0x02) */
+  24,	/* (0x03) */
+  32,	/* (0x04) */
+  40,	/* (0x05) */
+  48,	/* (0x06) */
+  56,	/* (0x07) */
+  64,	/* (0x08) */
+  72,	/* (0x09) */
+  80,	/* (0x0a) */
+  88,	/* (0x0b) */
+  96,	/* (0x0c) */
+  104,	/* (0x0d) */
+  112,	/* (0x0e) */
+  120,	/* (0x0f) */
+  128,	/* (0x10) */
+  136,	/* (0x11) */
+  144,	/* (0x12) */
+  152,	/* (0x13) */
+  160,	/* (0x14) */
+  168,	/* (0x15) */
+  176,	/* (0x16) */
+  184,	/* (0x17) */
+  192,	/* (0x18) */
+  200,	/* (0x19) */
+  208,	/* (0x1a) */
+  216,	/* (0x1b) */
+  224,	/* (0x1c) */
+  232,	/* (0x1d) */
+  240,	/* (0x1e) */
+  248,	/* (0x1f) */
+  256,	/* (0x20) */
+  264,	/* (0x21) */
+  272,	/* (0x22) */
+  280,	/* (0x23) */
+  288,	/* (0x24) */
+  296,	/* (0x25) */
+  304,	/* (0x26) */
+  312,	/* (0x27) */
+  320,	/* (0x28) */
+  328,	/* (0x29) */
+  336,	/* (0x2a) */
+  344,	/* (0x2b) */
+  352,	/* (0x2c) */
+  360,	/* (0x2d) */
+  368,	/* (0x2e) */
+  376,	/* (0x2f) */
+  384,	/* (0x30) */
+  392,	/* (0x31) */
+  400,	/* (0x32) */
+  408,	/* (0x33) */
+  416,	/* (0x34) */
+  424,	/* (0x35) */
+  432,	/* (0x36) */
+  440,	/* (0x37) */
+  448,	/* (0x38) */
+  456,	/* (0x39) */
+  464,	/* (0x3a) */
+  472,	/* (0x3b) */
+  480,	/* (0x3c) */
+  488,	/* (0x3d) */
+  496,	/* (0x3e) */
+  504,	/* (0x3f) */
+  512,	/* (0x40) */
+  520,	/* (0x41) */
+  528,	/* (0x42) */
+  536,	/* (0x43) */
+  544,	/* (0x44) */
+  552,	/* (0x45) */
+  560,	/* (0x46) */
+  568,	/* (0x47) */
+  576,	/* (0x48) */
+  584,	/* (0x49) */
+  592,	/* (0x4a) */
+  600,	/* (0x4b) */
+  608,	/* (0x4c) */
+  616,	/* (0x4d) */
+  624,	/* (0x4e) */
+  632,	/* (0x4f) */
+  640,	/* (0x50) */
+  648,	/* (0x51) */
+  656,	/* (0x52) */
+  664,	/* (0x53) */
+  672,	/* (0x54) */
+  680,	/* (0x55) */
+  688,	/* (0x56) */
+  696,	/* (0x57) */
+  704,	/* (0x58) */
+  712,	/* (0x59) */
+  720,	/* (0x5a) */
+  728,	/* (0x5b) */
+  736,	/* (0x5c) */
+  744,	/* (0x5d) */
+  752,	/* (0x5e) */
+  760,	/* (0x5f) */
+  768,	/* (0x60) */
+  776,	/* (0x61) */
+  784,	/* (0x62) */
+  792,	/* (0x63) */
+  800,	/* (0x64) */
+  808,	/* (0x65) */
+  816,	/* (0x66) */
+  824,	/* (0x67) */
+  832,	/* (0x68) */
+  840,	/* (0x69) */
+  848,	/* (0x6a) */
+  856,	/* (0x6b) */
+  864,	/* (0x6c) */
+  872,	/* (0x6d) */
+  880,	/* (0x6e) */
+  888,	/* (0x6f) */
+  896,	/* (0x70) */
+  904,	/* (0x71) */
+  912,	/* (0x72) */
+  920,	/* (0x73) */
+  928,	/* (0x74) */
+  936,	/* (0x75) */
+  944,	/* (0x76) */
+  952,	/* (0x77) */
+  960,	/* (0x78) */
+  968,	/* (0x79) */
+  976,	/* (0x7a) */
+  984,	/* (0x7b) */
+  992,	/* (0x7c) */
+  1000,	/* (0x7d) */
+  1008,	/* (0x7e) */
+  1016,	/* (0x7f) */
+};
+
+/* Exported structure definition. */
+MWCFONT font_X5x8 = {
+  "X5x8",
+  5,
+  8,
+  7,
+  0,
+  128,
+  X5x8_bits,
+  X5x8_offset,
+  0,  /* fixed width*/
+  0,
+  sizeof(X5x8_bits)/sizeof(MWIMAGEBITS),
+};
+#endif /* HAVE_LCD_BITMAP */
+
diff --git a/firmware/ajf.c b/firmware/ajf.c
deleted file mode 100644
index 82ba0b7..0000000
--- a/firmware/ajf.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * $Id$
- *
- * Copyright (C) 2002 by Alex Gitelman
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#ifdef SIMULATOR
-#include <fcntl.h>
-#endif
-#include <file.h>
-#include "ajf.h"
-#include <string.h>
-#include <errno.h>
-#include <stdbool.h>
-#include "debug.h"
-
-static unsigned char font_buf[MAX_FONT_BUFLEN];
-
-unsigned char* ajf_read_font(char* fname)
-{
-    int count;
-#ifdef WIN32
-    int fd = open(fname, O_RDONLY|O_BINARY);
-#else
-    int fd = open(fname, O_RDONLY);
-#endif
-    if (fd<0)
-    {
-#ifdef SIMULATOR
-#ifdef WIN32
-        DEBUGF("Failed opening font file: %d %s. ", _errno(), fname);
-#else
-        DEBUGF("Failed opening font file: %d %s. ", errno, fname);
-#endif
-#endif
-        return NULL;
-    }
-
-    count = read(fd, font_buf, MAX_FONT_BUFLEN);
-    if (count==MAX_FONT_BUFLEN) {
-        DEBUGF("Font is larger than allocated %d bytes!\n",MAX_FONT_BUFLEN);
-        return NULL;
-    }
-    close(fd);
-
-    if (font_buf[0]!=MAGIC1 || font_buf[1]!=MAGIC2) {
-        DEBUGF("Bad magic word in font");
-        return NULL;
-    }
-    return font_buf;
-}
-
-
-unsigned char* ajf_get_charbuf(unsigned char c, unsigned char* font, 
-                               int *w, int *h)
-{
-    int height = READ_SHORT(&font[HEIGHT_OFFSET]);
-    int size = READ_SHORT(&font[SIZE_OFFSET]);
-    int chars_offset = LOOKUP_MAP_OFFSET + size*3;
-    int rows = (height-1)/8 + 1;
-    int first_char = READ_SHORT(&font[FIRST_CHAR_OFFSET]); 
-    int map_idx = LOOKUP_MAP_OFFSET + (c-first_char)*3;
-    int byte_count = font[map_idx];
-    int char_idx;
-
-    *h = height;
-    *w = byte_count/rows;
-
-    map_idx++;
-    char_idx = READ_SHORT(&font[map_idx]);
-    return &font[chars_offset + char_idx];
-}
-
-void ajf_get_charsize(unsigned char c, unsigned char* font, 
-                      int *width, int *height)
-{
-    int first_char = READ_SHORT(&font[FIRST_CHAR_OFFSET]); 
-    int map_idx = LOOKUP_MAP_OFFSET + (c-first_char)*3;
-    int rows = 1;
-    *height = READ_SHORT(&font[HEIGHT_OFFSET]);
-    rows = (*height-1)/8 + 1;
-    *width = font[map_idx]/rows;
-}
-
-int ajf_get_fontheight(unsigned char* font)
-{
-    return READ_SHORT(&font[HEIGHT_OFFSET]);
-}
diff --git a/firmware/ajf.h b/firmware/ajf.h
deleted file mode 100644
index 70d94fb..0000000
--- a/firmware/ajf.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * $Id$
- *
- * Copyright (C) 2002 by Alex Gitelman
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#ifndef __AJF__
-#define __AJF__
-
-/* defined here because they are used by tools/bdf2ajz */
-#define MAGIC1 0xBD
-#define MAGIC2 0xFC
-#define MAX_FONT_BUFLEN 4096
-
-#define CODE_PAGE_OFFSET 2 /* 1 byte TODO: unused now */
-#define FONT_NAME_OFFSET 3
-#define FONT_NAME_LEN 32
-#define MAX_WIDTH_OFFSET (FONT_NAME_OFFSET + FONT_NAME_LEN)  /* 2 byte */
-#define HEIGHT_OFFSET (MAX_WIDTH_OFFSET + 2) /* 2 byte */
-#define ASCENT_OFFSET (HEIGHT_OFFSET+2)      /* 2 byte ascent (baseline) height*/
-#define FIRST_CHAR_OFFSET (HEIGHT_OFFSET+2)  /* 2 bytes first character of font*/
-#define SIZE_OFFSET (FIRST_CHAR_OFFSET+2)    /* 2 bytes size of font (# encodings)*/
-#define LOOKUP_MAP_OFFSET SIZE_OFFSET+2      /* Map to lookup char positions */
-
-
-#define WRITE_SHORT(s,buf) { (buf)[0] = (s & 0xff00) >> 8 ; \
-                             (buf)[1] = s & 0x00ff; }
-#define READ_SHORT(buf) (((buf)[0]<<8) + (buf)[1])
-
-unsigned char* ajf_read_font(char* fname);
-unsigned char* ajf_get_charbuf(unsigned char c, unsigned char* font, 
-                               int *width, int *height);
-void ajf_get_charsize(unsigned char c, unsigned char* font,
-                      int *width, int *height);
-int ajf_get_fontheight(unsigned char* font);
-
-extern char _font_error_msg[];
-
-
-#endif
diff --git a/firmware/chartables.c b/firmware/chartables.c
index 8f6b314..7177aa7 100644
--- a/firmware/chartables.c
+++ b/firmware/chartables.c
Binary files differ
diff --git a/firmware/debug.h b/firmware/debug.h
index 876b851..e9eec27 100644
--- a/firmware/debug.h
+++ b/firmware/debug.h
@@ -26,7 +26,8 @@
 
 /*  */
 #if defined(DEBUG) || defined(SIMULATOR)
-#define DEBUGF(...) debugf(__VA_ARGS__)
+//#define DEBUGF(...) debugf(__VA_ARGS__)
+#define DEBUGF	debugf
 #else
 #define DEBUGF(...)
 #endif
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index c43807b..f0a2089 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -1049,10 +1049,6 @@
                         for (j=longs-1; j>=0; j--) {
                             unsigned char* ptr = dir->cached_buf;
                             int index = longarray[j];
-#ifdef LOADABLE_FONTS
-                            int offset_idx = 0;
-                            unsigned char uni_char[2];
-#endif
                             /* current or cached sector? */
                             if ( sectoridx >= SECTOR_SIZE ) {
                                 if ( sectoridx >= SECTOR_SIZE*2 ) {
@@ -1070,30 +1066,6 @@
                                 index &= SECTOR_SIZE-1;
                             }
 
-                            /* piece together the name subcomponents. */
-#ifdef LOADABLE_FONTS
-                            for (k=0; k<5; k++)
-                            {
-                                offset_idx = index + k*2 + 1;
-                                uni_char[0] = ptr[offset_idx+1];
-                                uni_char[1] = ptr[offset_idx];
-                                entry->name[l++] = from_unicode(uni_char);
-                            }
-                            for (k=0; k<6; k++)
-                            {
-                                offset_idx = index + k*2 + 14;
-                                uni_char[0] = ptr[offset_idx+1];
-                                uni_char[1] = ptr[offset_idx];
-                                entry->name[l++] = from_unicode(uni_char);
-                            }
-                            for (k=0; k<2; k++)
-                            {
-                                offset_idx = index + k*2 + 28;
-                                uni_char[0] = ptr[offset_idx+1];
-                                uni_char[1] = ptr[offset_idx];
-                                entry->name[l++] = from_unicode(uni_char);
-                            }
-#else
                             /* names are stored in unicode, but we
                                only grab the low byte (iso8859-1). */
                             for (k=0; k<5; k++)
@@ -1102,7 +1074,6 @@
                                 entry->name[l++] = ptr[index + k*2 + 14];
                             for (k=0; k<2; k++)
                                 entry->name[l++] = ptr[index + k*2 + 28];
-#endif
                         }
                         entry->name[l]=0;
                     }
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index e324887..5240dfd 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -26,17 +26,12 @@
 #include "file.h"
 #include "debug.h"
 #include "system.h"
-
-#ifdef LOADABLE_FONTS
-#include "ajf.h"
-#include "panic.h"
-#endif
+#include "font.h"
 
 #if defined(SIMULATOR)
 #include "sim_icons.h"
 #endif
 
-
 /*** definitions ***/
 
 #define LCDR (PBDR_ADDR+1)
@@ -513,9 +508,6 @@
 {
     create_thread(scroll_thread, scroll_stack,
                   sizeof(scroll_stack), scroll_name);
-#if  defined(LOADABLE_FONTS) && defined(SIMULATOR)
-    lcd_init_fonts();
-#endif
 }
 #endif
 
@@ -568,17 +560,11 @@
 #define    ASCII_MIN            0x20    /* First char in table */
 #define    ASCII_MAX            0x7f    /* Last char in table */
 
-extern unsigned char char_gen_6x8[][5];
-extern unsigned char char_gen_8x12[][14];
-extern unsigned char char_gen_12x16[][22];
-
 /* All zeros and ones bitmaps for area filling */
 static unsigned char zeros[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                  0x00, 0x00 };
 static unsigned char ones[]  = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                  0xff, 0xff };
-static char fonts[] = { 6,8,12 };
-static char fontheight[] = { 8,12,16 };
 
 #ifndef SIMULATOR
 
@@ -696,175 +682,14 @@
     return ymargin;
 }
 
-
-
-#ifdef LOADABLE_FONTS
-
-static unsigned char* _font = NULL;
-
-int lcd_init_fonts(void)
-{
-    if (!_font)
-        _font = ajf_read_font("/system.ajf");
-
-    if (!_font)
-    {
-        lcd_putsxy(0,0,"No font", 0);
-        return -1;
-    }
-
-    return 0;
-}
-
-void lcd_setldfont(unsigned char* f)
-{
-    _font = f;
-}
-
-unsigned char* lcd_getcurrentldfont()
-{
-    if (!_font)
-        panicf("No font loaded!");
-    return _font;
-}
-
-/*
- * Return width and height of a string with a given font.
- */
-int lcd_getstringsize(unsigned char *str, unsigned char* font, int *w, int *h)
-{
-    int width=0;
-    int height=0;
-    unsigned char ch;
-
-    if (!font)
-        panicf("No font specified");
-
-    while((ch = *str++)) 
-    {
-        int dw,dh;
-        ajf_get_charsize(ch, font, &dw, &dh);
-        if (dh>height)
-            height = dh;
-        width+=dw;
-    }
-    *w = width;
-    *h = height;
-
-    return width;
-}
-
-/*
- * Put a string at specified bit position
- */
-
-void lcd_putsldfxy(int x, int y, unsigned char *str)
-{
-    unsigned char ch;
-    int nx;
-    int ny=8;
-    int lcd_x = x;
-    int lcd_y = y;
-    if (!_font)
-    {
-        lcd_putsxy(0,0,"No font", 0);
-        return;
-    }
-    ny = (int)_font[2];
-    while (((ch = *str++) != '\0'))
-    {
-        unsigned char *char_buf = ajf_get_charbuf(ch, _font, &nx, &ny);
-        if (!char_buf)
-        {
-            char_buf = ajf_get_charbuf('?', _font, &nx, &ny);
-            if (!char_buf)
-                panicf("Bad font");
-        }
-        if(lcd_x + nx > LCD_WIDTH)
-            break;
-
-        lcd_bitmap (&char_buf[0], lcd_x, lcd_y, nx, ny, true);
-        lcd_x += nx;
-    }
-}
-#endif
-
-
-#ifdef LCD_PROPFONTS
-
-extern unsigned char char_dw_8x8_prop[][9];
-
-/*
- * Return width and height of a given font.
- */
-int lcd_getstringsize(unsigned char *str, unsigned int font, int *w, int *h)
-{
-    int width=0;
-    unsigned char ch, byte;
-    (void)font;
-
-    while((ch = *str++)) {
-        /* Limit to char generation table */
-        if (ch < ASCII_MIN)
-            /* replace unsupported letters with question marks */
-            ch = ' '-ASCII_MIN;
-        else
-            ch -= ASCII_MIN;
-
-        byte = char_dw_8x8_prop[ch][8];
-        width += (byte>>4) + 1;
-    }
-    *w = width;
-    *h = 8;
-
-    return width;
-}
-
-/*
- * Put a string at specified bit position
- */
-
-void lcd_putspropxy(int x, int y, unsigned char *str, int thisfont)
-{
-    unsigned int ch;
-    int nx;
-    int ny=8;
-    unsigned char *src;
-    int lcd_x = x;
-    int lcd_y = y;
-
-    (void)thisfont;
-
-    while (((ch = *str++) != '\0'))
-    {
-        /* Limit to char generation table */
-        if (ch < ASCII_MIN)
-            /* replace unsupported letters with question marks */
-            ch = ' '-ASCII_MIN;
-        else
-            ch -= ASCII_MIN;
-        
-        nx = char_dw_8x8_prop[ch][8] >> 4;
-
-        if(lcd_x + nx > LCD_WIDTH)
-            break;
-
-        src = char_dw_8x8_prop[ch];
-        lcd_clearrect (lcd_x+nx, lcd_y, 1, ny );
-        lcd_bitmap (src, lcd_x, lcd_y, nx, ny, true);
-
-        lcd_x += nx+1;
-    }
-}
-
-#endif
-
 /*
  * Put a string at specified character position
  */
+//FIXME require font parameter
 void lcd_puts(int x, int y, unsigned char *str)
 {
     int xpos,ypos,w,h;
+
 #if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS)
     /* We make the simulator truncate the string if it reaches the right edge,
        as otherwise it'll wrap. The real target doesn't wrap. */
@@ -882,23 +707,10 @@
     if(!str || !str[0])
         return;
 
-#ifdef LCD_PROPFONTS
     lcd_getstringsize(str, font, &w, &h);
-    xpos = xmargin + x * fonts[font];
-    ypos = ymargin + y * fontheight[font];
-    lcd_putspropxy(xpos, ypos, str, font);
-#elif LOADABLE_FONTS
-    lcd_getstringsize(str,_font,&w,&h);
-    xpos = xmargin + x * w / strlen(str);
-    ypos = ymargin + y * h;
-    lcd_putsldfxy(xpos, ypos, str);
-#else
-    xpos = xmargin + x * fonts[font];
-    ypos = ymargin + y * fontheight[font];
-    lcd_putsxy(xpos, ypos, str, font);
-    w = strlen(str) * fonts[font];
-    h = fontheight[font];
-#endif
+    xpos = xmargin + x*w / strlen(str); //FIXME why strlen?
+    ypos = ymargin + y*h;
+    lcd_putsxy( xpos, ypos, str, font);
     lcd_clearrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
 #if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS)
     /* this function is being used when simulating a charcell LCD and
@@ -907,58 +719,6 @@
 #endif
 }
 
-
-/*
- * Put a string at specified bit position
- */
-void lcd_putsxy(int x, int y, unsigned char *str, int thisfont)
-{
-#ifdef LCD_PROPFONTS
-    lcd_putspropxy(x,y,str,thisfont);
-#else
-
-    int nx = fonts[thisfont];
-    int ny = fontheight[thisfont];
-    int ch;
-    unsigned char *src;
-    int lcd_x = x;
-    int lcd_y = y;
-
-#ifdef LOADABLE_FONTS
-    if ( _font ) {
-        lcd_putsldfxy(x,y,str);
-        return;
-    }
-#endif
-
-    while (((ch = *str++) != '\0') && (lcd_x + nx <= LCD_WIDTH))
-    {
-        if (lcd_y + ny > LCD_HEIGHT)
-            return;
-
-        /* Limit to char generation table */
-        if ((ch < ASCII_MIN) || (ch > ASCII_MAX))
-            /* replace unsupported letters with question marks */
-            ch = '?' - ASCII_MIN;
-        else
-            ch -= ASCII_MIN;
-        
-        if (thisfont == 2)
-            src = char_gen_12x16[ch];
-        else if (thisfont == 1)
-            src = char_gen_8x12[ch];
-        else
-            src = char_gen_6x8[ch];
-        
-        lcd_bitmap (src, lcd_x, lcd_y, nx-1, ny, true);
-        lcd_bitmap (zeros, lcd_x+nx-1, lcd_y, 1, ny, true);
-
-        lcd_x += nx;
-
-    }
-#endif
-}
-
 /*
  * Display a bitmap at (x, y), size (nx, ny)
  * clear is true to clear destination area first
@@ -1265,17 +1025,6 @@
     INVERT_PIXEL(x,y);
 }
 
-/*
- * Return width and height of a given font.
- */
-void lcd_getfontsize(unsigned int font, int *width, int *height)
-{
-    if(font < sizeof(fonts)) {
-        *width =  fonts[font];
-        *height = fontheight[font];
-    }
-}
-
 #else
 /* no LCD defined, no code to use */
 #endif
@@ -1286,47 +1035,31 @@
 #ifdef HAVE_LCD_CHARCELLS
     s->space = 11 - x;
 #else
-
-#if defined(LCD_PROPFONTS) || defined(LOADABLE_FONTS)
     unsigned char ch[2];
     int w, h;
-#endif
     int width, height;
     lcd_getfontsize(font, &width, &height);
-#if defined(LCD_PROPFONTS) || defined(LOADABLE_FONTS)
+
     ch[1] = 0; /* zero terminate */
     ch[0] = string[0];
     width = 0;
     s->space = 0;
     while ( ch[0] &&
-#ifdef LCD_PROPFONTS
             (width + lcd_getstringsize(ch, 0, &w, &h) <
              (LCD_WIDTH - x*8))) {
-#else
-            (width + lcd_getstringsize(ch, _font, &w, &h) <
-             (LCD_WIDTH - x*8))) {
-#endif
         width += w;
         s->space++;
         ch[0]=string[s->space];
     }
-#else
-    s->space = (LCD_WIDTH - xmargin - x*width) / width;
-#endif
 #endif
 
     lcd_puts(x,y,string);
     s->textlen = strlen(string);
 
-
-#if defined(LCD_PROPFONTS)
+#ifdef HAVE_LCD_BITMAP
     s->space += 2;
     lcd_getstringsize(string,0,&w,&h);
     if ( w > LCD_WIDTH - xmargin ) {
-#elif defined(LOADABLE_FONTS)
-    s->space += 2;
-    lcd_getstringsize(string,_font,&w,&h);
-    if ( w > LCD_WIDTH - xmargin ) {
 #else
     if ( s->textlen > s->space ) {
 #endif
@@ -1344,32 +1077,24 @@
     }
 }
 
+
 void lcd_stop_scroll(void)
 {
     if ( scroll_count ) {
         struct scrollinfo* s = &scroll;
         scroll_count = 0;
-        
-#ifdef LCD_PROPFONTS
 
-        lcd_clearrect(xmargin + s->startx*fonts[font],
-                      ymargin + s->starty*fontheight[font],
-                      LCD_WIDTH - xmargin,
-                      fontheight[font]);
-
-#elif defined(LOADABLE_FONTS)
+#ifdef HAVE_LCD_BITMAP
         {
             int w,h;
-            lcd_getstringsize( s->text, _font, &w, &h);
+            /* FIXME no font index */
+            lcd_getstringsize( s->text, FONT_UI, &w, &h);
             lcd_clearrect(xmargin + s->startx*w/s->textlen,
                           ymargin + s->starty*h,
                           LCD_WIDTH - xmargin,
                           h);
-
         }
 #endif
-
-
         /* restore scrolled row */
         lcd_puts(s->startx,s->starty,s->text);
         lcd_update();
@@ -1420,20 +1145,16 @@
                     s->offset = 0;
             }
 
-#ifdef LCD_PROPFONTS
-            lcd_clearrect(xmargin + s->startx*fonts[font],
-                          ymargin + s->starty*fontheight[font],
-                          LCD_WIDTH - xmargin,
-                          fontheight[font]);
-#elif defined(LOADABLE_FONTS)
-            {
-                int w,h;
-                lcd_getstringsize( s->text, _font, &w, &h);
+#ifdef HAVE_LCD_BITMAP
+	    {
+	        /* FIXME no font index */
+		int w, h;
+                lcd_getstringsize( s->text, FONT_UI, &w, &h);
                 lcd_clearrect(xmargin + s->startx*w/s->textlen,
                               ymargin + s->starty*h,
                               LCD_WIDTH - xmargin,
                               h);
-            }
+	    }
 #endif
             lcd_puts(s->startx,s->starty,s->line);
             lcd_update();
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index 552de9a..23b3d75 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -101,7 +101,7 @@
 
 extern void lcd_putsxy(int x, int y, unsigned char *string, int font);
 extern void lcd_setfont(int font);
-extern void lcd_getfontsize(unsigned int font, int *width, int *height);
+extern void lcd_getfontsize(int font, int *width, int *height);
 extern void lcd_setmargins(int xmargin, int ymargin);
 extern int  lcd_getxmargin(void);
 extern int  lcd_getymargin(void);
@@ -119,19 +119,6 @@
 
 #endif /* CHARCELLS / BITMAP */
 
-#ifdef LOADABLE_FONTS
-extern int lcd_init_fonts(void);
-extern void lcd_putsldfxy(int x, int y, unsigned char *str);
-extern int lcd_getstringsize(unsigned char *str,
-                             unsigned char* font,
-                             int *w, int *h);
-extern void lcd_setldfont(unsigned char* f);
-
-extern unsigned char* lcd_getcurrentldfont(void);
-#endif
-
-#ifdef LCD_PROPFONTS
-extern int lcd_getstringsize(unsigned char *str, unsigned int font, int *w, int *h);
-#endif
+extern int lcd_getstringsize(unsigned char *str, int font, int *w, int *h);
 
 #endif /* __LCD_H__ */
diff --git a/firmware/font.c b/firmware/font.c
new file mode 100644
index 0000000..5bde2ff
--- /dev/null
+++ b/firmware/font.c
@@ -0,0 +1,228 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (c) 2002 by Greg Haerr <greg@censoft.com>
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+/*
+ * Rockbox startup font initialization
+ * This file specifies which fonts get compiled-in and
+ * loaded at startup, as well as their mapping into
+ * the FONT_SYSFIXED, FONT_UI and FONT_MP3 ids.
+ */
+#include "config.h"
+
+#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
+
+#include <stdio.h>
+#include <string.h>
+#include "lcd.h"
+#include "font.h"
+#include "debug.h"
+#include "panic.h"
+
+/* available compiled-in fonts*/
+extern MWCFONT font_X5x8;
+/*extern MWCFONT font_X6x9; */
+/*extern MWCFONT font_courB08; */
+/*extern MWCFONT font_timR08; */
+
+/* structure filled in by rbf_load_font*/
+static MWCFONT font_UI;
+
+/* system font table, in order of FONT_xxx definition*/
+struct corefont sysfonts[MAXFONTS] = {
+    { &font_X5x8, NULL 	        }, /* compiled-in FONT_SYSFIXED*/
+    { &font_UI,	  "/system.fnt"	}, /* loaded FONT_UI*/
+    { NULL,       NULL	        }, /* no FONT_MP3*/
+};
+
+void
+font_init(void)
+{
+    struct corefont *cfp;
+
+    for (cfp=sysfonts; cfp < &sysfonts[MAXFONTS]; ++cfp) {
+        if (cfp->pf && cfp->diskname) {
+            cfp->pf = rbf_load_font(cfp->diskname, cfp->pf);
+#if defined(DEBUG) || defined(SIMULATOR)
+            if (!cfp->pf)
+                DEBUGF("Font load failed: %s\n", cfp->diskname);
+#endif
+        }
+    }
+}
+
+/*
+ * Return a pointer to an incore font structure.
+ * If the requested font isn't loaded/compiled-in,
+ * decrement the font number and try again.
+ */
+PMWCFONT
+getfont(int font)
+{
+    PMWCFONT pf;
+
+    while (1) {
+        pf = sysfonts[font].pf;
+        if (pf && pf->height)
+            return pf;
+        if (--font < 0)
+            panicf("No font!");
+    }
+}
+
+/*
+ * Return width and height of a given font.
+ */
+void lcd_getfontsize(int font, int *width, int *height)
+{
+   PMWCFONT pf = getfont(font);
+
+   *width =  pf->maxwidth;
+   *height = pf->height;
+}
+
+/*
+ * Return width and height of a given font.
+ */
+//FIXME rename to font_gettextsize, add baseline
+int
+lcd_getstringsize(unsigned char *str, int font, int *w, int *h)
+{
+    PMWCFONT pf = getfont(font);
+    int ch;
+    int width = 0;
+
+    while((ch = *str++)) {
+
+	/* check input range*/
+	if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
+		ch = pf->defaultchar;
+	ch -= pf->firstchar;
+
+	/* get proportional width and glyph bits*/
+	width += pf->width? pf->width[ch]: pf->maxwidth;
+    }
+    *w = width;
+    *h = pf->height;
+
+    return width;
+}
+
+/*
+ * Take an MWIMAGEBITS bitmap and convert to Rockbox format.
+ * Used for converting font glyphs for the time being.
+ * Can use for standard X11 and Win32 images as well.
+ *
+ * Doing it this way keeps fonts in standard formats,
+ * as well as keeping Rockbox hw bitmap format.
+ */
+static void
+rotleft(unsigned char *dst, MWIMAGEBITS *src, unsigned int width,
+	unsigned int height)
+{
+    unsigned int i,j;
+    unsigned int dst_col = 0;		/* destination column*/
+    unsigned int dst_shift = 0;		/* destination shift amount*/
+    unsigned int dst_linelen;		/* # bytes per output row*/
+    unsigned int src_words;		/* # words of input image*/
+    
+    /* calc bytes per output row*/
+    dst_linelen = (height-1)/8+1;
+
+    /* calc words of input image*/
+    src_words = MWIMAGE_WORDS(width) * height;
+
+    /* clear background*/
+    memset(dst, 0, dst_linelen*height);
+
+    for (i=0; i < src_words; i++) {
+        MWIMAGEBITS srcmap;	/* current src input bit*/
+        MWIMAGEBITS dstmap;	/* current dst output bit*/
+        
+	/* calc src input bit*/
+	srcmap = 1 << (sizeof(MWIMAGEBITS)*8-1);
+
+	/* calc dst output bit*/
+        if (i>0 && (i%8==0)) {
+            ++dst_col;
+            dst_shift = 0;
+        }
+        dstmap = 1 << dst_shift++;
+
+	/* for each input column...*/
+        for(j=0; j < width; j++) {
+
+	    /* calc input bitmask*/
+            MWIMAGEBITS bit = srcmap >> j;
+            if (bit==0) {
+                srcmap = 1 << (sizeof(MWIMAGEBITS)*8-1);
+                bit = srcmap >> (j % 16);
+            }
+
+	    /* if set in input, set in rotated output*/
+	    if (bit & src[i]) {
+		/* input column j becomes output row*/
+                dst[j*dst_linelen + dst_col] |= dstmap;
+            }
+	    //printf((bit & src[i])? "*": ".");
+        }
+        //printf("\n");
+    }
+}
+
+/*
+ * Put a string at specified bit position
+ */
+//FIXME rename font_putsxy?
+void
+lcd_putsxy(int x, int y, unsigned char *str, int font)
+{
+    int ch;
+    unsigned char *src;
+    PMWCFONT pf = getfont(font);
+
+    while (((ch = *str++) != '\0')) {
+	MWIMAGEBITS *bits;
+	int width;
+	unsigned char outbuf[256];
+
+	/* check input range*/
+	if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
+		ch = pf->defaultchar;
+	ch -= pf->firstchar;
+
+	/* get proportional width and glyph bits*/
+	width = pf->width? pf->width[ch]: pf->maxwidth;
+        if(x + width > LCD_WIDTH)
+            break;
+	bits = pf->bits + (pf->offset? pf->offset[ch]: (pf->height * ch));
+
+	/* rotate left for lcd_bitmap function input*/
+	rotleft(outbuf, bits, width, pf->height);
+	src = outbuf;
+
+        lcd_bitmap (src, x, y, width, pf->height, true);
+        x += width;
+    }
+}
+#endif /* HAVE_LCD_BITMAP */
+
+/* -----------------------------------------------------------------
+ * local variables:
+ * eval: (load-file "rockbox-mode.el")
+ * end:
+ */
diff --git a/firmware/font.h b/firmware/font.h
new file mode 100644
index 0000000..13d60e5
--- /dev/null
+++ b/firmware/font.h
@@ -0,0 +1,126 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (c) 2002 by Greg Haerr <greg@censoft.com>
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+/*
+ * Incore font and image definitions
+ */
+#include "config.h"
+
+#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
+
+/* max static loadable fonts buffer*/
+#ifndef MAX_FONT_SIZE
+#define MAX_FONT_SIZE	9000	/* max total fontsize allocation*/
+#endif
+
+/*
+ * Fonts are specified by number, and used for display
+ * of menu information as well as mp3 filename data.
+ * At system startup, up to MAXFONTS fonts are initialized,
+ * either by being compiled-in, or loaded from disk.
+ * If the font asked for does not exist, then the
+ * system uses the next lower font number.  Font 0
+ * must be available at system startup.
+ * Fonts are specified in firmware/font.c.
+ */
+#define FONT_SYSFIXED	0	/* system fixed pitch font*/
+#define FONT_UI		1	/* system porportional font*/
+#define FONT_MP3	2	/* font used for mp3 info*/
+#define MAXFONTS	3	/* max # fonts*/
+
+/*
+ * .fnt (.rbf) loadable font file format definition
+ *
+ * format		      len	description
+ * -------------------------  ----	------------------------------
+ * UCHAR version[4]		4	magic number and version bytes
+ * UCHAR name[64]	       64	font name, space padded
+ * UCHAR copyright[256]	      256	copyright info, space padded
+ * USHORT maxwidth		2	font max width in pixels
+ * USHORT height		2	font height in pixels
+ * USHORT ascent		2	font ascent (baseline) in pixels
+ * ULONG firstchar		4	first character code in font
+ * ULONG defaultchar		4	default character code in font
+ * ULONG size			4	# characters in font
+ * ULONG nbits			4	# words imagebits data in file
+ * ULONG noffset		4	# longs offset data in file
+ * ULONG nwidth			4	# bytes width data in file
+ * MWIMAGEBITS bits	  nbits*2	image bits variable data
+ * ULONG offset         noffset*4	offset variable data
+ * UCHAR width		 nwidth*1	width variable data
+ */
+
+/* loadable font magic and version #*/
+#define VERSION		"RB10"
+
+/* MWIMAGEBITS helper macros*/
+#define MWIMAGE_WORDS(x)	(((x)+15)/16)	/* image size in words*/
+#define MWIMAGE_BYTES(x)	(((x)+7)/8)	/* image size in bytes*/
+#define	MWIMAGE_BITSPERIMAGE	(sizeof(MWIMAGEBITS) * 8)
+#define	MWIMAGE_BITVALUE(n)	((MWIMAGEBITS) (((MWIMAGEBITS) 1) << (n)))
+#define	MWIMAGE_FIRSTBIT	(MWIMAGE_BITVALUE(MWIMAGE_BITSPERIMAGE - 1))
+#define	MWIMAGE_TESTBIT(m)	((m) & MWIMAGE_FIRSTBIT)
+#define	MWIMAGE_SHIFTBIT(m)	((MWIMAGEBITS) ((m) << 1))
+
+typedef unsigned short	MWIMAGEBITS;	/* bitmap image unit size*/
+
+/* builtin C-based proportional/fixed font structure */
+/* based on The Microwindows Project http://microwindows.org */
+typedef struct {
+    char *	name;		/* font name*/
+    int		maxwidth;	/* max width in pixels*/
+    unsigned int height;	/* height in pixels*/
+    int		ascent;		/* ascent (baseline) height*/
+    int		firstchar;	/* first character in bitmap*/
+    int		size;		/* font size in glyphs*/
+    MWIMAGEBITS *bits;		/* 16-bit right-padded bitmap data*/
+    unsigned long *offset;	/* offsets into bitmap data*/
+    unsigned char *width;	/* character widths or NULL if fixed*/
+    int		defaultchar;	/* default char (not glyph index)*/
+    long	bits_size;	/* # words of MWIMAGEBITS bits*/
+#if 0
+    char *	facename;	/* facename of font*/
+    char *	copyright;	/* copyright info for loadable fonts*/
+#endif
+} MWCFONT, *PMWCFONT;
+
+/* structure for rockbox startup font selection*/
+struct corefont {
+    PMWCFONT pf;		/* compiled-in or loaded font*/
+    char *diskname;		/* diskname if not compiled-in*/
+};
+
+extern struct corefont sysfonts[MAXFONTS];
+
+/* font routines*/
+PMWCFONT getfont(int font);
+PMWCFONT rbf_load_font(char *path, PMWCFONT pf);
+
+void font_init(void);
+
+#else /* HAVE_LCD_BITMAP */
+
+#define font_init()
+
+#endif
+
+/* -----------------------------------------------------------------
+ * local variables:
+ * eval: (load-file "rockbox-mode.el")
+ * end:
+ */
diff --git a/firmware/loadfont.c b/firmware/loadfont.c
new file mode 100644
index 0000000..7f572a4
--- /dev/null
+++ b/firmware/loadfont.c
@@ -0,0 +1,202 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (c) 2002 by Greg Haerr <greg@censoft.com>
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+/*
+ * Load an rbf font, store in incore format.
+ */
+#include "config.h"
+
+#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
+
+#include <stdio.h>
+#include <string.h>
+#include "font.h"
+#include "file.h"
+
+#ifndef DEBUGF
+#include "debug.h"
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+/* static buffer allocation structures*/
+static unsigned char mbuf[MAX_FONT_SIZE];
+static unsigned char *freeptr = mbuf;
+typedef unsigned char CFILE;
+static CFILE *fileptr;
+static CFILE *eofptr;
+
+static int
+READSHORT(unsigned short *sp)
+{
+    unsigned short s;
+
+    s = *fileptr++ & 0xff;
+    *sp = (*fileptr++ << 8) | s;
+    return (fileptr <= eofptr);
+}
+
+static int
+READLONG(unsigned long *lp)
+{
+    unsigned long l;
+
+    l = *fileptr++ & 0xff;
+    l |= *fileptr++ << 8;
+    l |= *fileptr++ << 16;
+    *lp = (*fileptr++ << 24) | l;
+    return (fileptr <= eofptr);
+}
+
+/* read count bytes*/
+static int
+READSTR(char *buf, int count)
+{
+    int n = count;
+
+    while (--n >= 0)
+        *buf++ = *fileptr++;
+    return (fileptr <= eofptr)? count: 0;
+}
+
+/* read totlen bytes, return NUL terminated string*/
+/* may write 1 past buf[totlen]; removes blank pad*/
+static int
+READSTRPAD(char *buf, int totlen)
+{
+    char *p = buf;
+    int n = totlen;
+
+    while (--n >= 0)
+        *p++ = *fileptr++;
+    if (fileptr > eofptr)
+        return 0;
+
+    p = &buf[totlen];
+    *p-- = 0;
+    while (*p == ' ' && p >= buf)
+        *p-- = '\0';
+    return totlen;
+}
+
+/* read and load font into incore font structure*/
+PMWCFONT
+rbf_load_font(char *path, PMWCFONT pf)
+{
+    int fd, filesize;
+    unsigned short maxwidth, height, ascent;
+    unsigned long firstchar, defaultchar, size;
+    unsigned long nbits, noffset, nwidth;
+    char version[4+1];
+    char copyright[256+1];
+
+    memset(pf, 0, sizeof(MWCFONT));
+
+    /* open and read entire font file*/
+    fd = open(path, O_RDONLY|O_BINARY);
+    if (fd < 0) {
+        DEBUGF("Can't open font: %s\n", path);
+        return NULL;
+    }
+    fileptr = freeptr;
+    filesize = read(fd, fileptr, MAX_FONT_SIZE);
+    freeptr += filesize;
+    eofptr = fileptr + filesize;
+    close(fd);
+    if (filesize == MAX_FONT_SIZE) {
+        DEBUGF("Font %s too large: %d\n", path, filesize);
+        return NULL;
+    }
+
+    /* read magic and version #*/
+    memset(version, 0, sizeof(version));
+    if (READSTR(version, 4) != 4)
+        return NULL;
+    if (strcmp(version, VERSION) != 0)
+        return NULL;
+
+    /* internal font name*/
+    pf->name = fileptr;
+    if (READSTRPAD(pf->name, 64) != 64)
+        return NULL;
+
+    /* copyright, not currently stored*/
+    if (READSTRPAD(copyright, 256) != 256)
+        return NULL;
+
+    /* font info*/
+    if (!READSHORT(&maxwidth))
+        return NULL;
+    pf->maxwidth = maxwidth;
+    if (!READSHORT(&height))
+        return NULL;
+    pf->height = height;
+    if (!READSHORT(&ascent))
+        return NULL;
+    pf->ascent = ascent;
+    if (!READLONG(&firstchar))
+        return NULL;
+    pf->firstchar = firstchar;
+    if (!READLONG(&defaultchar))
+        return NULL;
+    pf->defaultchar = defaultchar;
+    if (!READLONG(&size))
+        return NULL;
+    pf->size = size;
+
+    /* get variable font data sizes*/
+    /* # words of MWIMAGEBITS*/
+    if (!READLONG(&nbits))
+        return NULL;
+    pf->bits_size = nbits;
+
+    /* # longs of offset*/
+    if (!READLONG(&noffset))
+        return NULL;
+
+    /* # bytes of width*/
+    if (!READLONG(&nwidth))
+        return NULL;
+
+    /* variable font data*/
+    pf->bits = (MWIMAGEBITS *)fileptr;
+    fileptr += nbits*sizeof(MWIMAGEBITS);
+
+    if (noffset) {
+        pf->offset = (unsigned long *)fileptr;
+        fileptr += noffset*sizeof(unsigned long);
+    } else pf->offset = NULL;
+
+    if (nwidth) {
+        pf->width = (unsigned char *)fileptr;
+        fileptr += noffset*sizeof(unsigned char);
+    } else pf->width = NULL;
+
+    if (fileptr > eofptr)
+        return NULL;
+    return pf;	/* success!*/
+}
+#endif /* HAVE_LCD_BITMAP */
+
+/* -----------------------------------------------------------------
+ * local variables:
+ * eval: (load-file "rockbox-mode.el")
+ * end:
+ */
diff --git a/firmware/panic.c b/firmware/panic.c
index b130482..10ff454 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -21,6 +21,7 @@
 #include <stdarg.h>
 #include "panic.h"
 #include "lcd.h"
+#include "font.h"
 #include "debug.h"
 
 static char panic_buf[128];
@@ -48,7 +49,9 @@
     lcd_puts(0,0,panic_buf);
 #elif defined(HAVE_LCD_BITMAP)
     lcd_clear_display();
-    lcd_putsxy(0,0,panic_buf,0);
+    
+    //FIXME putsxy may call panic...
+    lcd_putsxy(0,0,panic_buf,FONT_SYSFIXED);
     lcd_update();
 
 #else
diff --git a/firmware/unicode.c b/firmware/unicode.c
deleted file mode 100644
index 150dd51..0000000
--- a/firmware/unicode.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * $Id$
- *
- * Copyright (C) 2002 by Alex Gitelman
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#include "unicode.h"
-#include "string.h"
-
-#define MAX_TYPE 3
-
-unsigned char *conversion_table[255];
-unsigned char *reverse_conversion_table[255];
-
-static unsigned char page_04[] = { 
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
-    0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
-    0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
-    0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-};
-
-void install_unicode_tables(void)
-{
-    install_conversion_table(0x04, page_04);
-}
-
-void unicode_init(void)
-{
-    memset(conversion_table, 0, sizeof(conversion_table));
-    memset(reverse_conversion_table, 0, sizeof(reverse_conversion_table));
-    install_unicode_tables();
-}
-
-/**
-Convertion table defines how chars in ing given page map to ascii
-*/
-void install_conversion_table(unsigned char page, unsigned char* conv_table)
-{
-    if (conv_table!=0)
-        conversion_table[page] = conv_table;
-    else
-        conversion_table[page] = 0;
-}
-
-void install_reverse_conversion_table(unsigned char page, 
-                                      unsigned char* rev_conv_table)
-{
-    if (rev_conv_table!=0)
-        reverse_conversion_table[page] = rev_conv_table;
-    else
-        reverse_conversion_table[page] = 0;
-}
-
-
-unsigned char from_unicode(const unsigned char *uni_char)
-{
-    /*
-       Here we should get proper code page conversions. 
-       For now hack for Cyrrilic->Unicode
-    */
-    unsigned char *table = conversion_table[uni_char[0]];
-    if (table!=0)
-        return table[uni_char[1]];
-    /* If page is not present -> no conversion */
-    return uni_char[1];
-
-}
-
-void to_unicode(unsigned char c, unsigned char page, unsigned char *uni_char)
-{
-    unsigned char *table = reverse_conversion_table[page];
-    if (table!=0)
-        uni_char[1] = table[c];
-    else
-        uni_char[1] = c;
-    uni_char[0] = page;
-}
diff --git a/firmware/unicode.h b/firmware/unicode.h
deleted file mode 100644
index dfb4daa..0000000
--- a/firmware/unicode.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
- *                     \/            \/     \/    \/            \/
- * $Id$
- *
- * Copyright (C) 2002 by Alex Gitelman
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#ifndef __UNICODE__
-#define __UNICODE__
-
-unsigned char from_unicode(const unsigned char *uni_char);
-void to_unicode(unsigned char c, unsigned char page, unsigned char *uni_char);
-/* Unicode -> ASCII */
-void install_conversion_table(unsigned char page, unsigned char* conv_table);
-/* ASCII -> Unicode */
-void install_reverse_conversion_table(unsigned char page, 
-                                      unsigned char* rev_conv_table);
-void unicode_init(void);
-
-/* Unicode main init point. Here we must read conversion 
-   tables and install them */
-void install_unicode_tables(void);
-
-
-#endif
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile
index d2b109e..c6f86d4 100644
--- a/uisimulator/x11/Makefile
+++ b/uisimulator/x11/Makefile
@@ -76,13 +76,8 @@
 
 APPCFLAGS = $(DEBUG) $(DEFINES) -DAPPSVERSION=\"$(VERSION)\" $(APPINCLUDES) -W -Wall
 
-FIRMSRCS = chartables.c lcd.c sprintf.c id3.c debug.c usb.c mpeg.c power.c powermgmt.c 
-
-ifeq (LOADABLE_FONTS,$(findstring LOADABLE_FONTS, $(DEFINES)))
-	FIRMSRCS += unicode.c ajf.c panic.c
-	EXTRA_TARGETS = $(OBJDIR)/archos/system.ajf
-	SYSTEM_FONT = $(FIRMWAREDIR)/fonts/alt6x10.bdf
-endif
+FIRMSRCS = chartables.c lcd.c sprintf.c id3.c debug.c usb.c mpeg.c power.c\
+  powermgmt.c font.c X5x8.c loadfont.c panic.c
 
 APPS = main.c tree.c menu.c credits.c main_menu.c\
 	playlist.c showtext.c wps.c wps-display.c settings.c status.c icons.c
@@ -110,9 +105,6 @@
 	$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS)
 	$(RM) -r $(DEPS)
 
-$(OBJDIR)/archos/system.ajf: $(TOOLSDIR)/bdf2ajf $(SYSTEM_FONT)
-	$(TOOLSDIR)/bdf2ajf -f $(SYSTEM_FONT) -o $(OBJDIR)/archos/system.ajf
-
 distclean: clean
 	$(RM) config.cache
 
@@ -227,6 +219,24 @@
 $(OBJDIR)/chartables.o: $(FIRMWAREDIR)/chartables.c
 	$(CC) $(APPCFLAGS) -c $< -o $@
 
+$(OBJDIR)/X5x8.o: $(FIRMWAREDIR)/X5x8.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
+$(OBJDIR)/X6x9.o: $(FIRMWAREDIR)/X6x9.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
+$(OBJDIR)/timR08.o: $(FIRMWAREDIR)/timR08.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
+$(OBJDIR)/courB08.o: $(FIRMWAREDIR)/courB08.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
+$(OBJDIR)/font.o: $(FIRMWAREDIR)/font.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
+$(OBJDIR)/loadfont.o: $(FIRMWAREDIR)/loadfont.c
+	$(CC) $(APPCFLAGS) -c $< -o $@
+
 $(OBJDIR)/settings.o: $(APPDIR)/settings.c
 	$(CC) $(APPCFLAGS) -c $< -o $@
 
diff --git a/uisimulator/x11/uibasic.c b/uisimulator/x11/uibasic.c
index 165b1ce..2eac2f8 100644
--- a/uisimulator/x11/uibasic.c
+++ b/uisimulator/x11/uibasic.c
@@ -198,6 +198,7 @@
   screen_redraw();
 
 #ifdef HAVE_LCD_CHARCELLS
+  // FIXME??
   lcd_setfont(2);
 #endif