I want to determine whether the displayed content exists in the font library generated myself

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

I want to determine whether the displayed content exists in the font library generated myself

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

esp32

What LVGL version are you using?

v8.0+

What do you want to achieve?

I want to determine whether the displayed content exists in the font library generated myself

What have you tried so far?

I thought of a method, because the encoding is written in utf-8 strings, but there is a unicode encoding array unicode_list in the font library, so I want to convert utf-8 into unicode encoding first, and then compare with unicode_list, come Determine whether the current font library supports displaying the content

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:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

There were some related changes since v8.2 (available in master). So I suggest updating to the latest master version.

You can do this:

lv_font_glyph_dsc_t dsc;
bool ret = lv_font_get_glyph_dsc(font, &dsc,  letter, 0);
if(ret == false) printf("not found\n");

I’m not sure if it’s relevant in your case but some font engines (e.g. FreeType) supports returning a when the glyph is not found. In this case lv_font_get_glyph_dsc returns true but dsc->is_placeholder is set to 1. However, this feature is not supported in default built in font engine.