You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Open the font file
File fontFile = LittleFS.open("/myfont.ttf", "r");
if (!fontFile) {
DEBUG_PRINT("Failed to open icon file");
}
// Read font file contents into a buffer
size_t fileSize = fontFile.size();
uint8_t* fontBuffer = (uint8_t*)malloc(fileSize);
fontFile.read(fontBuffer, fileSize);
fontFile.close();
if (iconOfr.loadFont(fontBuffer, fileSize)) {
DEBUG_PRINT("\nIcon Initialise error");
}
OpenFontRender v1.2 now includes enhanced support for file systems.
Font loading from SPIFFS is also supported and can be enabled simply by using a preset.
Unfortunately, no LittleFS presets are provided yet, but it should be possible to support the LittleFS file system by implementing custom code.
Please see document and sample code for more info.
Welcome your feedback.
Maybe I didn't quite get it yet but from what I understand OpenFontRender can only load fonts from SD card or binary (i.e. embedded in code).
Working with ESP32 it would be most helpful to be able to load fonts from the internal LittleFS file system.
The text was updated successfully, but these errors were encountered: