Moe changes
This commit is contained in:
@@ -569,7 +569,7 @@ STR_MENU_SYS_TOOLS: "Tools"
|
|||||||
STR_MENU_DISP_SLEEP: "Sleep Screen"
|
STR_MENU_DISP_SLEEP: "Sleep Screen"
|
||||||
STR_MENU_DISP_BATTERY: "Battery symbol"
|
STR_MENU_DISP_BATTERY: "Battery symbol"
|
||||||
STR_MENU_DISP_REFRESH: "Screen refresh"
|
STR_MENU_DISP_REFRESH: "Screen refresh"
|
||||||
STR_MENU_READER_FONT: "EPUB Font"
|
STR_MENU_READER_FONT: "Reader Font"
|
||||||
STR_MENU_TXT_FONT: "TXT/MD Font"
|
STR_MENU_TXT_FONT: "TXT/MD Font"
|
||||||
STR_MENU_READER_FONT_SETTINGS: "Font Settings"
|
STR_MENU_READER_FONT_SETTINGS: "Font Settings"
|
||||||
STR_MENU_READER_LAYOUT: "Layout Settings"
|
STR_MENU_READER_LAYOUT: "Layout Settings"
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ BookOverlayInfo SleepActivity::getBookOverlayInfo(const std::string& bookPath) c
|
|||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (FsHelpers::checkFileExtension(bookPath, ".txt")) {
|
} else if (FsHelpers::hasTxtExtension(bookPath) || FsHelpers::hasMarkdownExtension(bookPath)) {
|
||||||
Txt txt(bookPath, "/.crosspoint");
|
Txt txt(bookPath, "/.crosspoint");
|
||||||
if (txt.load()) {
|
if (txt.load()) {
|
||||||
info.title = txt.getTitle();
|
info.title = txt.getTitle();
|
||||||
@@ -834,7 +834,7 @@ void SleepActivity::renderOverlaySleepScreen() const {
|
|||||||
|
|
||||||
if (FsHelpers::checkFileExtension(path, ".xtc") || FsHelpers::checkFileExtension(path, ".xtch")) {
|
if (FsHelpers::checkFileExtension(path, ".xtc") || FsHelpers::checkFileExtension(path, ".xtch")) {
|
||||||
rendered = XtcReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
rendered = XtcReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
||||||
} else if (FsHelpers::checkFileExtension(path, ".txt")) {
|
} else if (FsHelpers::hasTxtExtension(path) || FsHelpers::hasMarkdownExtension(path)) {
|
||||||
rendered = TxtReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
rendered = TxtReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
||||||
} else if (FsHelpers::checkFileExtension(path, ".epub")) {
|
} else if (FsHelpers::checkFileExtension(path, ".epub")) {
|
||||||
rendered = EpubReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
rendered = EpubReaderActivity::drawCurrentPageToBuffer(path, renderer);
|
||||||
|
|||||||
+2
-6
@@ -2,6 +2,7 @@
|
|||||||
#include <Epub.h>
|
#include <Epub.h>
|
||||||
#include <FontCacheManager.h>
|
#include <FontCacheManager.h>
|
||||||
#include <FontDecompressor.h>
|
#include <FontDecompressor.h>
|
||||||
|
#include <FsHelpers.h>
|
||||||
#include <GfxRenderer.h>
|
#include <GfxRenderer.h>
|
||||||
#include <HalClock.h>
|
#include <HalClock.h>
|
||||||
#include <HalDisplay.h>
|
#include <HalDisplay.h>
|
||||||
@@ -196,12 +197,7 @@ void ensureSdFontLoadedForPath(const char* path) {
|
|||||||
ensureSdFontLoaded();
|
ensureSdFontLoaded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const size_t len = strlen(path);
|
const bool isTxtMd = FsHelpers::hasTxtExtension(path) || FsHelpers::hasMarkdownExtension(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");
|
|
||||||
if (isTxtMd) {
|
if (isTxtMd) {
|
||||||
sdFontSystem.ensureLoaded(renderer, SETTINGS.txtSdFontFamilyName, SETTINGS.txtFontSize);
|
sdFontSystem.ensureLoaded(renderer, SETTINGS.txtSdFontFamilyName, SETTINGS.txtFontSize);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user