summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-12 13:33:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-12 13:33:59 +0000
commit93b231c69366563ba441dc4907bfb036fe3b4c55 (patch)
tree0783ad028211f59e63925a354e4260a7209ffa24 /apps
parent5ed78ea80cdaa0ede4df89568f0781fa477a5738 (diff)
downloadrockbox-93b231c69366563ba441dc4907bfb036fe3b4c55.tar.gz
rockbox-93b231c69366563ba441dc4907bfb036fe3b4c55.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/credits.c8
-rw-r--r--apps/main.c17
-rw-r--r--apps/main_menu.c5
-rw-r--r--apps/menu.c39
-rw-r--r--apps/recorder/bounce.c1
-rw-r--r--apps/recorder/icons.c23
-rw-r--r--apps/recorder/wormlet.c4
-rw-r--r--apps/settings.c107
-rw-r--r--apps/tree.c36
-rw-r--r--apps/wps-display.c20
-rw-r--r--apps/wps.c46
11 files changed, 80 insertions, 226 deletions
diff --git a/apps/credits.c b/apps/credits.c
index f3bbd5992b..f8b060f31c 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 @@ char* credits[] = {
"Chad Lockwood",
"John Pybus",
"Randy Wood",
+ "Gregory Haerr",
};
#ifdef HAVE_LCD_BITMAP
@@ -111,15 +113,15 @@ void roll_credits(void)
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 22fd8f6051..4b8c9e1e7e 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 app_main(void)
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 @@ void init(void)
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 @@ void init(void)
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 464b514bc3..8c0b6a01f3 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 @@ int show_logo( void )
#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 f690a1a381..dd5b9ba1e8 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 @@ struct menu {
#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 @@ struct menu {
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 @@ void put_cursorxy(int x, int y, bool on)
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 @@ static void menu_draw(int m)
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 menu_draw(int m)
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 96291066e5..999ba47366 100644
--- a/apps/recorder/bounce.c
+++ b/apps/recorder/bounce.c
@@ -136,7 +136,6 @@ static void loopit(void)
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 0501a3f0c0..fbfaf6cd8c 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 @@ void statusbar_icon_volume(int percent)
/* 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 @@ void statusbar_time(int hour, int minute)
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 ba96f6b9de..84ee55062c 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 a1bbe4a3db..ce2b28f16b 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 @@ void set_time(char* string, int timedate[])
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 @@ void set_time(char* string, int timedate[])
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 @@ void set_time(char* string, int timedate[])
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 @@ void set_time(char* string, int timedate[])
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 @@ void set_time(char* string, int timedate[])
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 47853f03c9..21aa78c74d 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 @@ static int showdir(char *path, int start)
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 @@ static int showdir(char *path, int start)
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 dirbrowse(char *root)
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 @@ bool dirbrowse(char *root)
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 @@ bool dirbrowse(char *root)
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 @@ bool dirbrowse(char *root)
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 5d6290d244..8d33c723a4 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 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_all)
#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 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_all)
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 4ac2476da7..d10eb92655 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 @@ bool f2_screen(void)
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 @@ bool f2_screen(void)
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 @@ bool f3_screen(void)
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();