Lvgl support for Swedish special characters

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.

Hello,

It should work properly. Does the .ttf file you loaded into the online font converter contain those characters? Try including the characters in the range like so:

0x00-0xFF, 0x00C5, 0x00C4, 0x00D6 .
And remove the Symbols from that field.

Hello,

Many thanks for prompt reply. After converting ttf into C array i can see these letters are part of array so i assume these characters are part of ttf but i am not sure.

I made the changes you asked but no luck so far. Any other ideas you would like me to try.

Thanks

Hello Tinus,

Many thanks for pointing me into the right direction. I was not using the correct ttf. After using the correct one it is working. I am grateful.

Best Regards.