[已解决] 请问在Arduino中怎样配置LVGL8.1.0访问spiffs里面的字库或图片?

fsyzty
Posts: 7
Joined: Wed Dec 22, 2021 7:43 am

Re: [已解决] 请问在Arduino中怎样配置LVGL8.1.0访问spiffs里面的字库或图片?

Postby fsyzty » Tue Dec 28, 2021 3:42 pm

lv_font_t * my_font;
my_font = lv_font_load("A:NotoSans_38.bin");
if (my_font == NULL)
{
Serial.println("font load failed");
}else{
Serial.println("font load ok");
}

/* Create simple label */
lv_obj_t *label = lv_label_create( lv_scr_act() );
lv_label_set_recolor(label, true);
lv_label_set_text( label, "#0000ff Hello Arduino! 中文测试#(V8.0.X)" );
lv_obj_set_style_text_font(label, my_font, 0);
lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );


这样也行. 受esp32内存的限制, 字库文件不要超过40K,左右.否则反复重启.完全失去了把字库外置的意义.....还要继续摸索....

Xin888
Posts: 11
Joined: Wed Dec 15, 2021 8:08 am

Re: [已解决] 请问在Arduino中怎样配置LVGL8.1.0访问spiffs里面的字库或图片?

Postby Xin888 » Wed Dec 29, 2021 3:34 am

再次尝试ing
esp32_lvgl_idf_外部字体错误666.png
esp32_lvgl_idf_外部字体错误666.png (372.53 KiB) Viewed 4439 times

fsyzty
Posts: 7
Joined: Wed Dec 22, 2021 7:43 am

Re: [已解决] 请问在Arduino中怎样配置LVGL8.1.0访问spiffs里面的字库或图片?

Postby fsyzty » Wed Dec 29, 2021 5:06 am

500k的RAM,启动后剩下100k左右, 我试过40K的bin是完全没问题的.我手头没带PSRAM的esp32,不然可以试试.

Who is online

Users browsing this forum: No registered users and 192 guests