Determining binary/flash size of fonts


For a new product range we are working on, I’m looking into LVGL (v8.2.0).
To get a sense of the hardware requirements for our use case, I would like to measure the binary size of a couple of fonts.

I was hoping there would be an easy sizeof way to do it, but because of the character maps and such, this does not seem to be possible.
Does anyone know of an easy way to get an indication of the binary/flash size of a particular font?
(I’m currently mostly experimenting with an ESP32-S3 board for this, using the Espressif ESP-IDF.)

I have used the lv_font_conv tool with the --format bin option to gauge the size of several fonts. While it’s not 100% the same to compiled C, the size of the structs vs. binary file is in the same ballpark. And it’s easy to compile multiple fonts with the same codepoints and compare them using the filesize on disk.

When you’ve settled on a font, you can easily switch to --format lvgl to generate the code.
Having the font generation in a script is also handy for repeatability, future tweaks and documentation.