Moe changes

This commit is contained in:
jpirnay
2026-05-15 00:21:31 +02:00
parent 084263ad39
commit 2e1db2ec68
3 changed files with 5 additions and 9 deletions
+2 -6
View File
@@ -2,6 +2,7 @@
#include <Epub.h>
#include <FontCacheManager.h>
#include <FontDecompressor.h>
#include <FsHelpers.h>
#include <GfxRenderer.h>
#include <HalClock.h>
#include <HalDisplay.h>
@@ -196,12 +197,7 @@ void ensureSdFontLoadedForPath(const char* path) {
ensureSdFontLoaded();
return;
}
const size_t len = strlen(path);
auto endsWith = [&](const char* suffix) {
const size_t sl = strlen(suffix);
return len >= sl && strcasecmp(path + len - sl, suffix) == 0;
};
const bool isTxtMd = endsWith(".txt") || endsWith(".md");
const bool isTxtMd = FsHelpers::hasTxtExtension(path) || FsHelpers::hasMarkdownExtension(path);
if (isTxtMd) {
sdFontSystem.ensureLoaded(renderer, SETTINGS.txtSdFontFamilyName, SETTINGS.txtFontSize);
} else {