Add TXT file reader support

- Add Txt library for loading and parsing plain text files
- Create TxtReaderActivity with streaming page rendering
  - Uses 8KB chunks to handle large files without memory issues
  - Page index caching for fast re-open after sleep
  - Progress bar during initial indexing
  - Word wrapping with UTF-8 support
- Support cover images for TXT files
  - Priority: same filename as TXT (e.g., book.jpg for book.txt)
  - Fallback: cover.bmp/jpg/jpeg in same folder
  - Converts JPG to BMP using existing converter
- Update SleepActivity to show TXT cover images in Cover mode
- Add .txt extension to file browser filter
This commit is contained in:
Eunchurn Park
2026-01-04 21:19:30 +09:00
parent 14972b34cb
commit 98f14da65a
8 changed files with 977 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ void FileSelectionActivity::loadFiles() {
auto filename = std::string(name);
std::string ext4 = filename.length() >= 4 ? filename.substr(filename.length() - 4) : "";
std::string ext5 = filename.length() >= 5 ? filename.substr(filename.length() - 5) : "";
if (ext5 == ".epub" || ext5 == ".xtch" || ext4 == ".xtc") {
if (ext5 == ".epub" || ext5 == ".xtch" || ext4 == ".xtc" || ext4 == ".txt") {
files.emplace_back(filename);
}
}