TFT_eSPI loadFont File system is not mounted

I tried to use the Create_font.pde and i uploaded the vlw file to the filesystem and im able to open it with littlefs. when i try to loadFont i get this error: [ 421][E][vfs_api.cpp:24] open(): File system is not mounted and print: Font file /NotoSansRegular9.vlw not found!

void setup()
{
  Serial.begin(115200);

  if (!LittleFS.begin(true))
  {
    Serial.println("LittleFS Mount Failed");
  }

  fs::File file = LittleFS.open("/NotoSansRegular9.vlw");
  if (file)
  {
    Serial.println("opened");
    file.close();
  }

  tft.init();
  tft.loadFont("/NotoSansRegular9.vlw");
  tft.drawString("Hello", 50, 50);
}

Welcome to the forum

I am not familiar with the use of font files held on a LittleFS filesystem so can you please explain what the following code does ? Where in the sketch is the font file actually read ?

  fs::File file = LittleFS.open("/NotoSansRegular9.vlw");
  if (file)
  {
    Serial.println("opened");
    file.close();
  }

Hi. This part of the code is just to test that the file actually exist and can be opened. the font load is done by TFT_eSPI: tft.loadFont("/NotoSansRegular9.vlw"); and this what cause that error and show that print. I forgot this TFT_eSPI tft = TFT_eSPI();

It suppose to be like this instead tft.loadFont("NotoSansRegular9", LittleFS); and it works "fine" like that but the issue is that every fonts looks very bad.


edit: i ended up using the create font option in the Processing software tools with smooth disabled, instead of the TFT_eSPI Create_font.pde. it works fine.

You can convert any ttf with this tool and it works flawlessly.
Cheers.
https://rop.nl/truetype2gfx/

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.