some cz unicode in 5x7

calib-gui
Ondřej Hruška 2 years ago
parent 90832fd2f4
commit 415a6cb06c
  1. 13
      Core/Src/app_gui.c
  2. 4
      Lib/ufb/Src/font_57.inc.c
  3. 40
      Lib/ufb/Src/fontedit_57.c
  4. 3
      Makefile

@ -15,6 +15,7 @@
#include "ufb/fb_text.h" #include "ufb/fb_text.h"
#include "ufb/fb_7seg.h" #include "ufb/fb_7seg.h"
#include "app_safety.h" #include "app_safety.h"
#include "ufb/utf8.h"
#define MAX_TEMP 400 #define MAX_TEMP 400
@ -228,8 +229,10 @@ static void input_sound_effect()
// ------------- home screen ---------------- // ------------- home screen ----------------
static const char* main_menu_opts[] = { static const char* main_menu_opts[] = {
"Manual mode", "Ruční režim",
"Calibration", "Kalibrace",
"Programy",
"Diagnostika",
NULL NULL
}; };
@ -308,8 +311,8 @@ static void screen_manual(GuiEvent event)
// --------------------------- // ---------------------------
static const char* manual_menu_opts[] = { static const char* manual_menu_opts[] = {
"Close menu", "Zrušit",
"Exit manual", "Hlavní menu",
NULL NULL
}; };
@ -357,7 +360,7 @@ static void screen_menu(GuiEvent event, const char **options, menu_callback_t cb
case GUI_EVENT_SCREEN_TICK: case GUI_EVENT_SCREEN_TICK:
// long text sliding animation // long text sliding animation
if (tickNow - menu->change_time >= pdMS_TO_TICKS(500)) { 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 >= FBW - 2) {
if (textlen - menu->text_slide > FBW - 1) { if (textlen - menu->text_slide > FBW - 1) {
menu->text_slide += 1; menu->text_slide += 1;

@ -113,4 +113,8 @@ static const struct utf_glyph5x PROGMEM font57_extra[] = {
{.utf={.symbol="🔙"}, {{0x04, 0x4e, 0x55, 0x44, 0x38}}}, {.utf={.symbol="🔙"}, {{0x04, 0x4e, 0x55, 0x44, 0x38}}},
{.utf={.symbol=""}, {{0x7f, 0x3e, 0x1c, 0x08, 0x00}}}, {.utf={.symbol=""}, {{0x7f, 0x3e, 0x1c, 0x08, 0x00}}},
{.utf={.symbol=""}, {{0x00, 0x08, 0x1c, 0x3e, 0x7f}}}, {.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}}},
}; };

@ -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[] = { const char *font_extras_utf[] = {
@ -904,16 +936,20 @@ const char *font_extras_utf[] = {
"", "",
"", "",
"", "",
"", // clock "", // clock
"", "",
"", "",
"", "",
"🌡", "🌡",
"°", "°",
"μ", "μ",
"🔙", // back "", // back
"", "",
"", "",
"č",
"š",
"í",
"ž",
}; };
#include "fontedit_render.inc.c" #include "fontedit_render.inc.c"

@ -253,3 +253,6 @@ flash-pico: $(BUILD_DIR)/$(TARGET).bin
analyze: $(BUILD_DIR)/$(TARGET).elf analyze: $(BUILD_DIR)/$(TARGET).elf
python -m elf_size_analyze --rom $< python -m elf_size_analyze --rom $<
fonts:
make -C Lib/ufb fonts
Loading…
Cancel
Save