Skip to content

lv_conf.h: a build can leave out a built-in Montserrat size - #7

Merged
bdbarnett merged 1 commit into
mainfrom
fonts-per-build
Nov 6, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
fonts-per-build

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

A firmware short of flash can now drop one of the compiled-in Montserrat sizes with a define, such as -DLV_FONT_MONTSERRAT_40=0, without editing lv_conf.h or regenerating the binding. Every LV_FONT_MONTSERRAT_<n> in lv_conf.h is an #ifndef default now, and the generator wraps each Montserrat font's wrapper struct and module entry in #if on that switch, in the MicroPython, CircuitPython and CPython bindings. The fonts reference page says how, and that the font can still be loaded at run time from fonts/.

The Arduino GIGA R1 needs this: with displayif, LVGL's 40 px font is what doesn't fit in its 1280 KB firmware slot.

I ran ./regenerate_all.sh (only the guards changed in generated/; api.json and lvgl.pyi are unchanged), scripts/verify_bindings.sh, which passes, and the generator, MicroPython-port and CircuitPython-port tests (128 passed, three of them new). A GIGA R1 firmware built from this branch with -DLV_FONT_MONTSERRAT_40=0 links and runs LVGL: lvgl.font_montserrat_40 is absent and font_montserrat_32 is present. I didn't build a CircuitPython or CPython target with a size turned off.

Every LV_FONT_MONTSERRAT_<n> in lv_conf.h is now an #ifndef default, and
the generator wraps each Montserrat font's wrapper and module entry in
#if on that switch, in the MicroPython, CircuitPython and CPython
bindings. A firmware short of flash passes -DLV_FONT_MONTSERRAT_40=0 and
the 40 px font drops out without lv_conf.h being edited or the binding
regenerated.

Ran ./regenerate_all.sh, then scripts/verify_bindings.sh (passes) and the
generator, MicroPython-port and CircuitPython-port tests (128 passed).
@bdbarnett
bdbarnett merged commit 9370a58 into main Nov 6, 2026
6 checks passed
@bdbarnett
bdbarnett deleted the fonts-per-build branch November 6, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant