How do I tell if a specific font in LVGL can render a particular string?

,

What do you want to achieve?

I’d like to be able to detect missing font characters easily, so that I may add them in the future, or hide certain strings in the UI for now.

What have you tried so far?

I looked at the code headers, and I found lv_font_get_glyph_dsc(), but that doesn’t really handle unicode strings, just glyphs. For proper unicode parsing, I think I’d need to pass in a whole string, like below maybe? Or would it be enough to parse each codepoint from the UTF8 and check if there is a glyph descriptor?

Code I’d Like

bool lv_font_has_all_glyphs(const lv_font_t * font, const char * utf8str);

Environment

  • MCU/MPU/Board: Custom ESP32-S3 board
  • LVGL version: 9.3.0

Yes, it is enough to decode each Unicode codepoint from your UTF-8 string one by one and check if a glyph descriptor exists using lv_font_get_glyph_dsc()

LVGL does not provide a single high-level function that scans a full string for missing font characters, but you can try implement this by combining lv_text_encoded_next() with lv_font_get_glyph_dsc().

Let me know if it works!