summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-06-24 07:38:27 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-06-24 07:38:27 +0000
commitc66efb702eefd0610ffd08fbc09ab4e542407de1 (patch)
tree5f6991cf944846c220778d97b65bd642ec45b47d /firmware
parent4acb1a30837e76652ca0480534fd27fbf190478f (diff)
downloadrockbox-c66efb702eefd0610ffd08fbc09ab4e542407de1.zip
rockbox-c66efb702eefd0610ffd08fbc09ab4e542407de1.tar.gz
rockbox-c66efb702eefd0610ffd08fbc09ab4e542407de1.tar.bz2
rockbox-c66efb702eefd0610ffd08fbc09ab4e542407de1.tar.xz
more proportional font fixes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1137 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index be71c25..352de74 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -504,7 +504,7 @@ int lcd_getstringsize(char *str, unsigned int font, int *w, int *h)
while((ch = *str++)) {
/* Limit to char generation table */
- if ((ch < ASCII_MIN) || (ch > 0xda))
+ if (ch < ASCII_MIN)
/* replace unsupported letters with question marks */
ch = ' '-ASCII_MIN;
else
@@ -526,10 +526,10 @@ int lcd_getstringsize(char *str, unsigned int font, int *w, int *h)
* Put a string at specified bit position
*/
-void lcd_putspropxy(int x, int y, char *str, int thisfont)
+void lcd_putspropxy(int x, int y, unsigned char *str, int thisfont)
{
- int ch;
- int nx = char_dw_8x8_prop[(int)*str][8] >> 4;
+ unsigned int ch;
+ int nx;
int ny=8;
unsigned char *src;
int lcd_x = x;
@@ -537,26 +537,24 @@ void lcd_putspropxy(int x, int y, char *str, int thisfont)
(void)thisfont;
- while (((ch = *str++) != '\0') && (lcd_x + nx < LCD_WIDTH))
+ while (((ch = *str++) != '\0'))
{
- if (lcd_y + ny > LCD_HEIGHT)
- return;
-
/* Limit to char generation table */
- if ((ch < ASCII_MIN) || (ch > 0xda))
+ if (ch < ASCII_MIN)
/* replace unsupported letters with question marks */
ch = ' '-ASCII_MIN;
else
ch -= ASCII_MIN;
- src = char_dw_8x8_prop[ch];
-
nx = char_dw_8x8_prop[ch][8] >> 4;
-
+
+ if(lcd_x + nx > LCD_WIDTH)
+ break;
+
+ src = char_dw_8x8_prop[ch];
lcd_bitmap (src, lcd_x, lcd_y, nx, ny, true);
lcd_x += nx+1;
-
}
}
@@ -933,10 +931,10 @@ void lcd_puts_scroll(int x, int y, char* string )
ch[0] = string[0];
width = 0;
for (s->space = 0;
- string[(int)s->space] &&
+ ch[0] &&
(width + lcd_getstringsize(ch, 0, &w, &h) < (LCD_WIDTH - x*8));
) {
- width += lcd_getstringsize(ch, 0, &w, &h);
+ width += w;
ch[0]=string[(int)++s->space];
}
#endif