forked from len0rd/rockbox
Added lcd_fontsize() that returns the size of a given font
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@360 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fda07efa45
commit
0b81b35b7a
2 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue