Montserrat 48 font taking up over 21% of flash


I’m using a nRF5340 DK and was developing a prototype when I notice the flash memory was over 92% and I have a lot more to add. The montserrat 48 font, which looks really good on my display, is taking up 94.42kb or 21.99% of the flash.

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

nRF5340 DK with Zephyr

What LVGL version are you using?


What do you want to achieve?

I want to free up more flash memory but would like to keep the font large.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

    ui_time_label = lv_label_create(ui_digital_clock);
    lv_obj_set_align(ui_time_label, LV_ALIGN_CENTER);
    lv_obj_set_y(ui_time_label, 10);
    lv_label_set_text(ui_time_label,  time_label_str);
    lv_obj_set_style_text_font(ui_time_label, &lv_font_montserrat_48, LV_PART_MAIN);

You can try to use an online font converter to crop unwanted text and enable font compression options.
For more details, please refer to: Fonts — LVGL documentation