diff options
author | jaseg <jaseg@jaseg.net> | 2014-01-03 02:15:58 +0100 |
---|---|---|
committer | jaseg <jaseg@jaseg.net> | 2014-01-03 02:15:58 +0100 |
commit | 2fcc915da9e1ca0788424511f359c74231fedcc7 (patch) | |
tree | d72963ba719836aeb1a8dfec77835aba8819658c /host/matelight/font.c | |
parent | 916aced1bef07001ef4eee2a1cde6cd6e33b4bc3 (diff) | |
download | matelight-2fcc915da9e1ca0788424511f359c74231fedcc7.tar.gz matelight-2fcc915da9e1ca0788424511f359c74231fedcc7.tar.bz2 matelight-2fcc915da9e1ca0788424511f359c74231fedcc7.zip |
Fixed font rnedering and width computation
Diffstat (limited to 'host/matelight/font.c')
-rw-r--r-- | host/matelight/font.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |