dofile() wasn't enough to copy en_keyboard, as the references
to key popups would still be shared, and hacks to them (as
done by the FR keyboard) would be active on the EN keyboard.
Also, for the FR Keyboard:
- bring M key popup too when moving it to 2nd row.
- keep original ',' and '.' as on EN keyboard.
- add ';' instead of ',' as the added key, and let it have
some key popup too, with keys helpful when CSS editing.
Allows editing a CSS snippet to be applied to this
book only, without the need to create and edit
a User style tweak.
Allows copying any other tweak CSS by just taping
on it (and pasting into this with Hold).
Limit User style tweaks nb of items per menu page
to 6 (like we try to do for other tweaks menus).
* Update bundled fonts
* Minor FreeFont update
* Noto Sans CJK downgrade to fix a number of issues w/ the git version
* Initial import of Noto Naskh Arabic
* Replace Noto Sans Arabic UI by Noto Naskh Arabic in the CRe fallback
list
* Ensure feature-parity in ScreenSaver handling on Kindle
We were missing the fancy extra white flash and landscape handling that
most every other eInk device gets ;).
Fix#5724
* Minor SO tweaks
The "swipe to unlock" ad screen was possibly managing to seep through on
slow devices.
* Less convoluted and more consistent logic
Thanks, @yparitcher ;).
Feed to crengine the same ticks (build from the TOC
entries) that we use in the bottom status bar.
(crengine otherwise builds a tick for each DocFragment,
which most often is really different than what's seen
in the bottom bar.)
Includes:
- GIF decoding: avoid crash on some images
- Top progress bar: avoid re-computing when not needed
- Top progress bar: allow external filling of marks
- CSS/Text: properly inherit and handle text-align-last
- getRenderedWidths(): fix handling of text-indent
- Reorder some flags to make the sets clearer
- CSS: support more white-space named values
- Text: fix standalone BR not making an empty line (rework)
- CSS: support for pseudo elements ::before & ::after
- CSS: content: open-quote support via TextLangMan
- CSS/Text selection: adds a few "-cr-hint:" tweaks
cre.cpp: adds setHeaderProgressMarks()
Added 2 style tweaks to disable pseudo elements
::before/after and common ligatures.
7d139263 was preventing some features to work,
so skip it in some cases:
When toggling between top & bottom status bar (a tap
is simulated to show the bottom bar).
When in flipping mode (jumps to page at tap position).
When toggling via menu (shown only when zero tap zone).
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices.
In the reader, the right is repurposed to open the menu. Left in turn closes it.
The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back.
References <https://github.com/koreader/koreader/issues/4029>.
Iterating a k/v table as an array would have us stopped
on the first disabled MODE (frontlight, battery... on
some devices).
Rework that initial setup, and make it correctly handle
added or removed MODEs when using the ordered items
saved in the user settings.
- Fix wrong values for books opened (or first opened)
from April 14th to May 20th: highlights and notes
possibly being NULL was preventing nb of pages and
last_open from being fetched.
- Re-order current book and all books stat items to some
hopefully more sensible order.
- Some rewording for clarity.
KeyValuePage:
- Have value_overflow_align="right" only align right
when value overflows 1/2 screen width, but not
when only key overflows that.
- Show truncated text also on Tap when there is no
callback.
Includes:
- Don't reset invisible BR to display: inline
- ldomTextCollector: handle inline-block/table as inline
- Avoid re-rendering on font hinting mode change
- List markers: fix positionning when floats involved
- GIF decoding: avoid uneeded abort on LZW table overflow
- Adds getUnknownEntities(), can help with debugging
- Don't check stylesheet hashes when loading from cache
- Hardcoded elements and attributes list: cleanup
- Full rendering: 2 small optimisations
- Strut confinning: deal with images earlier
- lvtextfm: some cleanup and reordering
cre.cpp:
- fix getPageFromXPointer() and getPosFromXPointer()
to not fail on invisible nodes and work on the next
visible node (so links whose target is display:none
can work).
Add support for 2 settings one can set manually
in reader.settings.reader.lua:
["cre_background_color"] = "0xccffcc",
["cre_background_image"] = "/path/to/bg_paper.jpg",
Prevent the Tap>Hold setTimeout'ed function to trigger
on another later Tap.
Fix a Tap quickly following a Swipe (which triggers this
Tap>Hold timer) from becoming a Hold.
This number might have been leaking from a previously opened
book, and can be innacurate.
Reset it from the number of highlights stored in settings.
Note that the number of "Notes" shown does not mean much.
Using DoubleSpinWidget.
Also keep SpinWidgets open on Apply.
Added little trick: if widget has been moved, close
bottom config menu on next Apply to show more of
the book.
- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
when appropriate: when the value may have an immediate
visual effect, so one can tweak it without having to
go thru menus to re-open it again).
Make them external links so they don't trigger a "link is
invalid" popup and we can use swipe left/right to navigate
pages (and jump to latest bookmark/go back for comparing).
Mostly for the PDF bottom menu.
- Reorganize by topic, trying to limit the number
of widgets per panel to 4.
- Re-order some toggles from low to high ('off' then 'on').
- Show font size as number instead of a list of "Aa".
- PDF: add more font size values, and increase usable
contrast values.
- Add help_text to most PDF toggle titles.
- CRE line spacing: increase fine tuning min and max.
Also avoid zoom advice messages on book load.
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
Bump crengine:
- Text: fix occasional BiDi bad word splitting
- Font: fix HB fallback measurement/drawing mismatches
- Font: do not add letter spacing on diacritics
- Text: tunable use of letter spacing for justification
- Text: dont adjust space after initial quotation mark/dash (rework)
- Text: fix possible bad widths after collapsed spaces
xtext.cpp: pick crengine fix with HB fallback
measurement/drawing mismatches
Adds "Word Expansion" to bottom Font size menu, and moved
"Word Spacing" there too, to balance the panels' heights
to 4 items.
Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
Includes:
- Simplify libunibreak includes
- Text: fix read/write outside array bounds
- lvtextfm: dont adjust space after initial quotation mark/dash (rework)
- Fonts: allow providing and using multiple fallback fonts
Users can set their prefered fallback font, which will be completed
with a few of our shipped fonts for maximum coverage.
Replace Hyphenation menu with Typography menu.
This works mostly like before:
- typography/hyphenation is chosen according to the book
metadata language,
- one can set a default or a fallback language,
- hyphenation is now just a subset of typography, and
can be disabled while still setting a language and
enabling the other features,
- the typography language enables newly added features
to crengine: per-language line breaking rules and
per-language Harfbuzz glyph selection.
Includes:
- Fix a few clang-tidy warnings
- Add support for <img src="data:image/png;base64,...>
- XML parsing: add more HTML5 named entities, optimize search
- Text: fix standalone BR not making an empty line
- Fix BR with "display: block" not making an empty line
- Fix hyphens from soft-hyphens not part of highlighted segments
- Use libunibreak for line breaking
- Adds TextLangMan for text typography by language
Tweak ReaderHyphenation to work with the new TextLangMan
(even if it will be replaced soon by ReaderTypography).
bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.
Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
the GoTo and SkimTo widgets, and to use the source page
number in the standard bookmark and highlight initial text.
* Kindle FL shenanigans
Either fix#5986, or break a whole crapload of weird corner-cases.
Possibly the insane AutoFrontLight checks.
* Make fl step 0 usable on devices where 0 doesn't turn the light off.
By fudging an extra step on our own side.
* Also, add some debug logging around wmctrl to try to figure out what's
happening there...
- Add some style tweaks to allow displaying FB2 end notes
in-page too - and to allow showing them without a smaller
font size.
- Show footnote number in bold in popup footnotes.
Set these 2 tweaks as default global tweaks for new users
(and existing users that have not set any global defaults).
One can disable them by long-press on each of them.
Only per-specs EPUB and FB2 footnotes (other in-page footnotes
tweaks may trigger on non-footnote content on some books, so
let enabling them be a user decision).
Our code expects (rightfully) the TOC items to be ordered
and to have increasing page numbers, but we may occasionally
not get that from the engines (usually, because of bugs or
duplicated IDs in the document).
Check for that and fix page numbers (possibly making them
wrong) to have a working TOC.
Depending on the random ordering of bookmarks and highlights
on a same page, the binary seach could not notice that a
bookmark exists for this page.
Solve this by putting bookmark before highlights on a same
page in the list, and skip them when searching.
- FB2 footnotes are no more rendered in-page by default
- In-page rendering can be enable by the added Style tweak
- FB2 footnotes can also show in footnote popup (with
some added not-so-nice CSS so MuPDF can render them
as crengine)
Solve the issue when a font without bold and italic variants
is used as the default font (e.g. FreeSerif), and the style
tweak "Ignore publisher font-family" is used (which uses
a trick to cancel any font-family by requesting a font
named "NoSuchFont"):
When text is italic or bold, any of the registered fonts
which have a real italic or bold variant would win over our
default font, as the best substitute to NoSuchFont-Italic.
This gives our default font a bit more bias so it can
win in its scoring against the other fonts, and be rendered
as fake italic or fake bold - which will ensure consistent
font and line height.
(A bit hacky, but no alternative solution found.)
Enable new rendering feature COMPLETE_INCOMPLETE_TABLES
on all enhanced rendering mode, but have it disabled for
earlier cre_dom_version.
Also increase default_cre_storage_size_factor from 20 to 40.
Just like what's been done previously for InfoMessage.
Also tweak 'other_buttons' option (not yet used anywhere)
to allow multiple rows of such other buttons.
Adds a screensaver mode which is just a line of text at the top of the screen. Purpose is to be minimally obstructive while still displaying something to indicate the device is asleep.
Don't display a tofu glyph when meeting a tab (none of
our fonts have a glyph for it).
New parameter: TextBoxWidget.tabstop_nb_space_width,
that defaults to 8, to ensure tabstops in the usual
left aligmnent (or right when para is RTL).
* Make sure the Color menu is accessible on GrayScale device, in the event
one would have inherited a color-enabled settings from another
device...
* Warn on startup if color rendering is enabled on a grayscale device.
A non-exhaustive lists of things such a setup would break:
* same-to-same blitbuffers for pretty much every rendering engine
* same-to-same blitting codepaths and fast-paths
* software dithering in CRe
So that Statistics settings modified while in FileManager
are saved.
Also allows resetting statistics when in FileManager
(where there is no current book id to exclude).
Also adds options to remove statistics for books
with low reading duration (to clean up stats for
books just quickly browsed and not yet read).
Also adds TextWidget:getFontSizeToFitHeight()
even if we ended up not using it.
Try to limit the nb of items per menu page to 5 or 6 by
splitting related ones into sub-menus, so we get more
room below to see how they affect the content.
Adds "No indentation on first/following paragraphs" and
"Paragraphs margins and paddings", and Links underlining.
The default left margin on blockquote and dd is `40px`, but unfortunately that doesn't scale. rem is calculated using a hardcoded16px, so em or % is the best compromise in this case.
PS If we assume 1em = 16px then 40px is actually 2.5em, not 1em. This reduction in indentation is mainly intended for the benefit of smaller E Ink devices.
Closes <https://github.com/koreader/koreader/issues/5859>.
* Unbreak OTA on crappy shells
Very, very old ash versions abort on set -o failures (as mandated by
POSIX, granted). This makes it impossible to reliably catch failures in
a single step.
So do it from the Lua side instead.
Should fix#5844
* Launch the zsync wrapper through bash on Cervantes
Previous cleanup resurrected multiple class names, so
we know now the original alignment of a float.
Use them in 'web' mode, as it allows floats to be nearer
the section they are refering to, and it may limit
floats truncation in page splitting.
But keep floats aligned on a single side in 'book' mode,
as it might allow easier reading.
* Also remove the temporary files when doing a full retry
* Bump base
Pickup the required zsync2/FBInk updates
(https://github.com/koreader/koreader-base/pull/1038)
* Actually does what it says on the tin for Abort
i.e., cleanup temporary files
* remarkable: remove unnecessary screen invalidate on resume
This is handled in uimanager if needsScreenRefreshAfterResume is enabled
(which is the default).
* remarkable: pass a path argument to reader.lua
Otherwise if lastfile is not set in the settings (e.g. install and then
exit without opening a file) koreader will just refuse to start.
* remarkable: pass koreader.sh args (if any) through to reader.lua
Touchscreen is mirrored in X & Y and has a different resolution from the eink panel.
Uses systemd for time/date/suspend/poweroff/reboot
Two systemd units for platform integration. button-listen is a very
simple launcher.
to-do: add support for wifi by implementing a wpa supplicant dbus client.
Authored-by: Thomas Spurden <tcrs@users.noreply.github.com>
OPDS catalogs may have search query capabilities. It is very usefull to find a
book in huge catalog, even when they are organized as directories. This commit
provides the possibility to add a %s mark in an OPS catalog URL, that would
trigger a search box when browsing the OPDS in koreader.
* File search: Don't traverse hidden folders if we're not showing them
Re https://www.mobileread.com/forums/showpost.php?p=3949194&postcount=21
* Ignore macOS resource forks, too.
* Apply the same logic to the BookInfo directory walker
* And never ever show resource forks in the FM, either.
It's extremely confusing, as it has nothing to do with calibre catalogs,
which are actual things the user can generate manually.
What it's using instead is actually a metadata cache in a flatfile db
that's always present, as long as "Send To Device" was used to upload
the content to the device.
* Allow running Shell/Python scripts from the FM
* Show an InfoMessage before/after running the script
Since we're blocking the UI ;).
* Allow running scripts from the favorites menu, too.
Strings are prefilled by msgmerge with closely matching ones to reduce the amount of labor required by the translator. Often the string requires only minor adjustment, making the process faster, and when the string isn't a good match it's no big deal. However, these so-called fuzzy strings shouldn't be treated as if they were actually translated.
Fixes the effect seen in <https://github.com/koreader/koreader/issues/5806>.
Also reset cache when calling :enableInternalHistory(), as it solves
screen orientation change unit tests failures (although there is no
issue in regular use of the app).
* Don't store stale screen/rotation modes in book's settings!
Gyro events *may* entirely bypass the local copy...
In any case, using a local copy was essentially asking for trouble...
Actually fix#5772
(because the issue was indeed that a Gyro swap from Portrait to Inverted
Portrait wasn't stored properly).
* Allow showing ScreenSavers in Inverted Portrait.
That works just fine, and won't lead to the confusing situation where a
lefty might pick up the device as a righty because the ScreenSaver
happens to be shown that way, only to have it rotate back to its lefty
orientation on wakeup...
MuPDF does not handle "text-align: justify" correctly on
RTL text: the last line is left-aligned, but it should be
right-aligned.
Not using justify makes it correctly right align the whole
text.
Gives the book language to Text*Widget (and XText) when
drawing title, authors and other metadata text.
Might be needed to properly display a Japanese book title
when the UI language is Chinese.
Optimise usage of some of CreDocument methods by caching
their results, either globally, or per page/pos for those
whose result may depend on current page number or y-pos.
This helps a lot on cre books with a lot of highlights.
Includes:
- lvtinydom.cpp: fix Use-after-free
- lvtextfm: fix/cleanup lastnonspace code bits
- lvtextfm: fix vertical-align: top & bottom
- renderBlockElementEnhanced: minor fixes related to floats
- renderBlockElementEnhanced: compute baseline of block
- Add support for display: inline-block/inline-table
- Better selection highlighting by using getSegmentRects()
- getHtml(): add flag to get text soft-hyphenated
cre.cpp: toggable text selection highlighting method,
default to the new one using segments.
Update various cre flags to use the new features (and
to conform with some flags re-ordering):
- support display: inline-block in flat, book and web
render modes.
- get HTML with soft-hyphens for footnote popups, so MuPDF
can use them when rendering the footnote.
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
as using LTR isolates seems uneeded when already LTR" (part
of a628714f) which was a wrong assumption: we need proper
wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
trailing \n.
- Wrap all paths, directories, filenames in the code with
these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
as it helps fixing some edge cases (like open/close quotation
marks which are not considered as bracket types by FriBiDi).
(Needed some minor logic changes in CoverBrowser.)
- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
following the recent addition of the page_gap_height option.
Ellipsis was sometimes not displayed when text is right aligned,
because width was not updated with ellipsis size.
bump base/xtext: fix truncation ellipsis position in bidi text
so it stays nearer to previous logical order char, instead of
sometimes being thrown away to start or end of line.
Replaces DAUTO_SAVE_PAGING_COUNT in defaults.lua with
a new option available in menu, that allows setting
an interval in minutes instead of a page count.
The Japanese keyboard still needs to be cleaned out a bit more at some point, but the important thing is that this commit fixes#5632 by restoring the kanji layer with the voiced-unvoiced conversion symbol.
- Alias everything to Bidi.nowrap() when in LTR UI, as using
LTR isolates seems uneeded when already LTR.
- Better wrapping of RTL filename by using auto direction and
LTR-isolating only the suffix so it's always on a side.
- menu.lua: handle bidi_wrap_func outside getMenuText(), which
may be used in other contexts.
- Add BD.filepath() and BD.dirpath()
- bump crengine: (Upstream) DocX: fix paragraphs with single hyperlink
- bump fribidi to 1.0.8 (for nested isolates fix)
- xtext.makeLine(): return no_allowed_break_met=true when that
happens, so we know the line breaks inside a word.
TextBoxWidget: add forgotten property (when use_xtext=true) when no
line break opportunity was found: has_split_inside_word=true.
(Only used by CoverBrowser Mosaic mode to make nicer text covers
by reducing font size when that happens.)
Bump base for util.fsyncOpenedFile() and util.fsyncDirectory().
Use these to force flush to storage device when
saving luasetting, docsetting, and history.lua.
Also dont rotate them to .old until they are at least
60 seconds old.
Also make auto_save_paging_count count right.
Also bump crengine: open (as text) small or empty files
A few fixes and enhancement related to bold text:
- When using bold=true with a regular font, use its bold
variant if one exists (can be prevented by manually
adding a setting: "use_bold_font_for_bold" = false).
- When using a bold font without bold=true, promote bold
to true, so fallback fonts are drawn bold too.
- Whether using a bold font, or using bold=true, ensure
fallback fonts are drawn bold, with their available bold
variant if one exists, or with synthetized bold.
- When using a bold variant of a fallback font, keep using
the regular variant as another fallback (as bold fonts
may contain less glyphs than their regular counterpart).
- Allow providing bold=Font.FORCE_SYNTHETIZED_BOLD to
get synth bold even when a bold font exists (might be
interesting to get text in bold the same width as the
same text non-bold).
- Use the font realname in the key when caching glyphs,
instead of our aliases (cfont, infont...) to avoid
duplication and wasting memory.
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
and menu footers
- flip inverse_reading_order when UI is mirrored
More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
has changed (tap on top/bottom left/right corners, for
bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).
Use specific non-default ones in some specific cases:
- Force LTR text direction when showing HTML and CSS, and
configuration files (in some plugins).
- Use Wikipedia server language and text direction when
showing an article.
- Use auto with Dictionary results, as we don't know the
dictionary language, and they may contain mixed content.
- Force LTR when showing some paths (still needs more of them)
TextEditor plugin: add 2 new options "Auto paragraph direction"
and "Force paragraph direction LTR".
Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.