I have a project for ESP32-S3 using ESP-IDF, and I am having difficulty adding a custom font.
The font file was created using the LVGL TTF font convertor using a file from Google Fonts, and has been named fragment_mono_regular.c.
In the menu config (idf.py menuconfig), my settings look like this:
[*] Uncheck this to use custom lv_conf.h
...
[*] Enable the custom font
(LV_FONT_DECLARE(fragment_mono_regular)) Header to include for the custom font
That is, in the “Header to include for the custom font” option, I entered exactly: LV_FONT_DECLARE(fragment_mono_regular).
This creates sdkconfig with the following lines:
CONFIG_LV_CONF_SKIP=y
...
CONFIG_LV_FONT_CUSTOM=y
CONFIG_LV_FONT_CUSTOM_DECLARE="LV_FONT_DECLARE(fragment_mono_regular)"
I’m new to this whole environment, but my impression is that sdkconfig is only able to store text values as strings with double quotes, and so when this definition is unpacked by the compiler, it includes the double quotes so what should be a macro appears as a string. The compiler then gives the following error:
.../build/config/sdkconfig.h:1026:39: error: expected identifier or '(' before string constant
1026 | #define CONFIG_LV_FONT_CUSTOM_DECLARE "LV_FONT_DECLARE(fragment_mono_regular)"
Is this a limitation of the menu config system which means that I’ll have to use a custom lv_conf.h instead?
If not, how am I supposed to enter the font information so that the quotes are not included and break the compilation?