Commit Graph

261 Commits (7210fb478d8d0c6aa5bb8e0ae3e0fc67dd730874)

Author SHA1 Message Date
poire-z 5f13e68966
bump crengine: line-height: reworked implemenation (#4835)
Includes:
- Revert "line-height: fix handling and inheritance"
- Revert "line-height: switch base from 16 to 256 for more granularity"
- CSS: parse "normal" keyword length
- line-height: reworked implemenation for better conformance
- 2-pages mode: fix middle margin sizing
5 years ago
NiLuJe 645d41eda9
Add more granularity in line-height settings with CRe (#4785)
70 -> 130, in steps of 5 ;).
5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago
Qingping Hou 4d8da96177 fix test 5 years ago
Frans de Jonge 614cbb509d
[fix] ReaderFooter: Don't hide progressbar if it's the only ticked option (#4648)
Fixes #3914.

Cf. #3056.
5 years ago
Frans de Jonge ba4bf7243d
[chore] Deprecate TapForward/TapBackward (#4689)
Also fix previous page action in gesture manager.
5 years ago
Frans de Jonge 87b6217696
[fix, spec] readerrolling_spec: rename onDoubleTapForward/Backward to GotoNextChapter/PrevChapter (#4693)
See https://github.com/koreader/koreader/pull/4692#issuecomment-468689490
5 years ago
Frans de Jonge 89fe3e3051 [spec] Fix defaults_spec
Updated for https://github.com/koreader/koreader/pull/4691

Also the assert.is_same() argument order was wrong.
The first argument is expected, the second the real-life result.
Otherwise the error message in case of failure is misleading.
5 years ago
Frans de Jonge cd3ca88316
[spec] Even more TimeVal coverage (#4674) 5 years ago
Frans de Jonge 626d7340f3
[spec] Add more TimeVal tests (#4672)
That should please CodeCov.
5 years ago
Frans de Jonge abba7ba873
[fix] TimeVal: add dbg:guard against incorrect subtraction order (#4669)
In principle, any negative subtraction result should be caused by a logical error.
5 years ago
Frans de Jonge 8abf79b497
[spec] Add GestureDetector stub (#4614)
Cf. #4613.
5 years ago
NiLuJe 011370882f [chore] Some Wi-Fi tweaks (#4564)
* On Kobo, kill WiFi on startup if we detect an inconsistent state...

Untested, not terribly pretty.

The other solution is to slow down the Wi-Fi meny by doing the same
check for the "Wi-Fi connection" checkbox as in the later wifi_status
one...

* Don't enable auto_restore_wifi by default

It's liable to silently murder batteries for no good reason, given that
we prompt to enable WiFi by default when needed, and we otherwise have
no actual need to keep WiFi on in the background.

re #2215 (in particular, this directly contradicts @houqp in
https://github.com/koreader/koreader/pull/2215#discussion_r74696133 ;)).
5 years ago
poire-z f2a9ed0b79
bump crengine: count nb of images drawn & others (#4542)
Includes:
- Update french hyphenation pattern
- epub.css: update style for 'blockquote'
- DrawBuf: count nb of images and surface drawn

Adds Document:getDrawnImagesStatistics() to help deciding
if refresh with (possibly costly) dithering should be used
(on devices with HW dithering capabilities) with CreDocument:
when a page contains enough images to benefit from it.
5 years ago
NiLuJe d113cb9475
A few Kobo input tweaks (#4450)
* Fix the Touch input probe on Trilogy devices that depend on the touch_probe_ev_epoch_time quirk (fix #630)
* Expose a "Pageturn button inversion" feature in the Navigation menu (for all devices with keys) (fix #4446)
* Allow ignoring the accelerometer on the Forma (Screen > Ignore accelerometer rotation events; also available from the Gesture Manager) (fix #4451)
* Fix SleepCover handling on the Forma (fix #4457)
* Make isWifiOn a tiny bit more accurate (check the actual WiFi module instead of sdio_wifi_pwr)
* Move all flash related Screen options to the eInk submenu
5 years ago
poire-z 22b7f17cd8 Fix translator, enable selected text translation
Update translator.lua to use a still working google translate API.
Add a method to show translations (main and alternates) in
a TextViewer.
Re-enable "Translate" button in text selection/highlight buttons
dialog.
Target language can be set with a manually added setting:
    translator_target_language = "fr"
and will fallback to the UI language.
5 years ago
Frans de Jonge 1cba60765b
[feat] MenuSorter: add sorting_hint support (#4399)
By adding a `sorting_hint` to a menu item, the program will put orphaned items in the relevant (sub)menu instead of in the first menu with a NEW prefix.

Fixes #4393.
5 years ago
NiLuJe f020b1264a
A few Kindle fixes (#4394)
* Implement isWifiOn on Kindle (fix #4380)
* Ensure frontlight intensity is properly restored on resume on Kindle. (fix #Fix #4392)
Only actually matters when the frontlight is *off*.
5 years ago
poire-z 98c3f0d366
bump crengine: fix max image height, handle <epub:switch> (#4390)
Includes:
- (Upstream) Fix dangerous compile warnings
- Fix max image height to prevent spurious page breaks
- Hide <epub:case> in <epub:switch>, show only <epub:default>

Adds a style tweak to show <epub:case> and hide <epub:default>
for the curious person.
5 years ago
poire-z ea946d52d6 bump crengine: tables rendering improvements and others
bump crengine, which includes:
- Adds support for symbol fonts (local or embedded)
- Fix some issues when rendering text in constrained width
- Page splitting: fix possible missing blocks
- CSS: adds support for 'auto', ignore % for borders
- Fix right border drawing position
- Fix: adds missing properties in copystyle()
- Adds comments, erm_killed rendering method
- Adds getRenderedWidths(): get node min/max node content width
- Tables rendering: fixes and improvements
- getRenderedWidths: enable min_width to be a single CJK char
- Fix wrong text wrap avoid in some case
- epub.css: add style for 'blockquote'
- Fix rendering issue when line ends with an image

Adds a few style tweaks related to tables.

Enforce table width: 100% in Wikipedia EPUBs to keep
previous look, which feels better with the various kinds
of tables in Wikipedia pages.

Fix unit tests as juliet.epub (full of blockquotes), grew quite
a few pages with the epub.css update.
5 years ago
Frans de Jonge f71627cf1d [spec] Version: slight refactor 6 years ago
Frans de Jonge be32144829 [fix] Version pattern: add two extra numbers for point release
Also see #4303.
6 years ago
Frans de Jonge 42548939bc
[spec] version_spec: forget about rev and commit (#4303)
Stable doesn't have them.
6 years ago
poire-z 233f375af4 Cleanup onSetStatusLine()
Follow up to fa0117bb (#4268), to make things a bit clearer:
Only ReaderRolling get the 'SetStatusLine' event, and tells
crengine about the change, and then send the 'UpdatePos' event.
ReaderFooter now just gets a :setVisible() method.

Now, all the code that calls a self.ui.document:set* method, that
most probably triggers a full re-rendering by crengine, do signal
'UpdatePos' immediately after. This event signals that all page
number, pages count, positions... are no more valid and must be
queried or computed again.
This could also be used if we ever want to cache Page Links or
Screen Boxes: this event will have us dropped these caches.
6 years ago
poire-z fa0117bb2a Fix default not being used for View mode and Progress bar
Default setting set by holding on the bottom config buttons
for "View mode" (scroll/page) and "Progress bar" (full/mini)
were not used.

Also, when switching Progress bar from 'full' to 'mini',
show the mini bar again.
6 years ago
Martín Fernández 717184f1d6 move e-ink related settings to a submenu (#4246) 6 years ago
poire-z d8d0def122
Floating punctuation: change default to disabled (#4101)
It was enabled by default, but it's mostly only needed for CJK users.
Furthermore, when floating punctuation is enabled, some rendering
issues exist (text right alignment, variable margins...) that
only CJK developpers could really fix. So, best to disable it and
avoid these rendering issues for most users.

Also: fix CoverBrowser crash when "Delete cache database"
followed by "Prune cache of removed books".
6 years ago
NiLuJe 8089d916a5
Visual feedback around tar/zsync on Kobo during OTA updates (#4043)
* With a bonus version normalizer fix.
  * And a zsync bump/fix to avoid softlocks with OpenStack HTTP frontends (also, pull those from the OTA mirror list).
6 years ago
sebastien 71ff69ec4f cre word gap: use values from defaults.lua (#4045) 6 years ago
poire-z d8e58a08fd
bump crengine: adds support for dpi-based css units (#4040)
Adds a new toggle to the bottom menu: Zoom (dpi), which
allows for scaling CSS absolute units and image sizes.
6 years ago
Robert f372dd752b Unit tests: word gap - space condensing (#4036) 6 years ago
Robert d29a65b96e cre: add Word Gap setting to bottom config panel (#4026)
Maps to crengine's Space Condensing feature (named Word Gap
as a similar feature is named for PDF)
6 years ago
NiLuJe 2f3d1c80dd
Minimal KOA2 support (#4016)
* Minimal KOA2 support
(Touch, Screen, Battery). Hopefully :).
6 years ago
poire-z b9141897a3
bump crengine: text formatting: fix leading spaces issues (#4008)
Includes:
- text formatting: fix leading spaces issues
- new English US & GB hyph patterns
6 years ago
poire-z 9a0728e421
Style menu cleanup (#3996)
Use epub.css as the main default style, with all file formats
except FB2 (which needs fb2.css).
(epub.css has been cleaned recently to be more conforming to HTML
specs and to not include class name based styles - with conditional
compatiblity styles for previously opened documents. It should be
usable on all HTML based documents, except FB2 which has some
incompatible specs.)

Consider all shipped css files other than "epub.css" and "fb2.css"
obsolete, and put them in a sub-menu (these other css files have
not been updated in the same way, and are kept as-is for when a
previously opened document requests one of them).

Add an icon indicating which style is set as default (like it's
been done for the Font and Style tweaks menus).

Also set the font size of the full status bar (available with
cre documents) when the setting "cre_header_status_font_size"
is present in settings.reader.lua (to add manually).
6 years ago
poire-z 14e77306b7
Fix unit tests after crengine update (#3993) 6 years ago
NiLuJe e3b7524d9c Another round of Kobo Fixes (#3939)
* Trim unneeded stuff from startup script

I was somehow convinced I'd already done that...
While we're there, explain why we need to siphon those specific vars

* Fix a stray eth0

-> $INTERFACE

* Be very very sure we have INTERFACE set in our env

re #3936

* Make getFirmwareVersion less fragile on Kobo

Not that we actually use it right now, but, still. :D

* Use the same syntax as the PRODUCT check

* Actually implement getProductId

Instead of a stray c/p ^^

* Properly identify the Rev2/Mark7 variants of existing devices

Namely, the H2O² and Aura SE
Not that the H2O²r2 support is still broken, this just allows us to
implement it cleanyl without breaking handling of the original H2O²

re #3925

* Tweak sleeps a bit around Kobo WiFi modules...

See if that jog things up (re #3936)

* Try harder not to suspend with WiFi on on Kobos

Because otherwise, things go boom. (re #3936)
6 years ago
poire-z 62630706bb
bump base/crengine: stylesheet handling improvements (#3934)
Includes:
- Fix a few CSS selector issues
- CSS: add support for some pseudo-classes
- Hyphenation: update fr & de patterns
- CSS: Fix non-lowercasing of specific elements names
- Revert parts of recent BR handling fixes
6 years ago
poire-z 8b2253b3e9
bump base: crengine, freetype, libjpeg-turbo (#3928)
Includes:
- [build] FreeType: bump to 2.9.1
- [build] bump libjpeg-turbo to 1.5.3
- bump crengine:
 - Fix CSS selector specificity computation
 - [fix] crengine/src/lvfntman.cpp: improve letter_spacing limit
 - [fix] crengine/src/lvxml.cpp: add all empty HTML elements
 - html head styles: fix styles not being applied
 - Hyphenation: increase MAX_PATTERN_SIZE from 16 to 35
 - html documents: proper handling of <BR> tags
 - Allows requesting old (broken) XML/DOM building code
- cre.cpp: setStyleSheet(): accept filepath and/or css text,
  and added getIntProperty() and getStringProperty()

credocument/readerrolling: request older XML/DOM building code
for books previously opened, to not lose bookmarks and highlights

(unit tests update because of new handling of consecutive BR via css
pushed links down in the book)
6 years ago
Robert 9e67c5a614 CloudStorage: Allow use reserved characters in FTP username and FTP password (#3924)
Depends on RFC 3986 compliant util.urlEncode() and adds unit tests for the new functions.
6 years ago
Frode Austvik f12f317e9d [spec] Replace custom assert[Not]AlmostEquals with assert.is[_not].near (#3885)
Also, change "make static-check" to also check the tests.
6 years ago
poire-z 82b13a64b0
Fix overlap in scroll mode for cre documents (#3870)
Use a setting 'copt_overlap_lines' (default to 1) for the
number of text lines from previous page to show on next
page (instead of a hardcoded and unscaled 20).
Take footer height into account for overlap calculation
and dim area.
Show overlap only when changing pages (not when panning).

Also fix ReaderFooter:getHeight() which was returning
a higher height than the real one since footer refactoring.
6 years ago
Frans de Jonge 2c1178896c
[feat] Add ReaderBack (#3821)
This implements a reasonable facsimile of going back on Android.

The back button first goes back in a history of visited pages.
When there's no history left, it closes the app.

Fixes #3816.
6 years ago
onde2rock 1b91470899 [FocusManager] More intuitive key navigation + spec (#3774)
FocusManager now finds the closest widget on the right or left on inner horizontal border.

See : https://github.com/koreader/koreader/pull/3765#issuecomment-373944897
6 years ago
poire-z c93bbec40d
cre: more constrast settings (#3737)
Use ButtonProgress like it was done for kopt.
6 years ago
Frans de Jonge e15a1ab1b3
[fix, spec] InputText:addChars() unicode handling (#3729)
Also rename from `addChar` to `addChars` for clarity.

Fixes #3703.
6 years ago
Frans de Jonge 8633d4bed1
[spec] Input test stub (#3701) 6 years ago
Frans de Jonge 720fd5d826
[spec] Test all aspects of Math module (#3683) 6 years ago
Frans de Jonge ced9e45d92
[fix] DocumentRegistry: don't create empty sdr and add hasProvider() (#3675)
As suggested by @poire-z https://github.com/koreader/koreader/pull/3653#issuecomment-364663156
6 years ago
poire-z 5357fdde7c
cre full text search: fix inconsistencies (#3656)
Fix various inconsitencies: some occurences not highlighted
on displayed page; different occurences highlighted on same
page wheter we went there searching backward or forward; pages
with occurences simply just skipped when searching in one
direction, and not in the other...
To avoid edge cases, crengine will now give back results on up
to 3 pages, that we need to filter.
Bump base and crengine
6 years ago