update TinyFont lib

This commit is contained in:
Mr.Blinky 2020-06-27 01:40:29 +02:00 committed by GitHub
parent eb15a8bec5
commit 83201ca4dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -1,4 +1,4 @@
https://github.com/yinkou/Arduboy-TinyFont
# https://github.com/yinkou/Arduboy-TinyFont
#######################################
# Datatypes (KEYWORD1)

View File

@ -20,6 +20,7 @@ Tinyfont::Tinyfont(uint8_t *screenBuffer, int16_t width, int16_t height){
}
size_t Tinyfont::write(uint8_t c) {
// check \n
if(c == '\n'){
cursorX = baseX; // cr
cursorY += lineHeight; // lf
@ -28,11 +29,6 @@ size_t Tinyfont::write(uint8_t c) {
else if(c == '\t'){
cursorX += TINYFONT_WIDTH + 5;
}
// check \n
else if (c == '\n') {
cursorX = baseX;
cursorY += lineHeight;
}
else{
// draw char
printChar(c, cursorX, cursorY);
@ -48,7 +44,7 @@ void Tinyfont::printChar(char c, int16_t x, int16_t y)
return;
// 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;