diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-06-20 08:20:12 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-06-20 08:20:12 +0000 |
commit | 9468e1b93ed9b724f5a3ceb7b3d543b965fbf6ec (patch) | |
tree | 169b9428ecebb7e6bbe0cb600bdf0be729f98c47 /firmware/drivers/lcd.c | |
parent | f855a5797693f264dfe063565f441ee103e8393c (diff) | |
download | rockbox-9468e1b93ed9b724f5a3ceb7b3d543b965fbf6ec.tar.gz rockbox-9468e1b93ed9b724f5a3ceb7b3d543b965fbf6ec.zip |
Magnus Oman brought a test set proportional font
#define LCD_PROPFONTS to try
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1112 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd.c')
-rw-r--r-- | firmware/drivers/lcd.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index 9ed24fdb22..d09d7ed1a5 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c | |||
@@ -488,6 +488,50 @@ void lcd_setmargins(int x, int y) | |||
488 | ymargin = y; | 488 | ymargin = y; |
489 | } | 489 | } |
490 | 490 | ||
491 | #ifdef LCD_PROPFONTS | ||
492 | |||
493 | extern unsigned char char_dw_8x8_prop[][9]; | ||
494 | |||
495 | /* | ||
496 | * Put a string at specified bit position | ||
497 | */ | ||
498 | |||
499 | void lcd_putspropxy(int x, int y, char *str, int thisfont) | ||
500 | { | ||
501 | int ch; | ||
502 | int nx; | ||
503 | int ny=8; | ||
504 | unsigned char *src; | ||
505 | int lcd_x = x; | ||
506 | int lcd_y = y; | ||
507 | |||
508 | (void)thisfont; | ||
509 | |||
510 | while (((ch = *str++) != '\0') && (lcd_x + nx < LCD_WIDTH)) | ||
511 | { | ||
512 | if (lcd_y + ny > LCD_HEIGHT) | ||
513 | return; | ||
514 | |||
515 | /* Limit to char generation table */ | ||
516 | if ((ch < ASCII_MIN) || (ch > 0x7a)) | ||
517 | /* replace unsupported letters with question marks */ | ||
518 | ch = ' '-ASCII_MIN; | ||
519 | else | ||
520 | ch -= ASCII_MIN; | ||
521 | |||
522 | src = char_dw_8x8_prop[ch]; | ||
523 | |||
524 | nx = char_dw_8x8_prop[ch][8] >> 4; | ||
525 | |||
526 | lcd_bitmap (src, lcd_x, lcd_y, nx, ny, true); | ||
527 | |||
528 | lcd_x += nx+1; | ||
529 | |||
530 | } | ||
531 | } | ||
532 | |||
533 | #endif | ||
534 | |||
491 | /* | 535 | /* |
492 | * Put a string at specified character position | 536 | * Put a string at specified character position |
493 | */ | 537 | */ |
@@ -507,9 +551,15 @@ void lcd_puts(int x, int y, char *str) | |||
507 | ymargin = 8; | 551 | ymargin = 8; |
508 | #endif | 552 | #endif |
509 | 553 | ||
554 | #ifdef LCD_PROPFONTS | ||
555 | lcd_putspropxy( xmargin + x*fonts[font], | ||
556 | ymargin + y*fontheight[font], | ||
557 | str, font ); | ||
558 | #else | ||
510 | lcd_putsxy( xmargin + x*fonts[font], | 559 | lcd_putsxy( xmargin + x*fonts[font], |
511 | ymargin + y*fontheight[font], | 560 | ymargin + y*fontheight[font], |
512 | str, font ); | 561 | str, font ); |
562 | #endif | ||
513 | #if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS) | 563 | #if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS) |
514 | /* this function is being used when simulating a charcell LCD and | 564 | /* this function is being used when simulating a charcell LCD and |
515 | then we update immediately */ | 565 | then we update immediately */ |
@@ -517,6 +567,7 @@ void lcd_puts(int x, int y, char *str) | |||
517 | #endif | 567 | #endif |
518 | } | 568 | } |
519 | 569 | ||
570 | |||
520 | /* | 571 | /* |
521 | * Put a string at specified bit position | 572 | * Put a string at specified bit position |
522 | */ | 573 | */ |