How to add custom font in Platformio/VScode

Description

I created 3 custom fonts with font converter. (1bpp, C-file, just numbers and some symbols)
I have now 3 “FONT_NAME.c” files.
I can’t get compiler to find them.

  • Which folder do I put these .c files?
  • How and where do I declare/include them?

What MCU/Processor/Board and compiler are you using?

ESP32/CYD, VScode/Platformio/Arduino

What LVGL version are you using?

9.1

What have you tried so far?

  • Place them in every folder which seemed to possibly make sense (src, lib, lvgl fonts, libdep, include…)
  • Add them with LV_FONT_DECLARE(LV_FONT_MONTSERRAT_36PART); or with extern const lv_font_t LV_FONT_MONTSERRAT_36PART in the declaration.
  • adding build_flags = -I include to platformio.ini
  • renaming the .c files to .cpp.

Perhaps you may need to add your files into Cmakelist.txt file

1 Like

Hmm, I tried to google that, since I am not familiar with cmakelist.
If I understand right, PIO and cmakelist are not good friends… or I’m too dumb to figure how to use them.

Have you found a solution?

Nope, i ended up making the thing with the standard fonts.