example(imgfont): fix the path of the image
related to https://github.com/lvgl/lvgl/issues/3637#issuecomment-1249047687
This commit is contained in:
@@ -14,12 +14,18 @@ static bool get_imgfont_path(const lv_font_t * font, void * img_src,
|
||||
LV_UNUSED(user_data);
|
||||
LV_ASSERT_NULL(img_src);
|
||||
|
||||
if(unicode < 0xF000) return false;
|
||||
|
||||
if(unicode == 0xF617) {
|
||||
memcpy(img_src, &emoji_F617, sizeof(lv_img_dsc_t));
|
||||
}
|
||||
else {
|
||||
char * path = (char *)img_src;
|
||||
snprintf(path, len, "%s/%04"LV_PRIX32".%s", "A:lvgl/examples/assets/emoji", unicode, "png");
|
||||
#if LV_USE_FFMPEG
|
||||
snprintf(path, len, "%s/%04X.%s", "lvgl/examples/assets/emoji", unicode, "png");
|
||||
#elif LV_USE_PNG
|
||||
snprintf(path, len, "%s/%04X.%s", "A:lvgl/examples/assets/emoji", unicode, "png");
|
||||
#endif
|
||||
path[len - 1] = '\0';
|
||||
}
|
||||
|
||||
|
||||
@@ -218,10 +218,6 @@ void lv_init(void)
|
||||
lv_fs_win32_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_FFMPEG
|
||||
lv_ffmpeg_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_PNG
|
||||
lv_png_init();
|
||||
#endif
|
||||
@@ -234,6 +230,12 @@ void lv_init(void)
|
||||
lv_bmp_init();
|
||||
#endif
|
||||
|
||||
/*Make FFMPEG last because the last converter will be checked first and
|
||||
*it's superior to any other */
|
||||
#if LV_USE_FFMPEG
|
||||
lv_ffmpeg_init();
|
||||
#endif
|
||||
|
||||
#if LV_USE_FREETYPE
|
||||
/*Init freetype library*/
|
||||
# if LV_FREETYPE_CACHE_SIZE >= 0
|
||||
|
||||
Reference in New Issue
Block a user