From 415a6cb06c672440e2b9aade3dbf6cb99941d606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 8 Apr 2023 21:31:29 +0200 Subject: [PATCH] some cz unicode in 5x7 --- Core/Src/app_gui.c | 13 ++++++++----- Lib/ufb/Src/font_57.inc.c | 4 ++++ Lib/ufb/Src/fontedit_57.c | 40 +++++++++++++++++++++++++++++++++++++-- Makefile | 3 +++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/Core/Src/app_gui.c b/Core/Src/app_gui.c index 79f22d6..241a153 100644 --- a/Core/Src/app_gui.c +++ b/Core/Src/app_gui.c @@ -15,6 +15,7 @@ #include "ufb/fb_text.h" #include "ufb/fb_7seg.h" #include "app_safety.h" +#include "ufb/utf8.h" #define MAX_TEMP 400 @@ -228,8 +229,10 @@ static void input_sound_effect() // ------------- home screen ---------------- static const char* main_menu_opts[] = { - "Manual mode", - "Calibration", + "Ruční režim", + "Kalibrace", + "Programy", + "Diagnostika", NULL }; @@ -308,8 +311,8 @@ static void screen_manual(GuiEvent event) // --------------------------- static const char* manual_menu_opts[] = { - "Close menu", - "Exit manual", + "Zrušit", + "Hlavní menu", NULL }; @@ -357,7 +360,7 @@ static void screen_menu(GuiEvent event, const char **options, menu_callback_t cb case GUI_EVENT_SCREEN_TICK: // long text sliding animation if (tickNow - menu->change_time >= pdMS_TO_TICKS(500)) { - const uint32_t textlen = strlen(options[menu->pos]) * 6; + const uint32_t textlen = utf8_strlen(options[menu->pos]) * 6; if (textlen >= FBW - 2) { if (textlen - menu->text_slide > FBW - 1) { menu->text_slide += 1; diff --git a/Lib/ufb/Src/font_57.inc.c b/Lib/ufb/Src/font_57.inc.c index 79f9ea2..3c5981b 100644 --- a/Lib/ufb/Src/font_57.inc.c +++ b/Lib/ufb/Src/font_57.inc.c @@ -113,4 +113,8 @@ static const struct utf_glyph5x PROGMEM font57_extra[] = { {.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}}}, }; diff --git a/Lib/ufb/Src/fontedit_57.c b/Lib/ufb/Src/fontedit_57.c index 4742f39..3a0b007 100644 --- a/Lib/ufb/Src/fontedit_57.c +++ b/Lib/ufb/Src/fontedit_57.c @@ -895,6 +895,38 @@ const char *font_extras[] = { " ###", " ##", " #", + // 99 "č" + " x x ", + " x ", + " ### ", + "# ", + "# ", + "# #", + " ### ", + // 115 "š" + " x x ", + " x ", + " ### ", + "# ", + " ### ", + " #", + "#### ", + // 105 "i" + " #x ", + " ", + " ## ", + " # ", + " # ", + " # ", + " ### ", + // 122 "z" + " x x ", + " x ", + "#####", + " # ", + " # ", + " # ", + "#####", }; const char *font_extras_utf[] = { @@ -904,16 +936,20 @@ const char *font_extras_utf[] = { "↓", "←", "→", - "⏰", // clock + "⏱", // clock "⌛", "☸", "⏎", "🌡", "°", "μ", - "🔙", // back + "⎌", // back "▶", "◀", + "č", + "š", + "í", + "ž", }; #include "fontedit_render.inc.c" diff --git a/Makefile b/Makefile index ccc629c..a07d26a 100644 --- a/Makefile +++ b/Makefile @@ -253,3 +253,6 @@ flash-pico: $(BUILD_DIR)/$(TARGET).bin analyze: $(BUILD_DIR)/$(TARGET).elf python -m elf_size_analyze --rom $< + +fonts: + make -C Lib/ufb fonts \ No newline at end of file