How to add a new font in LVGL?

I tried following the directions here, but the directions were kind of unclear. I converted the font using the online converter. The page says to copy the font into the project, but where exactly in the project do we copy it into? Also, which file would we do put the LV_FONT_DECLARE? Lastly, it says to make the font global we add it under LV_FONT_CUSTOM_DECLARE in lv_conf.h, but after looking in lv_conf.h I saw that there isn’t an LV_FONT_CUSTOM_DECLARE.

It should be a .c file, so just put it in your src directory.

That link you posted is the LVGL 7 docs.
PROS is currently still on LVGL 5.3, for which the docs are really hard to find.

This is the only location where they can be found:

EDIT: I don’t know if font stuff has changed between 5.3 and 7 but there are a lot of breaking changes, so it might have. Try what Drew said, but you’ll probably need the 5.3 docs for other things anyway.


Thanks for providing the 5.3 docs. However, I have run into another problem. After creating the .c file for the font and putting it in src, it ends up with a lot of compilation errors. Here’s a list of some of them:

unknown type name LV_ATTRIBUTE_LARGE_CONST
unknown type name lv_font_fmt_txt_glyph_dsc_t
field designator 'adv_w'' does not refer to any field in type const 'lv_font_glyph_dsc_t'
field designator 'box_h'' does not refer to any field in type const 'lv_font_glyph_dsc_t'

There’s a lot more but a majority of them are very similar to the last 2 on that list. I’m relatively inexperienced with lvgl so I’m not quite sure what all these mean.

1 Like

are you using the new font converter instead of the old one?


thank you for this I suspected it has to do something with the different LVGL versions but I didn’t know where to find older converters. I got the fonts to work now thanks everyone

1 Like

yep, LVGL recently redid their whole site and removed basically any reference to pre-v6. The old font converter is hidden under the new one, I don’t know if the old image converter is even available, and I have no clue where you find the old 5.3 docs (someone just sent me the link).

1 Like