gRow = 0;
gColumn = 45;
for (i=0; i<strlen(MainMessage); i++) {
+ // do not draw a whitespace as first character of a row
if (gRow == 0 && MainMessage[i] == ' ')
continue;
+ // interpret new line
+ if (MainMessage[i] == '\n') {
+ gRow = 0;
+ gColumn += 9;
+ continue;
+ }
gRow += oswald_write_character(gRow, gColumn, FONT_DROID8x12, FALSE, MainMessage[i]);
+ // wrap to new line if line is full
if (gRow > 90) {
gRow = 0;
gColumn += 9;
}
+ // OK, screen ends, leave the loop, no matter what
if (gColumn > 86)
i = 255;
}