diff options
-rw-r--r-- | firmware/drivers/lcd.c | 12 | ||||
-rw-r--r-- | firmware/drivers/lcd.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index 4f5a4c2dbb..e2abe08e13 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c @@ -382,6 +382,7 @@ static unsigned char zeros[] = { 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 @@ -665,6 +666,17 @@ void lcd_clearpixel(int x, int y) CLEAR_PIXEL(x,y); } +/* + * Return width and height of a given font. + */ +void lcd_fontsize(char font, char *width, char *height) +{ + if(font < sizeof(fonts)) { + *width = fonts[font]; + *height = fontheight[font]; + } +} + #else /* no LCD defined, no code to use */ #endif diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h index aacd234dc7..3694ac72a9 100644 --- a/firmware/drivers/lcd.h +++ b/firmware/drivers/lcd.h @@ -79,6 +79,8 @@ extern void lcd_drawline( int x1, int y1, int x2, int y2 ); extern void lcd_drawpixel(int x, int y); extern void lcd_clearpixel(int x, int y); +void lcd_fontsize(char font, char *width, char *height); + #endif /* CHARCELLS / BITMAP */ #endif /* __LCD_H__ */ |