2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

131 Commits

Author SHA1 Message Date
Frans de Jonge
d714bd3aea
[feat] DocumentRegistry: add getProviders() and preferred by weight (#3651)
This is step one toward "open with".

References https://github.com/koreader/koreader/issues/3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
* Add a few image files to MuPDF
	* ".bmp",
	* ".gif",
	* ".hdp",
	* ".j2k",
	* ".jp2",
	* ".jpeg",
	* ".jpg",
	* ".jpx",
	* ".jxr",
	* ".pam",
	* ".pbm",
	* ".pgm",
	* ".png",
	* ".pnm",
	* ".ppm",
	* ".tif",
	* ".tiff",
        * ".wdp",
2018-01-31 20:49:21 +01:00
poire-z
7797c2369e
credocument: deal with loadDocument() failures (#3570)
cre:loadDocument() may fail in recognizing the document format, and
koreader would previously keep calling other methods on it, which would
make crengine segfaults. We now check loadDocument success at the
various places it is called, and try to deal the best way we can when it fails.
2018-01-03 09:43:49 +01:00
poire-z
26def92983 credocument reader optimisation (avoid multiple TOC builds) (#3292)
Avoid unnecessary work in ReaderView:onSetViewMode() and
ReaderRolling:updatePos() that would result in TOC being reset
and rebuilt (which can take time on books with huge TOC) during
reader setup.
2017-10-03 00:31:14 +02:00
poire-z
53f083f516 Allow for toggling color rendering
New menu item in Screen submenu.
hasColorScreen enabled for SDL device.
2017-10-02 00:10:29 +02:00
poire-z
180f5755f4 Allow for colored rendering (#3276)
* Allow for colored rendering

Available with all engines (CRE, PDF, Images).
Needs to manually add setting: "color_rendering" = true

* Disable color for djvudocument

* Use Screen:isColorEnabled()

* Bump base
2017-10-01 00:16:38 +02:00
poire-z
75b7c4b524 Added Font Hinting toggle (#3182) 2017-09-08 17:38:51 +02:00
poire-z
c24d75f18c Fix use of default font with font-family: styles
Base bumped.
Previsouly, parts of document in <p style="font-family: serif">
would be rendered with the first font set, and would not
follow change of font (unline other texts without styles).
That was observable with Embedded Styles set to On, but is even
more noticiable with the new Embedded Fonts setting set to off.
2017-09-02 20:49:48 +02:00
poire-z
774d2345e0 Added Embedded Fonts config toggle
Just under the existing "Embedded Styles". Support for this
was already there in crengine, and interfacing is similar to
what is done with Embedded Styles.
2017-09-02 20:49:48 +02:00
poire-z
495accfec9 Reduce memory leaks when switching credocuments
CRE cache, hyphdict and fonts can be initialized only once
when first credocument is opened. Previously, they were
recreated for each document, and as previous instances were probably
not free'd, this caused memory leaks.
2017-04-26 22:36:02 +02:00
Frans de Jonge
a6ca0f9b55 CreDocument: add "md" (Markdown) to supported filetypes
Fixes #2632.
2017-04-02 15:07:46 -07:00
Frans de Jonge
eb641b6abc squash: mono-spaced font is necessary for ASCII-art type stuff
* reordered requires
2017-04-01 16:23:56 -07:00
Frans de Jonge
e5a3ecd3e5 CreDocument: disable fancy formatting by default
It does significantly more harm than good. It can be reenabled with a `txt_preformatted` setting if desired. Fixes #1607.
2017-04-01 16:23:56 -07:00
Hzj_jie
0b29e73e2e BatteryStat plugin and instruction of KoboLight plugin (#2643)
* Start battery stat plugin

* BatteryStat & kobolight

* Several minor improvements

* Remove a useless function

* flush settings

* Some review feedbacks

* Resolve review comments

* Remaining Minutes -> Remaining Hours

* Add dump_file

* typo

* realpath

* realpath on folder

* Remove useless os.time()

* Resolve review comments

* warning

* Add BatteryStat.debugging flag

* treat log as txt

* Minor improvement

* Charging hour should be positive

* Use warn instead of info

* onSuspend in Kobo

* Charging events for kobo and kindle

* More events

* dumpOrLog

* Warnings

* Typo

* More space

* Singleton

* slightly format change

* BatteryStat singleton

* Init

* Remove debugging flag

* sleeping percentage is still negative

* Read settings

* Do not need to change was_suspending and was_charging

* Typo

* Remove debugging flag

* Not charging should happen before suspend

* Resolve review comments

* was_suspend and was_charging should be updated each time in onCallback()
2017-03-23 23:36:15 -07:00
poire-z
112e6a46e4 Fix crash when holding on unsupported image 2017-03-19 17:22:02 -07:00
poire-z
d648d2b66c Added getImageFromPosition() and isXPointerInDocument()
Bump base (depends on koreader-base PR #470)
2017-01-18 09:03:31 -08:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
chrox
1d887f4fe1 book reading statistics for djvu documents 2016-07-15 23:00:46 +08:00
Qingping Hou
c22a3747d8 fix all the tests 2016-04-19 00:01:28 -07:00
Qingping Hou
f48d9bd6d9 fix(readerfooter): marker ticks initialization 2016-03-18 23:24:51 -07:00
Qingping Hou
59c17ef420 minor: more luacheck fixes 2016-02-15 01:33:48 -08:00
chrox
a60544b1ad Koreader Ubuntu-touch port
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
2015-10-03 14:48:51 +08:00
Huang Xin
d393fbb180 Merge pull request #1628 from apletnev/#1581
Add Statistic plugin (#1581 Amount of hours spent on a book)
2015-09-16 19:55:26 +08:00
Alexander Pletnev
52d821df00 Add Statistic plugin (#1581 Amount of hours spent on a book) 2015-09-07 20:06:17 +03:00
frankyifei
23c963ed15 replace Droidsansfallback with NotoSansCJK-Regular 2015-09-04 00:15:12 +09:30
NiLuJe
3fdd90cf3b Fix a few Droid font paths 2015-04-27 22:19:11 +02:00
Qingping Hou
186673587e chore: fix some of the luacheck errors 2015-04-26 20:57:45 -04:00
chrox
077517be0b add FONTDIR env variable
to support custom font directory for EPUB documents

Now Koreader could find fonts in the "fonts" directory in the USB root
directory of kindle, Kobo and PocketBook devices, thus no need to copy
fonts to "koreader/fonts" directory.
2015-01-25 16:52:04 +08:00
chrox
fe885be563 refactoring readerbookmark to show both bookmarks and highlights
in the bookmark menu
and use binary search of the sorted bookmarks table whenever is
possible.
2014-11-27 22:01:57 +08:00
chrox
b80dd1f966 add fulltext search for PDF documents 2014-11-17 17:58:44 +08:00
Andrey Golovizin
99eecde875 Use setStringProperty method to set hyphenation dictionary. 2014-11-15 12:22:47 +01:00
Tigran Aivazian
e5e50ed0f9 Fix 1169 by registering .txt.zip/.html.zip/.htm.zip formats 2014-11-14 12:25:02 +00:00
chrox
8f5691d586 fix #968 by check the nullity of text range 2014-11-06 11:18:04 +08:00
chrox
bd0975896d add fulltext search for EPUB documents 2014-11-05 12:28:28 +08:00
Huang Xin
a300f1e981 Merge pull request #1076 from hwhw/hal
Hardware abstraction: refactoring
2014-11-05 08:36:16 +08:00
Andrey Golovizin
e66dbdda29 Add support for .fb2.zip files. 2014-11-04 19:11:29 +01:00
Hans-Werner Hilse
3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
2014-11-02 21:19:04 +01:00
chrox
c2726a8f62 save two blitbuffer memory allocations for crengine on each page turn
One for drawbuffer at CreDocument:drawCurrentView and another for
resizing of drawBuf at cre.drawCurrentPage.
2014-10-27 22:05:24 +08:00
chrox
2ff12af50c protected call of mupdf.renderImage 2014-10-23 13:49:35 +08:00
chrox
2050c0aa66 fix renderImage invocation 2014-10-21 17:22:20 +08:00
Hans-Werner Hilse
e0868826ad use new FFI based mupdf API
This will use the new API where the Lua/C interface was used before
and also drop usage of mupdfimg wrapper which is now implemented
within the mupdf interface
2014-10-20 16:49:10 +02:00
chrox
b422eb90cc refactoring readerrolling
and fix lossing progress when switching screen mode
2014-10-10 18:14:33 +08:00
chrox
7142492e42 fix #959 2014-10-07 14:05:34 +08:00
chrox
2f2d9f1bf7 issue error directly when doc is malformated
This should popup a message saying "No reader engine for this file"
instead of a crash when document file is malformated.

This should fix #868.
2014-08-29 17:17:12 +08:00
chrox
132adf8e1b register opened document in documentregistry
so that when calling getCoverPageImage in screensaver mode
the document won't be opened again. This should avoid a lot of
problem such as messing up style and options described in #863.
2014-08-28 21:03:26 +08:00
chrox
fd9e3d57f3 fix performance issue of screensaver on Kobo
now loadDocument will not render the document and getCoverPageImage will
be much faster.
2014-08-28 13:22:38 +08:00
chrox
7ce5c9c052 fix Droid Sans Fallback not registered to crengine 2014-08-23 22:46:41 +08:00
chrox
7048ca971b add getCoverPageImage api for CreDocument 2014-08-22 21:32:03 +08:00
chrox
507b989747 use pdfreader instead of crereader to handle zip files
Generally zip files are zipped pictures which should be
better handled in pdfreader.
2014-08-19 12:11:49 +08:00
chrox
b7c7287bab remove more global variables 2014-08-14 19:52:30 +08:00
chrox
38c75f8359 fix the first file in a zip is a directory will raise error in zipContentExt 2014-08-11 20:40:27 +08:00