From 7541cb37f0e0192224e162be464a94604862cb0a Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Wed, 13 Mar 2019 21:21:22 +0900 Subject: [PATCH] Add setFS function. ( Support for file systems other than SPIFFS. ) --- Extensions/Smooth_font.cpp | 10 ++++------ Extensions/Smooth_font.h | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Extensions/Smooth_font.cpp b/Extensions/Smooth_font.cpp index 6e5f89d..07b8bef 100644 --- a/Extensions/Smooth_font.cpp +++ b/Extensions/Smooth_font.cpp @@ -77,12 +77,12 @@ void TFT_eSPI::loadFont(String fontName) unloadFont(); // Avoid a crash on the ESP32 if the file does not exist - if (SPIFFS.exists("/" + fontName + ".vlw") == false) { + if ((_pFS ? *_pFS : SPIFFS).exists("/" + fontName + ".vlw") == false) { Serial.println("Font file " + fontName + " not found!"); return; } - fontFile = SPIFFS.open( "/" + fontName + ".vlw", "r"); + fontFile = (_pFS ? *_pFS : SPIFFS).open( "/" + fontName + ".vlw", "r"); if(!fontFile) return; @@ -452,11 +452,10 @@ void TFT_eSPI::drawGlyph(uint16_t code) int16_t cy = cursor_y + gFont.maxAscent - gdY[gNum]; int16_t cx = cursor_x + gdX[gNum]; - startWrite(); // Avoid slow ESP32 transaction overhead for every pixel - for (int y = 0; y < gHeight[gNum]; y++) { fontFile.read(pbuffer, gWidth[gNum]); //