Commit Graph

7200 Commits (04d9a557aabbb49cd70bcc7de1579d7e9b56c145)
 

Author SHA1 Message Date
poire-z 04d9a557aa Use fsync() for more robust setting files saving
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
4 years ago
poire-z 1e1ceedd4d [i18n] Add translator notes for footer letter prefixes 4 years ago
Mustafa Ali Mutlu 7b0b5d5ba7 [fix] Crash when exporting notes (#5677)
Fixes https://github.com/koreader/koreader/issues/5609
4 years ago
poire-z 55f3575a10
UI font rendering: use available bold fonts for bold (#5675)
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.
4 years ago
yparitcher b578d8aa8b Fix continuous scroll & footer overlap (#5657)
closes  #5654

like #5620 but for continuous mode.
4 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
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
4 years ago
poire-z 36ce82d8c2 [RTL UI] update low-level widgets to handle mirroring
These updated low-level widgets will handle 90%
of the needed UI mirroring.
4 years ago
poire-z d6d49a64a7 [RTL UI] use auto or LTR text direction in some specific cases
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.
4 years ago
poire-z 866c9571df [RTL UI] adds bidi.lua, bootstrap UI mirroring with RTL languages
Set default language (for Harfbuzz to pick up localized glyphs
in a font), default text direction, and UI element mirroring
depending on the UI language.
4 years ago
poire-z 08a5275984 reader.lua: re-order sections in a more logical order
Hardware first, then canvas & fonts, and then the UI widgets
as late as possible.
4 years ago
poire-z 3c280f6e5f KeyValuePage: proper padding between key and value
Use some HorizontalSpan for padding between key and value,
instead of prepending a space to the value text (which
won't work as expected if value text is RTL, as it would
be put on the right side of screen).
4 years ago
poire-z ef08f50336 DictQuickLookup: properly truncate title text 4 years ago
Martín Fernández a5069f1c26 android: make system fonts toggable (#5670)
Also add droid font back to android and remove the workaround
4 years ago
Martín Fernández bd793d1ddd bump android-luajit-launcher 4 years ago
Martín Fernández 72e5574ca7 android: allow overrides on 3rd party dictionary list 4 years ago
Frans de Jonge d167b74823
Transifex pull on release build (#5674)
There's some delay on the Weblate end. Partially reverts #5507. Fixes #5673.
4 years ago
poire-z 016df709af CoverBrowser: list mode: fix overlap of directories and nb items 4 years ago
poire-z e9032a2b2a TextBoxWidget: slightly better cursor positionning in RTL text 4 years ago
poire-z 588c35967f TextBoxWidget: minor optimisations
It's best to do all free'ing via :free(), and not :onCloseWidget(),
as :free() is more logically called in cascade when upper widgets
are closed.
4 years ago
poire-z d34a17f3c6 bump crengine: fix possible crash with backward search
Includes:
- CSS: remove invalid and unused item in selector enum
- Fix possible crash with backward search
Also:
- xtext: adds getParaDirection()
- xtext: fix occasionally wrong measured width
4 years ago
Mihai Vasiliu e8f91ab399 [UX] ru keyboard ё popup and translation (#5662)
Changes in this commit:
- Fix arrays to large (10 elements instead of 8) copied from the old keyboard system.  Issue introduced in #5610 
- Add ё popup.
- Change shift key as per #5659 (for both ro and ru keyboards)
- Translate Russian space and symbol keys.
- Rename Sym key to 123
4 years ago
poire-z 3d191490d0
Touch zones: fix loss of overrides when re-registering a zone (#5658)
Happens with "Inverse reading order", which re-registers
the Reader tap forward/backward zones and would prevent
tap menu and bookmark from working.
Before, when removing them, we would lose all the override=
set on them by other touch zones (tap menu, bookmarks...),
and so they were no more ensured after re-adding the zone.
So, make sure we don't lose that info.
4 years ago
Mihai Vasiliu 2541440bb8 [UX] Add Romanian keyboard layout (#5660)
This adds a new separate Romanian keyboard layout, with popup support.

- Functional buttons are translated.
- Pages 5&6 contain 3 groups of characters (I tried my best to group them logically):
  - On the left: traditional Romanian cyrillic pre-1850s
  - On the middle latinised forms from 1850s onwards
  - On the right modern diacritics from 1900s to today
- Pages 7&8 add only large double quotes and section/paragraph mark.
- Popups are only avalable for most common diacritics. Swipe up for circumflex, swipe down for breve.

I can really call this the most complete though-the-ages Romanian keyboard. :)
4 years ago
Mihai Vasiliu 849bd951ed [UX] Add Moldavian diacritics to ru_keyboard (#5652)
Added Ӂӂ on the Russian layout popup for Moldavian.
4 years ago
poire-z a1247160a1 TextWidget: minor optimisations
Also fix possible crash with NumberPickerWidget.
5 years ago
poire-z 5541d5f5d3 bump crengine: word spacing and hyphenation tweaks
Includes:
- New option to tune word spacing: space width scale percent
- Text: look for hyphenation in more words if needed
- CSS: fix "hyphens:none" should override inherited "hyphens:auto"
- getHtml(): grab dir= and lang= attributes from upper nodes

Replace our Word Gap/Space condensing toggle/setting with
a new Word Spacing toggle/setting, made of 2 values:
- 1st number scales the normal width of spaces in all font
  (100% uses the font space width untouched)
- 2nd number applies after the 1st has been applied, and
  tells how much these spaces can additionally be condensed
  to make more text fit on a line.
5 years ago
Robert e4dd1826fa Translate file size unit (#5651)
Close #5649
5 years ago
Robert 494b38e9c8 [fix] Dictionary font size: avoid crash in reader mode (#5650) 5 years ago
Robert b0738960df Dictionary: add menu item to set font size (#5647) 5 years ago
Frans de Jonge 79b00667af
Bump base for a few dependencies (#5636)
* Bump FBInk to v1.20.3
* Bump LodePNG to 11/20/19
* Minor ffi.util cleanups (koreader/koreader-base#1015)
* thirdparty/libffi v3.3 (koreader/koreader-base#1017)
5 years ago
poire-z 397211644d Keyboard: properly handle keyboard layout height change
The japanese keyboard being taller than the others, when
switching to/from it from/to another layout:
- re-init InputDialog for proper sizing and positionning
- refresh the whole screen, to remove any trace of
  a previous taller keyboard

Also add calls to :free() here and there to free keyboard
keys' TextWidgets' XText C objects without waiting for GC.
5 years ago
poire-z 13fa6d962c Korean keyboard: unwrap InputText on layout change
The korean keyboard wraps InputText and overrides some
of its methods to process input in some specific way.
When switching to another keyboard layout, the original
methods need to be restored.
5 years ago
poire-z 7b4b06f557 CoverBrowser: Mosaic: only left-align for File browser
Left align partially filled rows for File browser/chooser, but
have them centered for History and Favorites for a prettier
look when only a few items are displayed.
5 years ago
Martín Fernández 5a28cbd630 android: add /sdcard/fonts 5 years ago
Martín Fernández 5fb03475c5 revert #5493 - show android mountpoint on system stats 5 years ago
Robert a96114d14a Remove DRCOUNTMAX (#5644) 5 years ago
Robert 830fc790f1 Battery stats plugin: fix and improvements (#5626)
- fix incorrectly shown awake, sleeping, charging and discharging,
- remove unneeded debug mode and logging to external file,
- prevent showing values like inf, -inf, nan in estimated times
  (we now show "n/a"), and values below zero,
- show extra confirm box when we want to reset data,
- show time in format xxhxxm instead of only pure minutes,
- check at initialization that the device was charging when it was
  turned off (battery level larger than at the time of exit).
5 years ago
Robert 2161a76ea8 fix util.secondsToHClock when hmsFormat is true (#5640) 5 years ago
Robert d93206a841 Remove DCREREADER_PROGRESS_BAR (#5641) 5 years ago
NiLuJe 4778d3db3b
[RFC] Switch remaining keyboard icons to glyphs (#5639)
* Switch the last few remaining icons to true glyphs
(Del/Backspace & Enter).
Also, allow a glyph to be rendered in (fake) bold, and use it for Enter.
* Update fonts
Pickup the tweaked nerdfonts for the backspace symbol
5 years ago
Frans de Jonge 0cbceca98a
Bump luajit-launcher (#5637)
For eink: more devices https://github.com/koreader/android-luajit-launcher/pull/197
5 years ago
poire-z 085d162f23 CoverBrowser: Mosaic: fix alignment on non-fully filled rows 5 years ago
poire-z f410315f83 Screensaver: avoid crash when no lastfile 5 years ago
NiLuJe d8e0b1759b
Other minor frontend.util cleanups (#5629)
* Resync fixUtf8 w/ upstream
* Fix lastIndexOf desc
* Drop unichar usage, it's a crappier unicodeCodepointToUtf8 ;).
5 years ago
poire-z 4740ab1fdc
bump crengine: round FT metrics, split text drawing by script (#5628)
Includes:
- Fonts: round FT metrics instead of floor'ing them
- Fonts: switch to no hinting when native hinting fails
- Fonts: fix issue with Harfbuzz fallback font drawing
- Text: split measuring and word drawing by unicode script
- Page splitting: fix small memory leak
- Fix "background-color: black" ignored on inline elements
- Fix decoding of recent MOBI files
- Hardcoded elements list: add <font>
base/xtext.cpp: small cleanup, no logic change
5 years ago
NiLuJe e0f14a336e
Rewrite unicodeCodepointToUtf8 w/ bitopt (#5625)
* Rewrite unicodeCodepointToUtf8 w/ bitopt

Avoids costly divs & modulos
5 years ago
Frans de Jonge da5f3c0d53
Bump base (#5623)
* [chore] thirdparty patch file dependencies https://github.com/koreader/koreader-base/pull/1012
* Revert "[fix] MuPDF Android font dir patch update https://github.com/koreader/koreader-base/pull/1013

Fixes #5617.
5 years ago
yparitcher 6d3e7fcef6 [fix] PDF footer margins (#5620)
closes #5612 

the change in `ReaderView:recalculate()` causes the viewable page size to be calculated by not including the footer, causing the text not to get cut off.

since the page area was not drawing under the footer `ReaderView:drawPageSurround()` had to be fixed to draw the margin under the footer so when tapping the footer off the area should be dran the background color.
5 years ago
Robert 03fda96041 [fix] Empty directory path and crash on TextWidget (#5606) 5 years ago
Frans de Jonge 7775233688
[fix] Prevent xtext crash by not freeing TextWidget prematurely (#5616)
Fixes <https://github.com/koreader/koreader/issues/5614>.
5 years ago