diff options
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; } } |