Commit Graph

138 Commits

Author SHA1 Message Date
Arthur Tazhitdinov
bb5fd0cee2 revert isAlphabetic change 2026-01-15 22:07:43 +05:00
Arthur Tazhitdinov
f02872542f refactor: unify punctuation trimming to handle footnotes in hyphenation logic 2026-01-15 21:48:32 +05:00
Arthur Tazhitdinov
32cffaf504 Merge remote-tracking branch 'origin/master' into hyphenation-v3 2026-01-15 20:20:25 +05:00
Jonas Diemer
c1c94c0112
Feature: Show img alt text (#168)
Let's start small by showing the ALT text of IMG. This is rudimentary,
but avoids those otherwise completely blank chapters.

I feel we will need this even when we can render images if that
rendering takes >1s - I would then prefer rendering optional and showing
the ALT text first.
2026-01-15 23:21:46 +11:00
efenner
d45f355e87
feat: Add EPUB table omitted placeholder (#372)
## Summary

* **What is the goal of this PR?**: Fix the bug I reported in
https://github.com/daveallie/crosspoint-reader/issues/292
* **What changes are included?**: Instead of silently dropping table
content in EPUBs., replace with an italicized '[Table omitted]' message
where tables appear.

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
  specific areas to focus on).

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**PARTIALLY **_

---------

Co-authored-by: Evan Fenner <evan@evanfenner.com>
Co-authored-by: Warp <agent@warp.dev>
2026-01-15 23:14:59 +11:00
Arthur Tazhitdinov
810d4acffd update SECTION_FILE_VERSION 2026-01-14 23:42:54 +05:00
Arthur Tazhitdinov
baa2aff2b2 refactor: Streamline hyphenation logic by consolidating fallback break handling 2026-01-14 23:32:56 +05:00
Arthur Tazhitdinov
8d41b46eff Merge remote-tracking branch 'origin/master' into hyphenation-v3 2026-01-14 23:13:11 +05:00
Arthur Tazhitdinov
10fa0cc060 use language hyphenator for overfit words 2026-01-14 22:56:12 +05:00
Arthur Tazhitdinov
04a084f6c8 refactor: Simplify break information handling in buildExplicitBreakInfos and enhance clarity in liangBreakIndexes 2026-01-14 19:17:29 +05:00
Arthur Tazhitdinov
5dab3d4fcf refactor: Reorder parameters in createSectionFile for clarity 2026-01-14 18:17:06 +05:00
Arthur Tazhitdinov
268d215cbb refactor: Replace cached hyphenator function with static member variable 2026-01-14 18:11:19 +05:00
Arthur Tazhitdinov
85a737fd82 default min suffix/prefix length 3 for english 2026-01-14 17:59:36 +05:00
Maeve Andrews
e517945aaa
Add a bullet to the beginning of any <li> (#368)
Currently there is no visual indication whatsoever if something is in a
list. An `<li>` is essentially just another paragraph.

As a partial remedy for this, add a bullet character to the beginning of
`<li>` text blocks so that the user can see that they're list items.
This is incomplete in that an `<ol>` should also have a counter so that
its list items can get numbers instead of bullets (right now I don't
think we track if we're in a `<ul>` or an `<ol>` at all), but it's
strictly better than the current situation.

Co-authored-by: Maeve Andrews <maeve@git.mail.maeveandrews.com>
2026-01-14 23:23:03 +11:00
Maeve Andrews
489220832f
Only indent paragraphs for justify/left-align (#367)
Currently, when Extra Paragraph Spacing is off, an em-space is added to
the beginning of each ParsedText even for blocks like headers that are
centered. This whitespace makes the centering slightly off. Change the
calculation here to only add the em-space for left/justified text.

Co-authored-by: Maeve Andrews <maeve@git.mail.maeveandrews.com>
2026-01-14 23:21:48 +11:00
Jonas Diemer
1c027ce2cd
Skip BOM character (sometimes used in front of em-dashes) (#340)
## Summary

Skip BOM character (sometimes used in front of em-dashes) - they are not
part of the glyph set and would render `?` otherwise.

---

### AI Usage

Did you use AI tools to help write this code? _**YES**_
2026-01-14 22:38:30 +11:00
Eunchurn Park
fecd1849b9
Add cover image display in *Continue Reading* card with framebuffer caching (#200)
## Summary

* **What is the goal of this PR?** (e.g., Fixes a bug in the user
authentication module,

Display the book cover image in the **"Continue Reading"** card on the
home screen, with fast navigation using framebuffer caching.

* **What changes are included?**

- Display book cover image in the "Continue Reading" card on home screen
- Load cover from cached BMP (same as sleep screen cover)
- Add framebuffer store/restore functions (`copyStoredBwBuffer`,
`freeStoredBwBuffer`) for fast navigation after initial render
- Fix `drawBitmap` scaling bug: apply scale to offset only, not to base
coordinates
- Add white text boxes behind title/author/continue reading label for
readability on cover
- Support both EPUB and XTC file cover images
- Increase HomeActivity task stack size from 2048 to 4096 for cover
image rendering

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks, specific areas to
focus on).

- Performance: First render loads cover from SD card (~800ms),
subsequent navigation uses cached framebuffer (~instant)
- Memory: Framebuffer cache uses ~48KB (6 chunks × 8KB) while on home
screen, freed on exit
- Fallback: If cover image is not available, falls back to standard
text-only display
- The `drawBitmap` fix corrects a bug where screenY = (y + offset) scale
was incorrectly scaling the base coordinates. Now correctly uses screenY
= y + (offset scale)
2026-01-14 21:24:02 +11:00
Arthur Tazhitdinov
3f9d84dafb clang format fix 2026-01-14 01:12:00 +05:00
Arthur Tazhitdinov
0e29640699 fix: Update BOOK_CACHE_VERSION to 5 2026-01-14 01:07:18 +05:00
Arthur Tazhitdinov
43ebe9c66e fix: Enhance Latin letter case conversion and improve isLatinLetter function 2026-01-13 23:51:17 +05:00
Arthur Tazhitdinov
4097319286 fix 2026-01-13 18:48:42 +05:00
Arthur Tazhitdinov
f457ed021d Merge remote-tracking branch 'origin/master' into hyphenation-v3 2026-01-13 18:41:56 +05:00
Dave Allie
8f3df7e10e
fix: Handle EPUB 3 TOC to spine mapping when nav file in subdirectory (#332)
## Summary

- Nav file in EPUB 3 file is a HTML file with relative hrefs
- If this file exists anywhere but in the same location as the
content.opf file, navigating in the book will fail
- Bump the book cache version to rebuild potentially broken books

## Additional Context

- Fixes https://github.com/daveallie/crosspoint-reader/issues/264

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code?

- [ ] Yes
- [ ] Partially
- [x] No
2026-01-13 00:57:34 +11:00
Jonas Diemer
a9242fe61f
Generate different .bmp for cropped covers so settings have effect. (#330)
Addresses
https://github.com/daveallie/crosspoint-reader/pull/225#issuecomment-3735150337
2026-01-12 20:55:47 +11:00
Arthur Tazhitdinov
51bc4810ec remove unused hasOnlyAlphabetic function from HyphenationCommon 2026-01-10 02:33:22 +05:00
Arthur Tazhitdinov
4aa0424fe6 refactor 2026-01-09 23:34:28 +05:00
Arthur Tazhitdinov
ed3a427b64 refactor 2026-01-09 23:20:04 +05:00
Arthur Tazhitdinov
163fae57ec hypher tries 2026-01-09 22:38:27 +05:00
Arthur Tazhitdinov
18fb14271c clang format fix 2026-01-09 20:55:59 +05:00
Arthur Tazhitdinov
0b3e029484 switch to trie packed liang hyphenation dictionaries 2026-01-09 20:54:31 +05:00
Arthur Tazhitdinov
c83fd37286 clang format fix 2026-01-08 15:40:17 +05:00
Arthur Tazhitdinov
3ef2448f72 optimization 2026-01-08 03:27:27 +05:00
Arthur Tazhitdinov
58314e9efd optimization 2026-01-08 03:01:36 +05:00
Arthur Tazhitdinov
34d2b81f40 Remove script method from hyphenator classes to streamline language-specific hyphenation logic 2026-01-08 02:42:24 +05:00
Arthur Tazhitdinov
8822e83394 clang format fix 2026-01-08 02:33:40 +05:00
Arthur Tazhitdinov
61d0e1cadf Add language support to Epub metadata and hyphenation logic 2026-01-08 02:32:52 +05:00
Arthur Tazhitdinov
4f94cf2c36 support for soft hyphens 2026-01-07 22:44:26 +05:00
Arthur Tazhitdinov
8cbf24d12f clang format fix 2026-01-07 20:43:22 +05:00
Arthur Tazhitdinov
f589c60690 Merge branch 'master' into hyphenation-v2 2026-01-07 20:42:53 +05:00
Arthur Tazhitdinov
8580277131 improve explicit hyphen breaking logic 2026-01-07 20:36:06 +05:00
Arthur Tazhitdinov
7e541b9f3b add comments 2026-01-07 20:25:34 +05:00
Dave Allie
2b12a65011
Remove HTML entity parsing (#274)
## Summary

* Remove HTML entity parsing
  * This has been completely useless since the introduction of expat
* expat tries to parse all entities in the document, but only knows of
HTML ones
* Parsing will never end with HTML entities in the text, so the
additional step to parse them that we had went completely unused
* We should figure out the best way to parse that content in the future,
but for now remove that module as it generates a lot of heap allocations
with its map and strings
2026-01-07 23:08:43 +11:00
Arthur Tazhitdinov
2315513ca1 Refactor hyphenation logic to return detailed break information, enhancing line breaking capabilities 2026-01-07 03:54:43 +05:00
Arthur Tazhitdinov
f998180353 clang format fix 2026-01-07 03:17:33 +05:00
Arthur Tazhitdinov
07f1786ff2 Enhance hyphenation logic to allow fallback breaks for better line breaking in ParsedText 2026-01-07 03:15:38 +05:00
Arthur Tazhitdinov
f0ea0b4d5b Fix header size calculation to include hyphenationEnabled in Section.cpp 2026-01-07 03:04:05 +05:00
Arthur Tazhitdinov
81ad6fa6c4 refactor 2026-01-07 02:34:58 +05:00
Arthur Tazhitdinov
54669a8fd4 clang format fix 2026-01-07 02:14:57 +05:00
Arthur Tazhitdinov
e46a271c12 Implement hyphenation support and refactor line break calculations 2026-01-07 02:14:01 +05:00
Arthur Tazhitdinov
22c15cbbca fixed parameter order 2026-01-07 02:12:52 +05:00