From 2fcc915da9e1ca0788424511f359c74231fedcc7 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 3 Jan 2014 02:15:58 +0100 Subject: Fixed font rnedering and width computation --- host/matelight/font.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'host/matelight/font.c') diff --git a/host/matelight/font.c b/host/matelight/font.c index f22f05b..725e039 100644 --- a/host/matelight/font.c +++ b/host/matelight/font.c @@ -14,10 +14,11 @@ void render_glyph(glyph_t *g, uint8_t *buf, unsigned int bufwidth, unsigned int data <<= 8; data |= bitmap[y*bitmap_row_width+i]; } - uint8_t *p = buf + (offy+y)*bufwidth + offx; + uint8_t *p = buf + ((offy+y)*bufwidth + offx)*3; for(unsigned int x=0; x < g->width; x++){ color_t c = (data&(1<<(g->width-1))) ? fg : bg; - *((color_t *)(p++)) = c; + *((color_t *)p) = c; + p += 3; data <<= 1; } } -- cgit