显示原文
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>
.
使用 label 或 span 对象以 :cpplv_imgfont
绘制图像。这通常用于在文本中显示Unicode表情符号图标。
支持的图像格式:由启用的LVGL image decoders <overview_image_decoder>
决定。
显示原文
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. ReturnNULL
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)
.
启用 :cLV_USE_IMGFONT
在 lv_conf.h
中。
要创建一个新的 imgfont,使用 :cpplv_imgfont_create(height, path_cb, user_data)
。
height
字体大小。path_cb
获取字符图像路径的函数。 如果不应该显示图像,而是显示字符本身,返回NULL
。user_data
用户数据指针。
要在标签中使用 imgfont,请引用它: :cpplv_obj_set_style_text_font(label, imgfont, LV_PART_MAIN)
要销毁不再使用的 imgfont,请使用 :cpplv_imgfont_destroy(imgfont)
。