diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-10 09:26:26 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-10 11:19:43 (GMT) |
| commit | 9f68f5b227ad3c83130d7cc521c80b6caf974466 (patch) | |
| tree | 37aa48f6652423b318572e32b27ec5c5cbc4468c /src/displayapp/fonts | |
| parent | e30a394ee3b0348941a0fd559ca847d296b29928 (diff) | |
lowercase characters
Diffstat (limited to 'src/displayapp/fonts')
| -rw-r--r-- | src/displayapp/fonts/neofont.c | 186 |
1 files changed, 178 insertions, 8 deletions
diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c index b95d9ae..824b54e 100644 --- a/src/displayapp/fonts/neofont.c +++ b/src/displayapp/fonts/neofont.c @@ -242,6 +242,163 @@ static const uint8_t glyphs[][2] = { X, X, X ), + G( _, _, _, + X, X, _, + _, X, X, + X, _, X, + X, X, X ), + + G( X, _, _, + X, _, _, + X, X, _, + X, _, X, + X, X, _ ), + + G( _, _, _, + _, X, X, + X, _, _, + X, _, _, + _, X, X ), + + G( _, _, X, + _, _, X, + _, X, X, + X, _, X, + _, X, X ), + + G( _, _, _, + _, X, X, + X, _, X, + X, X, _, + _, X, X ), + + G( _, _, X, + _, X, _, + _, X, X, + _, X, _, + X, _, _ ), + + G( _, _, _, + X, X, X, + X, _, X, + _, X, X, + X, X, X ), + + G( X, _, _, + X, _, _, + X, X, _, + X, _, X, + X, _, X ), + + G( _, X, _, + _, _, _, + _, X, _, + _, X, _, + X, X, X ), + + G( _, X, _, + _, _, _, + _, X, _, + _, X, _, + X, _, _ ), + + G( X, _, _, + X, _, _, + X, _, X, + X, X, _, + X, _, X ), + + G( X, X, _, + _, X, _, + _, X, _, + _, X, _, + _, X, X ), + + G( _, _, _, + X, _, _, + X, X, X, + X, X, X, + X, _, X ), + + G( _, _, _, + X, X, _, + X, _, X, + X, _, X, + X, _, X ), + + G( _, _, _, + _, X, _, + X, _, X, + X, _, X, + _, X, _ ), + + G( _, _, _, + X, X, _, + X, _, X, + X, X, _, + X, _, _ ), + + G( _, _, _, + _, X, X, + X, _, X, + _, X, X, + _, _, X ), + + G( _, _, _, + _, _, _, + _, X, X, + X, _, _, + X, _, _ ), + + G( _, _, _, + _, X, X, + X, _, _, + _, X, X, + X, X, _ ), + + G( _, X, _, + X, X, X, + _, X, _, + _, X, _, + _, X, _ ), + + G( _, _, _, + _, _, _, + X, _, X, + X, _, X, + X, X, X ), + + G( _, _, _, + _, _, _, + X, _, X, + X, _, X, + _, X, _ ), + + G( _, _, _, + _, _, _, + X, _, X, + X, X, X, + X, X, X ), + + G( _, _, _, + _, _, _, + X, _, X, + _, X, _, + X, _, X ), + + G( _, _, _, + X, _, X, + X, X, X, + _, _, X, + X, X, _ ), + + G( _, _, _, + X, X, X, + _, X, _, + X, _, _, + X, X, X ), + + G( _, X, _, _, X, _, _, X, _, @@ -366,7 +523,7 @@ static const uint8_t * neofont0mono_glyph_bitmap_cb(const lv_font_t * font, uint return glyphs[(unicode_letter - 'A')+10]; } if ('a' <= unicode_letter && unicode_letter <= 'z') { - return glyphs[(unicode_letter - 'a')+10]; + return glyphs[(unicode_letter - 'a')+36]; } if (unicode_letter == ' ') { return spc; } @@ -374,7 +531,7 @@ static const uint8_t * neofont0mono_glyph_bitmap_cb(const lv_font_t * font, uint if (unicode_letter < 0x80) { char*x = strchr(symbols,((uint8_t)unicode_letter)); if (x != NULL) { - return glyphs[36+(x-symbols)]; + return glyphs[62+(x-symbols)]; } } @@ -382,6 +539,8 @@ static const uint8_t * neofont0mono_glyph_bitmap_cb(const lv_font_t * font, uint case 0xB0: return glyphs[sizeof(glyphs)/sizeof(glyphs[0])-1]; } + +#define NEOFONT_LOWERCASE_I (0xF0000 + (1 << 0) + (1 << 6) + (1 << 9) + (1 << 12)) if ((0xF0000 < unicode_letter) && (unicode_letter < 0xF7FFF)) { custom[0] = unicode_letter; @@ -901,10 +1060,11 @@ static bool isthin(uint32_t unicode_letter) { return unicode_letter == ' ' || unicode_letter == ':' || + unicode_letter == NEOFONT_LOWERCASE_I || unicode_letter == 'I' || unicode_letter == 'i' || + unicode_letter == '|' || unicode_letter == '.'; - // May also add: "'|" } static bool neofont3_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { @@ -921,8 +1081,10 @@ static bool neofont3_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont3_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { - if ((unicode_letter == 'I') || (unicode_letter == 'i')) { + if ((unicode_letter == 'I')) { unicode_letter = '|'; + } else if (unicode_letter == 'i') { + unicode_letter = NEOFONT_LOWERCASE_I; } return neofont3mono_glyph_bitmap_cb(font, unicode_letter); } @@ -963,8 +1125,10 @@ static bool neofont2_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont2_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { - if ((unicode_letter == 'I') || (unicode_letter == 'i')) { + if ((unicode_letter == 'I')) { unicode_letter = '|'; + } else if (unicode_letter == 'i') { + unicode_letter = NEOFONT_LOWERCASE_I; } return neofont2mono_glyph_bitmap_cb(font, unicode_letter); } @@ -1001,8 +1165,10 @@ static bool neofont15_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont15_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { - if ((unicode_letter == 'I') || (unicode_letter == 'i')) { + if ((unicode_letter == 'I')) { unicode_letter = '|'; + } else if (unicode_letter == 'i') { + unicode_letter = NEOFONT_LOWERCASE_I; } return neofont15mono_glyph_bitmap_cb(font, unicode_letter); } @@ -1039,8 +1205,10 @@ static bool neofont1_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont1_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { - if ((unicode_letter == 'I') || (unicode_letter == 'i')) { + if ((unicode_letter == 'I')) { unicode_letter = '|'; + } else if (unicode_letter == 'i') { + unicode_letter = NEOFONT_LOWERCASE_I; } return neofont1mono_glyph_bitmap_cb(font, unicode_letter); } @@ -1077,8 +1245,10 @@ static bool neofont0_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont0_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { - if ((unicode_letter == 'I') || (unicode_letter == 'i')) { + if ((unicode_letter == 'I')) { unicode_letter = '|'; + } else if (unicode_letter == 'i') { + unicode_letter = NEOFONT_LOWERCASE_I; } return neofont0mono_glyph_bitmap_cb(font, unicode_letter); } |
