- for (i = 0; i < 8 && (row * 8) + i < glyph_height; ++i)
- BM_DRAWPIXEL(bm, bm->penX + col, bm->penY + row * 8 + i, dots & (1<<i));
+ #if CONFIG_TEXT_RENDER_OPTIMIZE
+ render_buf[render_xpos++] = dots;
+ if (render_xpos == RENDER_BUF_WIDTH)
+ {
+ gfx_blitRaster(bm, bm->penX + col - render_xpos + 1, bm->penY + row_bit,
+ render_buf, render_xpos,
+ MIN((uint8_t)RENDER_BUF_HEIGHT, (uint8_t)(glyph_height - row_bit)),
+ RENDER_BUF_WIDTH);
+ render_xpos = 0;
+ }
+ #else
+ gfx_blitRaster(bm, bm->penX + col, bm->penY + row_bit,
+ &dots, 1, MIN((uint8_t)8, glyph_height - row_bit), 1);
+ #endif