Browse Source

greek fonts

pull/2568/head
Christos Themelis 5 months ago
parent
commit
7f53a21b9b
  1. 11
      examples/simple_secure_chat/main.cpp
  2. 1
      src/UI/ui.h
  3. 2
      src/UI/ui_Screen1.c

11
examples/simple_secure_chat/main.cpp

@ -49,6 +49,7 @@
#include <Adafruit_GFX.h>
#include "UI/ui.h"
#include "../src/fonts/fonts.h"
#include "../lvgl/lvgl.h"
#include "../include/externals.h"
@ -197,12 +198,12 @@ void add_chat_bubble(lv_obj_t *list,
lv_label_set_text(lbl_sender, sender);
lv_obj_set_style_text_color(lbl_sender,
is_self ? lv_color_hex(0xE3F2FD) : lv_color_hex(0x90CAF9), 0);
lv_obj_set_style_text_font(lbl_sender, &lv_font_montserrat_22, 0);
lv_obj_set_style_text_font(lbl_sender, &lv_font_arial_22, 0);
lv_obj_t *lbl_time = lv_label_create(hdr);
lv_label_set_text(lbl_time, time_str);
lv_obj_set_style_text_color(lbl_time, lv_color_hex(0xB0B0B0), 0);
lv_obj_set_style_text_font(lbl_time, &lv_font_montserrat_20, 0);
lv_obj_set_style_text_font(lbl_time, &lv_font_arial_20, 0);
// Message body (below header)
lv_obj_t *lbl_msg = lv_label_create(bubble);
@ -211,7 +212,7 @@ void add_chat_bubble(lv_obj_t *list,
lv_obj_set_width(lbl_msg, lv_pct(100));
lv_obj_set_style_text_color(lbl_msg, lv_color_hex(0xFFFFFF), 0);
lv_obj_set_style_text_font(lbl_msg, &lv_font_montserrat_26, 0);
lv_obj_set_style_text_font(lbl_msg, &lv_font_arial_26, 0);
// Spacing between header and text
//lv_obj_set_style_margin_top(lbl_msg, 6, 0);
@ -261,7 +262,7 @@ void add_private_chat_bubble(lv_obj_t *list, const char *time_str, const char *m
// Long mode για wrap
lv_label_set_long_mode(lbl_msg, LV_LABEL_LONG_WRAP);
lv_label_set_text(lbl_msg, msg);
lv_obj_set_style_text_font(lbl_msg, &lv_font_montserrat_22, 0);
lv_obj_set_style_text_font(lbl_msg, &lv_font_arial_22, 0);
// Fixed max width για wrap
lv_obj_set_width(lbl_msg, 400); // max πλάτος
@ -284,7 +285,7 @@ void add_private_chat_bubble(lv_obj_t *list, const char *time_str, const char *m
lv_obj_t *lbl_time = lv_label_create(aligner);
lv_label_set_text(lbl_time, time_str);
lv_obj_set_style_text_color(lbl_time, lv_color_hex(0x808080), 0);
lv_obj_set_style_text_font(lbl_time, &lv_font_montserrat_14, 0);
lv_obj_set_style_text_font(lbl_time, &lv_font_arial_14, 0);
lv_obj_scroll_to_view(row, LV_ANIM_ON);
}

1
src/UI/ui.h

@ -24,6 +24,7 @@ extern "C" {
#include "ui_helpers.h"
#include "ui_events.h"
#include "../fonts/fonts.h"
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);

2
src/UI/ui_Screen1.c

@ -27,7 +27,7 @@ void ui_Screen1_screen_init(void)
lv_obj_set_style_text_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0xFFFFFF),
LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(lv_tabview_get_tab_btns(ui_TabView1), &lv_font_montserrat_18,
lv_obj_set_style_text_font(lv_tabview_get_tab_btns(ui_TabView1), &lv_font_arial_18,
LV_PART_ITEMS | LV_STATE_DEFAULT);
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Contacts");

Loading…
Cancel
Save