Skip to content

Separate bundled LVGL fonts into external LGFX_Fonts (avoid upstream LVGL conflicts)#198

Merged
lovyan03 merged 2 commits into
m5stack:developfrom
ainyan03:ai/lvgl-fonts-separation
May 20, 2026
Merged

Separate bundled LVGL fonts into external LGFX_Fonts (avoid upstream LVGL conflicts)#198
lovyan03 merged 2 commits into
m5stack:developfrom
ainyan03:ai/lvgl-fonts-separation

Conversation

@ainyan03
Copy link
Copy Markdown
Contributor

Problem

The in-tree LVGL font support (lv_font_t, lv_font_montserrat_*, lvgl.h, the lv_font/ parser) shares symbol and header names with the upstream LVGL library. When a project uses LVGL directly alongside M5GFX, this causes link-time multiple definition errors (e.g. lv_font_montserrat_14, lv_font_get_bitmap_fmt_txt), breaking the build.

Change

Remove the bundled LVGL font implementation. External LVGL fonts are now provided by the separate LGFX_Fonts component (https://github.com/tobozo/LGFX_Fonts), which exposes the same fonts under renamed symbols (lgfx_lv_* / fonts::lvFontMontserrat*) so they no longer collide with upstream LVGL.

Kept intact:

  • the ft_lvgl enum value
  • the runtime loadFont(..., ft_lvgl) path (handled as BFFfont, which does not collide with LVGL)

examples/Basic/LvglFont is rewritten to use LGFX_Fonts (fonts::lvFontMontserrat*) with a M5GFX_LVGL_INTERNAL_H guard so it keeps working against both old (bundled) and new (delegated) M5GFX.

This mirrors the same rollback already done in LovyanGFX.

Verification (PlatformIO, esp32)

Build Result
before (bundled) + upstream LVGL v8 FAIL (multiple definition)
after + upstream LVGL v8 PASS (coexists, no symbol clash)
after + no LVGL PASS (no regression)
after + LGFX_Fonts PASS (firmware built)

Compatibility note

Compile-time font references change from fonts::lv_font_montserrat_* to fonts::lvFontMontserrat* (provided by the LGFX_Fonts component). The runtime BFF loadFont(..., ft_lvgl) path is unchanged.

ainyan03 and others added 2 commits May 20, 2026 18:14
…eam LVGL

The in-tree LVGL font support (LVGLfont, lv_font_t, lv_font_montserrat_*,
lvgl.h, lv_font/ parser, lv_conf_internal.h) shares symbol and header
names with the upstream LVGL library, which broke builds that use LVGL
directly.

External LVGL fonts are now provided by the separate LGFX_Fonts component
(tobozo/LGFX_Fonts), which exposes the same fonts under lgfx_lv_* renamed
symbols so they no longer collide with upstream LVGL.

The ft_lvgl enum and the BFFfont runtime-load path
(loadFont(..., ft_lvgl)) are kept intact. Mirrors the rollback done in
LovyanGFX.

Co-authored-by: tobozo <tobozo@users.noreply.github.com>
…onts

The bundled LVGL font symbols were removed, so the pre-built-font path now
goes through the LGFX_Fonts component (fonts::lvFontMontserrat*). A
M5GFX_LVGL_INTERNAL_H guard keeps the example working against both old
(bundled) and new (delegated) M5GFX. The runtime BFF
loadFont(..., ft_lvgl) path is unchanged. Drops the LVGL-format
montserrat_16.c user-font sample (its lv_font_t type no longer applies).
@lovyan03 lovyan03 merged commit 27e87e0 into m5stack:develop May 20, 2026
22 checks passed
@lovyan03 lovyan03 deleted the ai/lvgl-fonts-separation branch May 20, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants