Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 994 Bytes

imgfont.rst

File metadata and controls

41 lines (26 loc) · 994 Bytes

Image font

Draw image in label or span obj with :cpplv_imgfont. This is often used to display Unicode emoji icons in text.

Supported image formats: determined by enabled LVGL image decoders <overview_image_decoder>.

Usage

Enable :cLV_USE_IMGFONT in lv_conf.h.

To create a new imgfont use :cpplv_imgfont_create(height, path_cb, user_data).

  • height Font size.
  • path_cb A function to get the image path of a character. Return NULL if no image should be shown, but the character itself.
  • user_data Pointer to user data.

To use the imgfont in a label, reference it: :cpplv_obj_set_style_text_font(label, imgfont, LV_PART_MAIN)

To destroy the imgfont that is no longer used, use :cpplv_imgfont_destroy(imgfont).

Example

API