ui improvements
This commit is contained in:
+15
-2
@@ -27,6 +27,21 @@ void fb_text_P_or_RAM(fbpos_t x, fbpos_t y, const char *text, uint8_t flags, fbc
|
||||
symh = 7;
|
||||
}
|
||||
|
||||
const uint8_t pxw = (flags & FONT_DOUBLEW) ? 2 : 1;
|
||||
const uint8_t pxh = (flags & FONT_DOUBLEH) ? 2 : 1;
|
||||
|
||||
if (flags & TEXT_CENTER) {
|
||||
size_t len = utf8_strlen(text);
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
uint8_t charw = (symw + 1 + ((flags & FONT_BOLD) ? 1 : 0)) * pxw;
|
||||
len *= charw;
|
||||
len -= pxw;
|
||||
|
||||
x -= (fbpos_t) (len / 2);
|
||||
}
|
||||
|
||||
while ((uchar = Utf8Iterator_Next(&iter)).uint) {
|
||||
const uint8_t *data;
|
||||
if (flags & FONT_4X5) {
|
||||
@@ -64,8 +79,6 @@ void fb_text_P_or_RAM(fbpos_t x, fbpos_t y, const char *text, uint8_t flags, fbc
|
||||
}
|
||||
} else {
|
||||
// slow, pixel-by-pixel drawing
|
||||
const uint8_t pxw = (flags & FONT_DOUBLEW) ? 2 : 1;
|
||||
const uint8_t pxh = (flags & FONT_DOUBLEH) ? 2 : 1;
|
||||
for(fbpos_t xx = 0; xx < symw; xx++) {
|
||||
uint8_t column = pgm_read_byte(&data[xx]);
|
||||
for(fbpos_t yy = 0; yy < symh; yy++) {
|
||||
|
||||
@@ -103,18 +103,19 @@ static const struct utf_glyph5x PROGMEM font57_extra[] = {
|
||||
{.utf={.symbol="↓"}, {{0x08, 0x10, 0x3e, 0x10, 0x08}}},
|
||||
{.utf={.symbol="←"}, {{0x08, 0x1c, 0x2a, 0x08, 0x08}}},
|
||||
{.utf={.symbol="→"}, {{0x08, 0x08, 0x2a, 0x1c, 0x08}}},
|
||||
{.utf={.symbol="⏰"}, {{0x1c, 0x22, 0x2e, 0x2a, 0x1c}}},
|
||||
{.utf={.symbol="⏱"}, {{0x1c, 0x22, 0x2e, 0x2a, 0x1c}}},
|
||||
{.utf={.symbol="⌛"}, {{0x63, 0x55, 0x4d, 0x55, 0x63}}},
|
||||
{.utf={.symbol="☸"}, {{0x1c, 0x22, 0x2a, 0x22, 0x1c}}},
|
||||
{.utf={.symbol="⏎"}, {{0x10, 0x38, 0x54, 0x10, 0x1e}}},
|
||||
{.utf={.symbol="🌡"}, {{0x20, 0x7e, 0x79, 0x7e, 0x2a}}},
|
||||
{.utf={.symbol="°"}, {{0x00, 0x07, 0x05, 0x07, 0x00}}},
|
||||
{.utf={.symbol="μ"}, {{0x7c, 0x20, 0x20, 0x10, 0x3c}}},
|
||||
{.utf={.symbol="🔙"}, {{0x04, 0x4e, 0x55, 0x44, 0x38}}},
|
||||
{.utf={.symbol="⎌"}, {{0x04, 0x4e, 0x55, 0x44, 0x38}}},
|
||||
{.utf={.symbol="▶"}, {{0x7f, 0x3e, 0x1c, 0x08, 0x00}}},
|
||||
{.utf={.symbol="◀"}, {{0x00, 0x08, 0x1c, 0x3e, 0x7f}}},
|
||||
{.utf={.symbol="č"}, {{0x38, 0x45, 0x46, 0x45, 0x20}}},
|
||||
{.utf={.symbol="š"}, {{0x48, 0x55, 0x56, 0x55, 0x20}}},
|
||||
{.utf={.symbol="í"}, {{0x00, 0x44, 0x7d, 0x41, 0x00}}},
|
||||
{.utf={.symbol="ž"}, {{0x44, 0x65, 0x56, 0x4d, 0x44}}},
|
||||
{.utf={.symbol="»"}, {{0x22, 0x14, 0x2a, 0x14, 0x08}}},
|
||||
};
|
||||
|
||||
@@ -927,6 +927,14 @@ const char *font_extras[] = {
|
||||
" # ",
|
||||
" # ",
|
||||
"#####",
|
||||
// »
|
||||
" ",
|
||||
"x x ",
|
||||
" x x ",
|
||||
" x x",
|
||||
" x x ",
|
||||
"x x ",
|
||||
" ",
|
||||
};
|
||||
|
||||
const char *font_extras_utf[] = {
|
||||
@@ -950,6 +958,7 @@ const char *font_extras_utf[] = {
|
||||
"š",
|
||||
"í",
|
||||
"ž",
|
||||
"»",
|
||||
};
|
||||
|
||||
#include "fontedit_render.inc.c"
|
||||
|
||||
Reference in New Issue
Block a user