example(imgfont): fix the path of the image

related to https://github.com/lvgl/lvgl/issues/3637#issuecomment-1249047687
This commit is contained in:
Gabor Kiss-Vamosi
2022-09-21 08:57:47 +02:00
parent b700052087
commit 8f3f60337f
2 changed files with 13 additions and 5 deletions

View File

@@ -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';
}

View File

@@ -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