Add utf-8 capable 6x8 pixel small font (redone) (#173)

* Add small 6x8 font with utf8 extended charset.

The font data is created from the CasioNostalgia font by zdimension
found at: https://fontstruct.com/fontstructions/show/1193786/casionostalgia

* Cleanup Font.h

The font data should be untouched.

This commit does:

  * whitespace cleanup
  * some cosmetic changes to the comments
  * removing commas at the end of array declarations

* Update OLED.cpp to use utf8 capable FONT_6x8

* Remove ASCII6x8 from Font.h

Removed because all glyphs from ASCII6x8 are now contained in FONT_6x8.

* Fix char offset for UTF-8 page 0xc3
This commit is contained in:
matmemo
2017-12-23 09:38:58 +01:00
committed by Ben V. Brown
parent db17385947
commit c0614e7bd6
2 changed files with 626 additions and 286 deletions

View File

@@ -120,13 +120,13 @@ void OLED::drawChar(char c, char PrecursorCommand) {
index = (96 - 32) + (c);
break; //-32 compensate for chars excluded from font C2 section
case 0xC3:
index = (128-32) + (c);
index = (128) + (c);
break;
#if defined(LANG_RU) || defined(LANG_UK) || defined(LANG_SR) || defined(LANG_BG) || defined(LANG_MK)
case 0xD0:
case 0xD0:
index = (192) + (c);
break;
case 0xD1:
case 0xD1:
index = (256) + (c);
break;
#else
@@ -209,7 +209,7 @@ void OLED::setCharCursor(int16_t x, int16_t y) {
void OLED::setFont(uint8_t fontNumber) {
if (fontNumber == 1) {
//small font
currentFont = ASCII6x8;
currentFont = FONT_6x8;
fontHeight = 8;
fontWidth = 6;
} else if (fontNumber == 2) {