mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user