summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2005-04-19 12:50:02 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2005-04-19 12:50:02 +0000
commitc3d0a229ccd859853641d7ee01e7c5c30045159c (patch)
tree35c09b701ce7b0565d2bc11d0589b4061a15bdb6
parentc6ec0f48a5999c4456439eb4e0b54467b464ed02 (diff)
downloadrockbox-c3d0a229ccd859853641d7ee01e7c5c30045159c.zip
rockbox-c3d0a229ccd859853641d7ee01e7c5c30045159c.tar.gz
rockbox-c3d0a229ccd859853641d7ee01e7c5c30045159c.tar.bz2
rockbox-c3d0a229ccd859853641d7ee01e7c5c30045159c.tar.xz
make use of font_getstringsize
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6322 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-recorder.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index be46d0e..ea28e5c 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -367,24 +367,7 @@ void lcd_setfont(int newfont)
int lcd_getstringsize(const unsigned char *str, int *w, int *h)
{
- struct font* pf = font_get(curfont);
- int ch;
- int width = 0;
-
- while((ch = *str++)) {
- /* check input range*/
- if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
- ch = pf->defaultchar;
- ch -= pf->firstchar;
-
- /* get proportional width and glyph bits*/
- width += pf->width? pf->width[ch]: pf->maxwidth;
- }
- if ( w )
- *w = width;
- if ( h )
- *h = pf->height;
- return width;
+ return font_getstringsize(str, w, h, curfont);
}
/* put a string at a given char position */