21 unsigned int textsize, textcolor, textbgcolor;
22 int _width, _height, cursor_x, cursor_y;
25 void oledc_write(
char c) {
27 cursor_y += textsize * 8;
29 }
else if (c ==
'\r') {
32 if (wrap && ((cursor_x + textsize * 6) > _width)) {
34 cursor_y += textsize * 8;
36 if (wrap && ((cursor_y + textsize * 8) > _height)) {
40 if (c < 32 || c > 126)
42 if (textcolor != textbgcolor) oledc_fillRect(cursor_x, cursor_y, textsize * 6, textsize * 8, textbgcolor);
43 oledc_drawRect(cursor_x + 1, cursor_y + 1, textsize * 6 - 2, textsize * 8 - 2, textcolor);
44 if (textsize > 1) oledc_drawRect(cursor_x + 2, cursor_y + 2, textsize * 6 - 4, textsize * 8 - 4, textcolor);
45 if (textsize > 2) oledc_drawRect(cursor_x + 3, cursor_y + 3, textsize * 6 - 6, textsize * 8 - 6, textcolor);
49 if ((cursor_x >= _width) ||
50 (cursor_y >= _height) ||
51 ((cursor_x + 6 * textsize - 1) < 0) ||
52 ((cursor_y + 8 * textsize - 1) < 0))
57 if (textcolor != textbgcolor) oledc_fillRect(cursor_x, cursor_y, textsize * 6, textsize * 8 + 1, textbgcolor);
59 if (textsize == 1) oledc_drawCharSmall(cursor_x, cursor_y, c, textcolor, textbgcolor);
61 if (textsize == 2) oledc_drawCharMedium(cursor_x, cursor_y, c, textcolor, textbgcolor);
64 if (textsize == 3) oledc_drawCharLarge(cursor_x, cursor_y, c, textcolor, textbgcolor);
68 cursor_x += textsize * 6;