Description
Can not display Swedish special characters Å, Ä, and Ö.
What MCU/Processor/Board and compiler are you using?
ESP32S3 Lilygo Display dev board with touch screen.
What LVGL version are you using?
LVGL version = 8.3
ESP32 IDF version 5.1.2
Eclipse IDE
What do you want to achieve?
I am trying to send Swedish special letters to the display.
What have you tried so far?
I have done the following.
Used Online font converter - TTF or WOFF fonts to C array | LVGL to create C array. I named it swe_mont_normal.
*-----------------
- PUBLIC FONT
----------------/
/Initialize a public general font descriptor/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t swe_mont_normal = {
#else
lv_font_t swe_mont_normal = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /Function pointer to get glyph’s data/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /Function pointer to get glyph’s bitmap/
.line_height = 14, /The maximum line height required by the font/
.base_line = 3, /Baseline measured from the bottom of the line/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
.underline_position = 0,
.underline_thickness = 0,
#endif
.dsc = &font_dsc, /*The custom font data. Will be accessed by get_glyph_bitmap/dsc
*/
.fallback = NULL,
.user_data = NULL
};
Included the file in the workspace.
I am using custom lv_conf.h
/* clang-format off */
#if 1 /Set it to “1” to enable content/
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(swe_mont_normal)
#define LV_FONT_DEFAULT &swe_mont_normal
Code to reproduce
Main file contains
lv_style_init(&style);
lv_style_set_text_font(&style,&swe_mont_normal);
lv_label_set_text(label, “Å, Ä, and Ö”);
Screenshot and/or video
It displays a Box instead of the characters.
I am very new to Lvgl and graphics. I think when i created the c array i did not use correct settings. I just picked a range from 0x00-0xFF.
Here is screenshot
Thanks in advance for suggestions and help.