Selection of font

I am using ESP32-S3, Visual Studio Code with ESP-IDF v5.3.1.

I have downloaded LVGL into: components->LVGL_CP->lvgl
and the lv_conf.h file into: components_LVGL_CP->lv_conf.h

Within the lv_conf.h I have set to one (i.e. enabled) the three fonts:

#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_24 1
#define LV_FONT_MONTSERRAT_48 1

I use the three fonts by for example

lv_obj_t* item1_text = lv_label_create(screen);
lv_label_set_text(item1_text, “Controller cycle time:”);
lv_obj_set_style_text_font(item1_text, &lv_font_montserrat_24, 0);

but I get the error message:

D:/Projects_ESP32/LCD_8bit/LCD_LVGL_cps/LCD_LVGL/main/main.c: In function ‘sceneA’:
D:/Projects_ESP32/LCD_8bit/LCD_LVGL_cps/LCD_LVGL/main/main.c:642:45: error: ‘lv_font_montserrat_24’ undeclared (first use in this function); did you mean ‘lv_font_montserrat_14’?
642 | lv_obj_set_style_text_font(item1_text, &lv_font_montserrat_24, 0);
| ^~~~~~~~~~~~~~~~~~~~~
| lv_font_montserrat_14

Hence, it finds the lv_font_montserrat_14, but not the lv_font_montserrat_24 although both are enabled in lv_conf.h.

The lvgl.h file is include by: #include “…/components/LVGL_CP/lvgl/lvgl.h”

I developed the LVGL code using the simulator running in Visual Studio 2022. The simulator found all three fonts and used them.

Why does it not work in the ESP-IDF 5.3.1?
How do I make it work with the 3 fonts?

Regards,
Jorgen

I found a solution. I subscribed to the LVGL course offered by Mair Swartz, Micros Academy. One session is on the lv_conf.h.
It is necessary to enable the use of the lv_conf.h by un-checking the entry “Check this to not use custom lv_conf.h” using for example the SDK Configuration editor or menuconfig.

Regards,
Jorgen