ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.2k stars 211 forks source link

gslc_FontSet fail to add vlw font file from SPIFFTS #556

Open JoeHo8051 opened 3 days ago

JoeHo8051 commented 3 days ago

Describe the bug

I put my vlw file into spiffs, and I check the file do exist in the SPIFFS area. It seems it failed to load the font , I saw the serial return "Font file cairomedium16.vlw not found! " when I enter the page using that font.

Here is my code:

if (!gslc_Init(&m_gui,&m_drv,m_asPage,MAX_PAGE,m_asFont,MAX_FONT)) { return; }

if (!SPIFFS.begin(true)) { return; }

// ------------------------------------------------ // Load Fonts // ------------------------------------------------ //<Load_Fonts !Start!> if (!gslc_FontSet(&m_gui,E_BUILTIN10X16,GSLC_FONTREF_PTR,NULL,2)) { return; } if (!gslc_FontSet(&m_gui,E_BUILTIN15X24,GSLC_FONTREF_PTR,NULL,3)) { return; } if (!gslc_FontSet(&m_gui,E_BUILTIN5X8,GSLC_FONTREF_PTR,NULL,1)) { return; } if (!gslc_FontSet(&m_gui,E_CAIROBOLD16,GSLC_FONTREF_FNAME,CAIROBOLD16_VLW,16)) { return; } gslc_FontSetMode(&m_gui, E_CAIROBOLD16, GSLC_FONTREF_MODE_1);

if (!gslc_FontSet(&m_gui,E_CAIROMEDIUM16,GSLC_FONTREF_FNAME,"cairomedium16.vlw",16)) { return; }

Device hardware

Pconti31 commented 2 days ago

@JoeHo8051 Post a zip file of a test project with just one text field using your font and include the full project folder with data folder and your cairomedium16.vlw and I will take a look. Also, If you used the builder then include your modified GUIsliceBuilder/templates/builder_fonts.json Paul--

Pconti31 commented 1 day ago

@JoeHo8051 By the way here is a simple stand alone program without GUIslice or TFT_eSPI to list spiffs file names to serial output. list_files.zip Paul--