Yet another bionic reading implementation

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
jpirnay
2026-04-30 09:11:49 +02:00
co-authored by Copilot
parent 4cc793397f
commit cefed0f6ce
12 changed files with 61 additions and 26 deletions
+7 -2
View File
@@ -26,8 +26,10 @@ class ParsedText {
BlockStyle blockStyle;
bool extraParagraphSpacing;
bool hyphenationEnabled;
bool bionicReadingEnabled;
void applyParagraphIndent();
void applyBionicReadingTransform();
std::vector<size_t> computeLineBreaks(const GfxRenderer& renderer, int fontId, int pageWidth,
std::vector<uint16_t>& wordWidths, std::vector<bool>& continuesVec);
std::vector<size_t> computeHyphenatedLineBreaks(const GfxRenderer& renderer, int fontId, int pageWidth,
@@ -60,8 +62,11 @@ class ParsedText {
public:
explicit ParsedText(const bool extraParagraphSpacing, const bool hyphenationEnabled = false,
const BlockStyle& blockStyle = BlockStyle())
: blockStyle(blockStyle), extraParagraphSpacing(extraParagraphSpacing), hyphenationEnabled(hyphenationEnabled) {}
const BlockStyle& blockStyle = BlockStyle(), const bool bionicReadingEnabled = false)
: blockStyle(blockStyle),
extraParagraphSpacing(extraParagraphSpacing),
hyphenationEnabled(hyphenationEnabled),
bionicReadingEnabled(bionicReadingEnabled) {}
~ParsedText() = default;
void addWord(std::string word, EpdFontFamily::Style fontStyle, bool underline = false, bool attachToPrevious = false);
+2
View File
@@ -598,3 +598,5 @@ STR_KB_HINT_SECONDARY_CHAR: "Hold SELECT for secondary char"
STR_KB_HINT_UPPER_SECONDARY: "Hold SELECT for UPPERCASE or secondary char"
STR_KB_HINT_LOWER_SECONDARY: "Hold SELECT for lowercase or secondary char"
STR_KB_HINT_URL_SNIPPETS: "Press URL for snippets"
STR_BIONIC_READING: "Bionic Reading"
STR_BTN_ACT_TOGGLE_BIONIC_READING: "Toggle Bionic Reading"