Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: apps credits.c,1.26,1.27 main.c,1.52,1.53 main_menu.c,1.57,1.58 menu.c,1.40,1.41 settings.c,1.53,1.54 tree.c,1.120,1.121 wps-display.c,1.18,1.19 wps.c,1.142,1.143

Re: apps credits.c,1.26,1.27 main.c,1.52,1.53 main_menu.c,1.57,1.58 menu.c,1.40,1.41 settings.c,1.53,1.54 tree.c,1.120,1.121 wps-display.c,1.18,1.19 wps.c,1.142,1.143

From: George Styles <george_at_ripnet.co.uk>
Date: Thu, 12 Sep 2002 14:46:33 +0100

Is this new font format proportinal? if not, haev you completely removed
support for proportinal fonts for now?

cheers

g

----- Original Message -----
From: "Daniel Stenberg" <bagder_at_users.sourceforge.net>
To: <rockbox-cvs_at_cool.haxx.se>
Sent: Thursday, September 12, 2002 2:34 PM
Subject: cvs: apps credits.c,1.26,1.27 main.c,1.52,1.53
main_menu.c,1.57,1.58 menu.c,1.40,1.41 settings.c,1.53,1.54
tree.c,1.120,1.121 wps-display.c,1.18,1.19 wps.c,1.142,1.143


> Update of /cvsroot/rockbox/apps
> In directory usw-pr-cvs1:/tmp/cvs-serv31384/apps
>
> Modified Files:
> credits.c main.c main_menu.c menu.c settings.c tree.c
> wps-display.c wps.c
> Log Message:
> Greg Haerr's new loadable font. No more #ifdef font-style, removed old
> propfont and loadable font code. New font file format.
>
>
> Index: credits.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/credits.c,v
> retrieving revision 1.26
> retrieving revision 1.27
> diff -u -b -r1.26 -r1.27
> --- credits.c 6 Sep 2002 09:08:10 -0000 1.26
> +++ credits.c 12 Sep 2002 13:33:57 -0000 1.27
> _at__at_ -19,6 +19,7 _at__at_
>
> #include "credits.h"
> #include "lcd.h"
> +#include "font.h"
> #include "kernel.h"
> #include "button.h"
> #include "sprintf.h"
> _at__at_ -64,6 +65,7 _at__at_
> "Chad Lockwood",
> "John Pybus",
> "Randy Wood",
> + "Gregory Haerr",
> };
>
> #ifdef HAVE_LCD_BITMAP
> _at__at_ -111,15 +113,15 _at__at_
> 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))
>
> Index: main.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/main.c,v
> retrieving revision 1.52
> retrieving revision 1.53
> diff -u -b -r1.52 -r1.53
> --- main.c 16 Aug 2002 14:14:37 -0000 1.52
> +++ main.c 12 Sep 2002 13:33:57 -0000 1.53
> _at__at_ -45,9 +45,7 _at__at_
> #include "debug_menu.h"
> #include "version.h"
> #include "sprintf.h"
> -#ifdef LOADABLE_FONTS
> -#include "unicode.h"
> -#endif
> +#include "font.h"
>
>
> char appsversion[]=APPSVERSION;
> _at__at_ -65,10 +63,8 _at__at_
> void init(void)
> {
> init_threads();
> -#ifdef LOADABLE_FONTS
> - unicode_init();
> -#endif
> lcd_init();
> + font_init();
> show_logo();
> settings_reset();
> settings_load();
> _at__at_ -93,6 +89,10 _at__at_
>
> 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
> _at__at_ -160,10 +160,7 _at__at_
> status_init();
> usb_start_monitoring();
> power_init();
> -#ifdef LOADABLE_FONTS
> - unicode_init();
> - lcd_init_fonts();
> -#endif
> + font_init();
> }
>
> int main(void)
>
> Index: main_menu.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/main_menu.c,v
> retrieving revision 1.57
> retrieving revision 1.58
> diff -u -b -r1.57 -r1.58
> --- main_menu.c 6 Sep 2002 22:28:28 -0000 1.57
> +++ main_menu.c 12 Sep 2002 13:33:57 -0000 1.58
> _at__at_ -23,6 +23,7 _at__at_
> #include "tree.h"
> #include "credits.h"
> #include "lcd.h"
> +#include "font.h"
> #include "button.h"
> #include "kernel.h"
> #include "main_menu.h"
> _at__at_ -96,9 +97,9 _at__at_
> #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
>
> Index: menu.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/menu.c,v
> retrieving revision 1.40
> retrieving revision 1.41
> diff -u -b -r1.40 -r1.41
> --- menu.c 9 Sep 2002 23:57:00 -0000 1.40
> +++ menu.c 12 Sep 2002 13:33:57 -0000 1.41
> _at__at_ -19,6 +19,7 _at__at_
> #include <stdbool.h>
>
> #include "lcd.h"
> +#include "font.h"
> #include "backlight.h"
> #include "menu.h"
> #include "button.h"
> _at__at_ -34,10 +35,6 _at__at_
> #include "widgets.h"
> #endif
>
> -#ifdef LOADABLE_FONTS
> -#include "ajf.h"
> -#endif
> -
> struct menu {
> int top;
> int cursor;
> _at__at_ -54,8 +51,10 _at__at_
>
> #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)
> _at__at_ -89,17 +88,12 _at__at_
> 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 */
> _at__at_ -131,11 +125,10 _at__at_
> 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
> _at__at_ -148,7 +141,7 _at__at_
> 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)
> _at__at_ -182,18 +175,18 _at__at_
> 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);
>
> Index: settings.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/settings.c,v
> retrieving revision 1.53
> retrieving revision 1.54
> diff -u -b -r1.53 -r1.54
> --- settings.c 10 Sep 2002 05:31:12 -0000 1.53
> +++ settings.c 12 Sep 2002 13:33:57 -0000 1.54
> _at__at_ -40,6 +40,7 _at__at_
> #include "atoi.h"
> #ifdef HAVE_LCD_BITMAP
> #include "icons.h"
> +#include "font.h"
> #endif
>
> struct user_settings global_settings;
> _at__at_ -772,15 +773,10 _at__at_
> 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)
> _at__at_ -817,65 +813,35 _at__at_
> 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]],
> _at__at_ -883,24 +849,24 _at__at_
> 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;
> _at__at_ -908,7 +874,7 _at__at_
>
> 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;
> _at__at_ -919,48 +885,7 _at__at_
> 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
>
> Index: tree.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/tree.c,v
> retrieving revision 1.120
> retrieving revision 1.121
> diff -u -b -r1.120 -r1.121
> --- tree.c 9 Sep 2002 17:32:15 -0000 1.120
> +++ tree.c 12 Sep 2002 13:33:58 -0000 1.121
> _at__at_ -26,6 +26,7 _at__at_
> #include "dir.h"
> #include "file.h"
> #include "lcd.h"
> +#include "font.h"
> #include "backlight.h"
> #include "button.h"
> #include "kernel.h"
> _at__at_ -49,10 +50,6 _at__at_
> #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];
> _at__at_ -190,17 +187,16 _at__at_
> 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);
> _at__at_ -339,7 +335,7 _at__at_
> 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++ ) {
> _at__at_ -573,10 +569,9 _at__at_
> 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;
> _at__at_ -743,10 +738,8 _at__at_
> 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
> }
> }
> _at__at_ -836,10 +829,8 _at__at_
> 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;
> }
> _at__at_ -855,10 +846,9 _at__at_
> 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;
>
> Index: wps-display.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/wps-display.c,v
> retrieving revision 1.18
> retrieving revision 1.19
> diff -u -b -r1.18 -r1.19
> --- wps-display.c 7 Sep 2002 12:34:10 -0000 1.18
> +++ wps-display.c 12 Sep 2002 13:33:58 -0000 1.19
> _at__at_ -27,6 +27,7 _at__at_
> #include <stdlib.h>
>
> #include "lcd.h"
> +#include "font.h"
> #include "mpeg.h"
> #include "id3.h"
> #include "settings.h"
> _at__at_ -42,10 +43,6 _at__at_
> #include "widgets.h"
> #endif
>
> -#ifdef LOADABLE_FONTS
> -#include "ajf.h"
> -#endif
> -
> #define WPS_CONFIG ROCKBOX_DIR "/default.wps"
>
> #ifdef HAVE_LCD_BITMAP
> _at__at_ -551,11 +548,7 _at__at_
> #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);
> _at__at_ -581,15 +574,6 _at__at_
>
> 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())
>
> Index: wps.c
> ===================================================================
> RCS file: /cvsroot/rockbox/apps/wps.c,v
> retrieving revision 1.142
> retrieving revision 1.143
> diff -u -b -r1.142 -r1.143
> --- wps.c 9 Sep 2002 23:18:44 -0000 1.142
> +++ wps.c 12 Sep 2002 13:33:58 -0000 1.143
> _at__at_ -22,6 +22,7 _at__at_
>
> #include "file.h"
> #include "lcd.h"
> +#include "font.h"
> #include "backlight.h"
> #include "button.h"
> #include "kernel.h"
> _at__at_ -40,10 +41,6 _at__at_
> #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 */
>
> _at__at_ -634,21 +631,17 _at__at_
> 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);
>
> _at__at_ -656,13 +649,8 _at__at_
> 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);
>
> _at__at_ -717,26 +705,20 _at__at_
> 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();
>
>
Received on 2002-09-12

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy