update TinyFont lib
This commit is contained in:
parent
eb15a8bec5
commit
83201ca4dd
|
@ -1,4 +1,4 @@
|
||||||
https://github.com/yinkou/Arduboy-TinyFont
|
# https://github.com/yinkou/Arduboy-TinyFont
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Datatypes (KEYWORD1)
|
# Datatypes (KEYWORD1)
|
||||||
|
|
|
@ -20,6 +20,7 @@ Tinyfont::Tinyfont(uint8_t *screenBuffer, int16_t width, int16_t height){
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Tinyfont::write(uint8_t c) {
|
size_t Tinyfont::write(uint8_t c) {
|
||||||
|
// check \n
|
||||||
if(c == '\n'){
|
if(c == '\n'){
|
||||||
cursorX = baseX; // cr
|
cursorX = baseX; // cr
|
||||||
cursorY += lineHeight; // lf
|
cursorY += lineHeight; // lf
|
||||||
|
@ -28,11 +29,6 @@ size_t Tinyfont::write(uint8_t c) {
|
||||||
else if(c == '\t'){
|
else if(c == '\t'){
|
||||||
cursorX += TINYFONT_WIDTH + 5;
|
cursorX += TINYFONT_WIDTH + 5;
|
||||||
}
|
}
|
||||||
// check \n
|
|
||||||
else if (c == '\n') {
|
|
||||||
cursorX = baseX;
|
|
||||||
cursorY += lineHeight;
|
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
// draw char
|
// draw char
|
||||||
printChar(c, cursorX, cursorY);
|
printChar(c, cursorX, cursorY);
|
||||||
|
@ -48,7 +44,7 @@ void Tinyfont::printChar(char c, int16_t x, int16_t y)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// check if char is available
|
// check if char is available
|
||||||
if (((uint8_t) c) < 32 || ((uint8_t) c) > 255) c = (char)127;
|
if (((uint8_t) c) < 32 || ((uint8_t) c) > 127) c = (char)127;
|
||||||
|
|
||||||
uint8_t cval = ((uint8_t) c) - 32;
|
uint8_t cval = ((uint8_t) c) - 32;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue