2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

524 Commits

Author SHA1 Message Date
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
166aa52a24 move painting and drawing debug log to verbose 2016-08-12 17:47:35 +08:00
Zijie He
820a39c8f7 Update KOSyncClient 2016-08-10 10:42:51 -07:00
chrox
1d887f4fe1 book reading statistics for djvu documents 2016-07-15 23:00:46 +08:00
chrox
551857ce6e fix some luacheck warnings 2016-06-28 00:43:23 +08:00
Qingping Hou
fe6aaca47d Merge pull request #2083 from chrox/fix_2060
fix #2060 by handling blank search pattern
2016-06-15 00:25:40 -07:00
chrox
5bbcae954e fix #2060 by handling blank search pattern 2016-06-15 02:34:46 +08:00
chrox
5983050d79 PDF free zoom mode revisit
this should implement feature request of zoom mode for multi-columns
page in #501
This PR depends on koreader/koreader-base#435

How to use?
1. Tap the top left corner of a PDF/Djvu page to get into the flipping
mode
2. Double-tap on text block will zoom in to that column
3. Double-tap on any area will zoom out to an overview of the page
4. repeat step 2 to focus to another page block

How does it work?
1. We first find the mask of text blocks in the page. (Pic 1)
2. Then we intersect page boxes with user tap to form a page block. (Pic 2)
3. Finally we zoom the page to the page block and center current view to
that block. (Pic 3)
2016-06-15 02:05:09 +08:00
Qingping Hou
c22a3747d8 fix all the tests 2016-04-19 00:01:28 -07:00
Frans de Jonge
5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 2016-04-16 12:37:08 +02:00
Qingping Hou
f48d9bd6d9 fix(readerfooter): marker ticks initialization 2016-03-18 23:24:51 -07:00
Qingping Hou
69f9ebd528 build: fix doc generation
also moved MD5 to koreader-base/ffi
2016-02-23 22:01:12 -08:00
Qingping Hou
e422842256 minor: a lot of luacheck fixes 2016-02-15 23:10:07 -08:00
Qingping Hou
59c17ef420 minor: more luacheck fixes 2016-02-15 01:33:48 -08:00
Qingping Hou
11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 2016-02-14 21:54:17 -08:00
Alex Pletnev
fbf98ed920 #1710 FR: Add support of statistics plugin for pdf 2016-02-12 16:55:02 +02:00
chrox
54f5166254 add koptinterface spec 2015-10-07 22:42:12 +08:00
chrox
8b85cbf157 add support for password protected zip/cbz documents 2015-10-06 21:18:31 +08:00
chrox
f73f8916c0 fix #1569 use fit to page zoom cover image even in reflow mode 2015-10-04 00:36:16 +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
chrox
34ea9ac574 add datastorage module to handle data directory on various platform
On kindle, kobo and pocketbook the data directory is the current
running directory but on Android the app is installed in system
defined location and users may have no access to that location.
The same circumstances should be true for the upcoming Koreader for
Ubuntu touch, so the data directory (in which tessdata, dictionaries,
global settings, persistant defaults and probably history data are
stored) could be stored in another place.
2015-06-15 16:56:27 +08:00
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
c2924abac4 Fix OCR fails on native djvu pages
The page_width and page_height were always 600 and 800 before this patch
rendering the OCR engine confused.

This should fix #1379.
2015-03-31 10:31:02 +08:00
chrox
daeefff741 fix #1433 2015-03-12 16:31:12 +08:00
chrox
5c9a9198fb add Document:fastDigest method to calculate document hash without performance overhead 2015-03-02 14:55:16 +08: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
Hans-Werner Hilse
22697adf20 switch from scaleByDPI() to scaleBySize() 2014-11-23 12:13:32 +00:00
Hans-Werner Hilse
f9f97163e8 wait for background thread before free()ing koptcontext
This should prevent freeing resources that are actually in use in
a background thread.
2014-11-22 14:44:24 +00:00
chrox
b80dd1f966 add fulltext search for PDF documents 2014-11-17 17:58:44 +08:00
Hans-Werner Hilse
5af4ccb0c4 add support for GIF and PNG to picdocument provider
needs update to latest base
2014-11-17 10:23:06 +01: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
Hans-Werner Hilse
acf6641009 fix memory calculation for cache insert decision, simplify drawing/rendering 2014-11-12 15:53:08 +01:00
Hans-Werner Hilse
5a36e5427f fixes for picdocument
picdocument didn't use the document API correctly
2014-11-11 22:32:57 +01: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
86c53f94e1 Make the suffix lowercase before comparing. 2014-11-04 19:56:11 +01:00
Andrey Golovizin
e66dbdda29 Add support for .fb2.zip files. 2014-11-04 19:11:29 +01:00
Andrey Golovizin
a08ac46e80 Move credocument before pdfdocument in the registry. 2014-11-04 18:57:09 +01:00
Andrey Golovizin
4eda3f5a17 Add support for files with multiple extensions (like .fb2.zip). 2014-11-04 18:56:19 +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
8c9751744e fix #1064 by adding timestamp of document in cache key
so that when document is modified the persistent cache will
be invalidated automatically because the cache key will not
be matched. There is no perfermance overhead here at all. We
even don't need to check the modification time of the cache item
on disk, because the name of the on disk cache is a md5sum of the
cacheitem key, now the filename of the cache files contains the
modification time information.
If the document is modified since one rendered page is cached to disk,
the cache key won't match the cache file. And the cache file will
be discarded without the need to open the cache file or to check
the modification time of the cache file itself.
2014-10-30 11:05:26 +08: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
Hans-Werner Hilse
0a74dc6072 add needed ffi module when saving annotations 2014-10-26 23:16:27 +01: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
d30709edb0 add djvu render mode options in readermenu 2014-10-15 20:31:24 +08: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
b912200951 don't share info field in document
We may have multiple documents opened simultaneously, such as in
screensaver mode the current document is opened twice, it's better
to keep seperate info table for each document.

This should fix #858. When a credocument is opened for screensaver to
get the cover page, the total pages info is set to 1(strangely enough),
before this fix this total pages is shared with the reading document
so the progress bar will get a progress percentage well beyond 100% and
rendering the progress bar out of the boundering box as shown in #858.
2014-08-28 13:30:27 +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
0bc3eadcae refactoring: use Document API getCoverPageImage to get cover image 2014-08-27 11:07:25 +08:00
chrox
092522b89d promote user to save PDF document after highlighting
This is a wordaround for #791.
2014-08-24 15:16:04 +08:00
chrox
7ce5c9c052 fix Droid Sans Fallback not registered to crengine 2014-08-23 22:46:41 +08:00
Qingping Hou
99f6298b28 Merge pull request #829 from chrox/master
markup annotation quadpoints should be defined in counterclockwise
2014-08-22 09:29:38 -07:00
chrox
7048ca971b add getCoverPageImage api for CreDocument 2014-08-22 21:32:03 +08:00
chrox
0c29b041fe markup annotation quadpoints should be defined in counterclockwise 2014-08-22 09:32:27 +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
chrox
a7fb8811f3 add floating punctuation toggler for EPUBs 2014-07-22 21:55:31 +08:00
chrox
120f18737e add advanced option forced_ocr to force ocring text 2014-07-17 22:32:20 +08:00
WS64
c1ecf23c2c Update credocument.lua 2014-07-15 12:17:19 +02:00
NiLuJe
5ebed6655b Use Noto instead of Droid, where appropriate. 2014-07-08 02:11:17 +02:00
chrox
bcd2c8e8f8 display 2 pages side-by-side in landscape for larger screen 2014-07-04 19:28:40 +08:00
chrox
9fc048ecfc considering visible page count in readerrolling
This should fix #660.
2014-07-03 17:54:35 +08:00
chrox
6cdfd322f1 update buildin font names 2014-07-02 22:47:24 +08:00
chrox
fd1bb86514 fix cannot get word box in last page of a chapter 2014-07-02 14:47:23 +08:00
chrox
53165e3c2a fix init hyphenation dictionaries 2014-06-17 21:48:07 +08:00
chrox
241d67e0ec revert zip file handler to crereader
It seems that fb2.zip is a conventional format for fb2 with compression
which cannot be handled properly by mupdf.
This should fix #642.
2014-06-16 19:47:03 +08:00
Qingping Hou
7ac5b419b5 refactor(doc): use ffi binding in picdocument 2014-06-16 02:21:49 -04:00
Paulo Matias
f04951e5dc Consider as corrupt a null-area bbox
Fixes crash with empty page_states
2014-06-11 00:17:16 -03:00
chrox
803e4e8600 font weight option should be persistent between launchings
This should fix #620.
2014-06-04 21:55:01 +08:00
chrox
5aa8eb52da add missing Blitbuffer since it's removed from global space 2014-06-02 23:49:00 +08:00
chrox
f507fd3709 various Android fix
now the android build has nearly the same features as the
Kindle/Kobo build. It's time for Android nightly build?
2014-05-29 16:07:40 +08:00
chrox
6fba40cc77 use mupdf to handle zipped image files 2014-05-25 22:28:17 +08:00
chrox
a8b7b2cdbd add base document init method to create new configurable for each document
this should fix configurables pollution when opening multiple documents
at the same time, e.g. when clipping page images in Evernote plugin.
2014-05-16 14:02:08 +08:00
chrox
17741e292b serialize cache when closing ReaderUI other than closing document 2014-05-15 19:41:10 +08:00
chrox
55734f6aaa export highlighted rect in scanned page to Evernote 2014-05-15 16:11:26 +08:00
chrox
3b1e05bb7f switch to setIntProperty api for setting page margins 2014-05-12 15:47:11 +08:00
chrox
6bf1a9d033 use setStringProperty method to set font face
This should fix #569.
2014-05-11 20:57:23 +08:00
chrox
e1527611c5 show a box indicator when tapping on a link
only for PDF/DJVU docs for now since there is no easy way
to get link box from crengine
2014-05-02 16:50:52 +08:00
chrox
30e6b3529b hide Nimbus fonts in font selecting dialog 2014-05-02 12:48:00 +08:00
chrox
775e5ea3b4 serialize the most recently used blitbuffer/koptcontext
to speedup koreader startup for PDF/DJVU documents
especially when reflowing
2014-04-30 23:24:47 +08:00
chrox
c6c4cbcab1 add dewatermark option for pdf/djvu documents 2014-04-07 00:22:47 +08:00
Qingping Hou
4b357c1466 move reader code into frontend/apps/reader
it makes more sense to completely separate the UI framework and
application code

also move frontend/ui/configurable.lua to frontend/configurable.lua
2014-04-02 17:02:01 -04:00
chrox
92219a1f1e cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
chrox
560444c168 add fallback_font option in G_reader_settings 2014-03-10 22:06:17 +08:00
chrox
0eee130f5a clipping page bbox 2014-02-16 19:49:18 +08:00
chrox
9f507e6447 add 'full/mini' options for progress bar of crereader 2014-02-12 15:43:52 +08:00
chrox
b42b4ed204 save highlight to pdf document 2014-02-09 17:51:40 +08:00
chrox
22c437c393 fix init koptcontext with all zero bbox 2014-01-23 19:35:45 +08:00
chrox
8abd8a8a1f loading KoptInterface only in pdf and djvu reader
This will save 4MB RAM in crereader which otherwise will load
liblept.so.3 and libk2pdfopt.so.2 automatically for nothing.
2014-01-22 18:34:55 +08:00
chrox
bfff863861 fix cannot highlight hyphenated words in crereader 2014-01-22 17:25:03 +08:00
Paulo Matias
c55d5e025e Avoid crash on backends which don't define getLinkFromPosition 2014-01-21 10:28:04 -02:00
chrox
d24d5e413e add following page link in reflowed page 2014-01-21 11:59:17 +08:00
chrox
9e3e070522 check link on the fly when tapping 2014-01-20 20:41:15 +08:00
Paulo Matias
dacd3d2acb Fix crash trying to select text in an empty page 2014-01-19 01:03:28 -02:00
chrox
e947f83548 fix dogear not shown properly in crereader 2014-01-18 19:18:12 +08:00
chrox
ce3b58538c fix no getPageLinks method in djvudocument 2014-01-18 15:31:27 +08:00
chrox
34e28d28e6 page links for crereader and pdfreader
Swipe right will return to previous page or position.
2014-01-18 15:04:28 +08:00
chrox
637904a711 add text highlight for credocument
Three highlight drawers "lighten", "underscore" and "invert" are
available in reader menu.
This should implement #176.
2014-01-18 03:11:04 +08:00
chrox
3275413366 add missing registry for fb2 document 2014-01-16 12:54:49 +08:00
chrox
1329f10fa5 add goto link function for CreDocument 2014-01-15 23:36:56 +08:00
chrox
a6e885e77d show battery icon in crereader page header 2014-01-04 22:30:36 +08:00
chrox
865815b42b set visible page count when loading document 2014-01-03 19:35:45 +08:00
chrox
23982b185e add debug information in credocument api 2014-01-03 11:10:06 +08:00
chrox
210293b561 add floating punctuation option for crereader
Luckily after disabling floating punctuation left/right margin
are able to be same now (with large enough margins, should be
more than 1em). So I also changed the default page margins for
crereader and removed the dirty hack.
2014-01-03 02:07:32 +08:00
chrox
eaa9535133 move logMemoryUsage from koptinterface to document 2014-01-02 19:19:03 +08:00
chrox
14e94f39a4 explicitly call free method of Blitbuffer 2014-01-02 19:03:52 +08:00
chrox
8e4516b824 add regional zoom mode in pdf/djvu page
In regional zoom mode double tap will zoom to the tapped
region(paragraph or column, etc., detected optically via libk2pdfopt).
As the first demo, this feature is only turned on in flipping mode by
tapping the top-left corner of the screen. Eventually we may incorporate
this feature in "free" zoom mode.
2014-01-02 11:14:26 +08:00
chrox
62e12ddfba import document module on-demand 2013-12-31 13:12:56 +08:00
chrox
f7387822aa handle xps files in pdfdocument backend 2013-12-29 15:52:44 +08:00
chrox
3b9eaafadd add dictionary lookup in crereader 2013-12-25 01:43:28 +08:00
chrox
7247a9e3a2 add writing direction option when reflowing
This probably will fix #195.
2013-12-22 19:13:12 +08:00
chrox
2fd66e1fa3 typo fix 2013-12-04 22:17:05 +08:00
chrox
84ad0f2307 fix null export highlight in reflowed mode 2013-11-30 21:17:13 +08:00
chrox
71cb2d3f93 fix looking up wrong word in reflowed page
that has a text layer underneath.

For multi-column page reflowing usually fits individual column to
page width and no finner word boxes are available to map reflowed
word box onto native word box. Now the relative position of a reflowed
word center is calculated as portion of the width and height of a larger
block it belongs. This relative position is also considered in
reflow-to-native position transform so that dictionary lookup now works
on multi-column pages in reflowing mode.

This should fix #376.
2013-11-30 18:18:16 +08:00
chrox
5bf56cbf4c check position nullity in getTextFromBoxes 2013-10-28 21:49:54 +08:00
chrox
2590cc7ca5 highlight text from scratch instead of reusing rectmaps in reflowing mode 2013-10-25 13:22:49 +08:00
chrox
184a6f5d21 highlight word from scratch instead of reusing rectmaps in reflowing mode
Totally revert the OCR in reflowed page to build 545.
And this should fix #309.
2013-10-24 23:45:09 +08:00
chrox
90d55cbde4 set auto detect word gap in reflowing by default 2013-10-24 23:45:09 +08:00
chrox
4cfdce6105 fix several local calls of Math.round 2013-10-23 22:37:55 +08:00
HW
09cd5c4104 Make DEBUG a require()d local 2013-10-22 20:51:29 +02:00
HW
748a443cd5 Merge remote-tracking branch 'upstream/master'
resolved conflicts with refactored structure
2013-10-22 17:19:08 +02:00
HW
2154e7e852 Further refactoring
This should finish the work to make all globals to local variables.
That allows LuaJIT to properly compile things by interning the
references to the relevant parts (rather than looking up globals
all the time which stops a trace).
2013-10-22 17:11:31 +02:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00
Qingping Hou
bc91b932d1 style cleanup in document.lua 2013-10-17 17:37:53 -04:00
Qingping Hou
a59723c053 add pic document type 2013-10-17 17:35:05 -04:00
Qingping Hou
10bf048d77 move configurable to Document class
since every document type is depend on it now
2013-10-17 17:28:20 -04:00
chrox
c86bb46ef7 add gotoLocation for credocument 2013-10-17 23:53:29 +08:00
chrox
506dbed865 save cre3.ini on closing each credocument
and page margin settings will be restored before rendering.
This patch should fix #299.
2013-10-16 23:21:20 +08:00
chrox
32ffacdf77 adjust font sizes in credocument according to screen dpi
and font sizes list is moved to defaults.lua
2013-10-16 17:06:28 +08:00
chrox
9f42289226 use pixels from reflowed page when doing OCR in reflowing mode
I hope it will get back OCR accuracy as in build 545.
2013-10-14 23:06:05 +08:00
chrox
2cd5a083ae fix getAutoBBox failed bug
If getAutoBBox is fed with a blank page the returned bbox will be
much smaller than the native page dimensions. The problem is that
in zoom to 'content*' mode document renderer will try to render
the whole page at a zoom level that can cover the screen with the
bbox region of the page. That's if the blank page size is 3000*4000
and the returned autobbox is 300*400, the screen size is 600*800,
then the page will be rendered in 3000*(600/300)*4000*(800/400)
which is so large that the cache manager will not accept.

This patch just check if the returned autobbox is considerablely
much smaller than the native page dimensions. If so it will return
the manual bbox.

This patch should fix #293. And it's tested with the case provided
by @Markismus in #291.
2013-10-14 14:21:08 +08:00
chrox
1ee6d5a9c5 add DEBUGBT function to traceback certain location 2013-10-13 21:59:24 +08:00
chrox
39da1251ec free blitbuffer as soon as tile is kicked out from cache
other than waiting for the lazy garbage collector of lua
2013-10-13 15:30:48 +08:00
chrox
4660a3532b synchronize hightlights in non-/reflowing modes
and there is no need to OCR word if we can extract text from
original page in reflowing mode thanks to the rect maps between
normal page and reflowed page.
2013-10-12 23:07:13 +08:00
chrox
ffd31613a5 estimate cache size of koptcontext
This should fix #285.
2013-09-26 14:51:33 +08:00
chrox
f2cf10a015 refactoring koptcontext creation function 2013-09-14 12:56:10 +08:00
Qingping Hou
a8a589c27b only set two pages mode for crengine in kindle dxg 2013-07-28 02:35:46 -04:00
chrox
aefb58f5bf bugfix: fix invalid auto page cropping 2013-07-20 02:51:17 +08:00
chrox
1808c7e5c3 add document language option in config dialog
Document language setting is used for better text extraction and OCR.
2013-07-20 02:46:51 +08:00
chrox
2e5d2b9930 add semi-auto bbox option in page crop dialog 2013-07-13 11:18:49 +08:00
{Qingping,Dave} Hou
c423c031b3 Merge pull request #146 from chrox/master
semi-automatic bbox finding
2013-07-09 21:16:18 -07:00
chrox
9cb9999865 semi-automatic bbox finding
Semi-automatic cropping is implemented with a initial
manual cropping that exclude the obvious decorating line or
the spine part in scanned books and then an automatic cropping
ie. background/foreground pixel detection restricted within
the manual cropping area.
This PR is a candidate for the solution of issue #141.
2013-07-09 19:15:45 +08:00
Giorgio Micotti
98a2e50652 Add cbz to the supported extensions of pdf viewer. 2013-07-09 12:32:21 +02:00
Deyuan Deng
9528f4a95b when open document, check if provider is nil 2013-07-08 23:17:06 -07:00
Qingping Hou
18122fe067 add defaults.lua 2013-07-01 02:41:33 -04:00
chrox
94526fa26d add page margin options in CREOptions 2013-06-28 17:12:04 +08:00
chrox
7c78e83e49 add hightlight/dictionary lookup in scanned pdf/djvu 2013-05-01 23:43:53 +08:00
chrox
cb873ee528 init/free OCR engine when necessary 2013-04-30 13:52:10 +08:00
chrox
1a8bd4ca8c try to drop cache before OCR 2013-04-27 17:48:59 +08:00
chrox
936dfc6fd1 add text highlight in both reflow and non-reflow mode 2013-04-24 06:59:52 +08:00
Qingping Hou
1783b16d69 credoc fix: load metadata info after document is rendered 2013-04-21 05:54:20 +08:00
chrox
ac548d768c don't bother to consume background context
since now each context is independent and has its own dst bitmap.
2013-04-20 16:12:43 +08:00
chrox
fb05f9a428 add auto page crop 2013-04-14 15:16:42 +08:00
chrox
22b650d0c7 move kopt/cre options into ui/data directory & wrap strings in config options 2013-04-08 22:26:54 +08:00
Qingping Hou
09e1c0af06 add gettext to document modules 2013-04-08 15:38:04 +08:00
Qingping Hou
f12ff20c37 discard bbox with zero area 2013-04-03 13:03:55 +08:00
chrox
b2c23c6f4f cleanup: use lowercase option name && better reflow for vertical text 2013-03-19 21:57:30 +08:00
chrox
607c4baf2e add fine tuning of font size in koptinterface 2013-03-19 21:36:11 +08:00
Qingping Hou
c5ff50abdf remove trailing spaces 2013-03-13 10:43:15 +08:00
chrox
ef68ccebfe add background hinting in koptinterface 2013-03-12 20:26:02 +08:00
chrox
591a27ddfe log reflow duration for benchmarking 2013-03-11 16:24:27 +08:00
chrox
a2dc5e00a2 bugfix: reset page scroll states when switching reflow on/off 2013-03-10 14:27:42 +08:00
chrox
63e5e7e577 add scroll mode for pdf/djvu reader 2013-03-10 14:23:26 +08:00
chrox
6561475cf7 return bbox immediately to save several CPU cycles 2013-03-10 13:15:00 +08:00
chrox
8c01b59776 clamp used bbox to page dimension 2013-03-05 16:50:04 +08:00
chrox
87eec1b539 save/restore view mode and embedded css mode 2013-03-04 23:23:37 +08:00
chrox
4c1fc6be5c make larger default page margin 2013-02-25 22:18:31 +08:00
chrox
86a65003d1 set manual cropping if bbox exists 2013-02-25 21:29:41 +08:00
chrox
c5b4d958bb add reading progress bar at the bottom of ReaderView for pdf/djvu reader
And there is also a toggle full screen option to turn on/off the progress bar.
2013-02-24 02:25:57 +08:00
chrox
14bcec4b81 remove arguments of RestoreZoomMode events defined in KoptOptions
Now zoom mode restoration is handled by ReaderKoptListener
2013-02-20 19:29:14 +08:00
chrox
9efdefb22f add gamma correction for pdf/djvu reader 2013-02-20 14:32:51 +08:00
chrox
df7f7714e4 remove default options in KoptOptions and CreOptions 2013-02-20 13:01:52 +08:00
{Qingping,Dave} Hou
e6e561ce52 Merge pull request #760 from chrox/restore_zoom_mode
restore zoom mode when toggling reflow on/off
2013-02-19 07:11:20 -08:00
chrox
666bb3d8ae restore zoom mode when toggling reflow on/off 2013-02-19 19:16:42 +08:00
chrox
78f8ca9029 cleanup: remove debug info on bbox 2013-02-19 13:28:04 +08:00
Qingping Hou
f3452234ea add math.lua, move all math related helpers in to it 2013-02-19 11:57:14 +08:00
chrox
c53f866a93 cleanup: use screen size in page hash explicitly 2013-02-12 01:15:19 +08:00
chrox
7af80f63f6 check screen mode in koptinterface 2013-02-11 00:51:55 +08:00
chrox
1f511757c5 bugfix: calculate current config value or arg at runtime 2013-02-10 20:52:44 +08:00
{Qingping,Dave} Hou
85b4d60efc Merge pull request #735 from chrox/ui-tweaks
set menu font size according to screen dpi
2013-02-05 19:40:54 -08:00
chrox
21c972a786 hide DPI dependency in Font module 2013-02-05 18:15:45 +08:00
Qingping Hou
ae6c4bd03a Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/ui/reader/readerconfig.lua
2013-02-04 15:00:17 +08:00
chrox
0ed5d05bc0 hash current bbox explicitly 2013-02-03 22:58:30 +08:00
chrox
4675a220d8 add current bbox in page rendering hash
So that changing bbox could take effect on current page.
2013-02-03 21:36:11 +08:00
Qingping Hou
f91c913530 set default_arg for screen_mode option on runtime 2013-02-03 13:17:02 +08:00
Qingping Hou
0dba667937 rename setScreenViewMode to setScreenMode 2013-02-03 13:13:46 +08:00
Qingping Hou
03b73712bc Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/document/koptinterface.lua
2013-02-03 12:34:55 +08:00
chrox
1be80d15ae code cleanup 2013-02-03 11:28:50 +08:00
chrox
1c40d127cd add icon option items in config dialog 2013-02-03 11:26:14 +08:00
chrox
25bcbfa53a set menu font size according to screen dpi 2013-02-03 05:16:19 +08:00
chrox
a1aa41136c add manual page crop for pdf/djvu documents 2013-02-03 04:42:59 +08:00
Qingping Hou
2d9534e092 add screen rotate to readerconfig 2013-02-02 17:02:36 +08:00
chrox
563fd50dc3 add toggle switch widget in config option 2013-01-25 23:53:00 +08:00
Qingping Hou
6d8ebb4126 adapt credocument to new changes in cre.cpp 2013-01-22 06:27:22 +08:00
Qingping Hou
65910b2017 add default_css to credocument 2013-01-17 17:12:20 -05:00
Qingping Hou
6c4da43dbf add setStyleSheet method to credocument 2013-01-17 16:59:40 -05:00
{Qingping,Dave} Hou
55b2d4f993 Merge pull request #714 from chrox/config_ui
some config UI changes
2013-01-15 13:39:26 -08:00
chrox
494585ce41 rename 'screen rotation' option in koptinterface to 'vertical text' 2013-01-15 19:53:57 +08:00
chrox
6ed1a9012b show more options 2013-01-15 19:11:16 +08:00
Qingping Hou
93d3aea905 pass filename properly for zipped fb2 in CreDocument:init() 2013-01-13 12:17:43 +08:00
Qingping Hou
874890aaec save and restore gamma_index for crengine 2013-01-13 12:07:20 +08:00
Qingping Hou
02ea5f1fbf read header font from config 2013-01-13 11:23:30 +08:00
Qingping Hou
687aabc173 adapt ui to loadDocument before setFont 2013-01-13 10:22:33 +08:00
Qingping Hou
789b5d57e2 read page information for crerengine 2013-01-09 16:41:42 +08:00
Qingping Hou
79839021ed Merge branch 'new_ui_code' into hint_page_fix
Conflicts:
	frontend/ui/reader/readerview.lua
2013-01-09 12:19:46 +08:00
{Qingping,Dave} Hou
b04b1e8b58 Merge pull request #690 from houqp/new_ui_houqp
font size, line space, font weight, font gamma and viewmode support for crengine
2013-01-08 20:16:11 -08:00
Qingping Hou
c8dce5f351 Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into hint_page_fix
Conflicts:
	frontend/document/document.lua
2013-01-09 11:38:49 +08:00
Qingping Hou
93cad1428c add render_mode into render hash 2013-01-09 06:06:53 +08:00
Qingping Hou
1fa0d886bd add render mode to hint page 2013-01-09 05:51:53 +08:00
chrox
c8b699c068 bugfix: check renderpg hash before hinting page 2013-01-08 17:00:18 +08:00
Qingping Hou
59a424203b add font gamma to readerconfig 2013-01-07 16:42:50 -05:00
Qingping Hou
5ce4f24c37 move CreOptions to credocument.lua 2013-01-07 12:32:33 -05:00
Qingping Hou
2fa919e1b6 add CreDocument:toggleFontBolder 2013-01-07 12:16:17 -05:00
Qingping Hou
ac1cf212d1 add setViewMode to CreDocument 2013-01-07 06:53:35 -05:00
Qingping Hou
fdc05b066c add readerconfig to document supported by crengine
* now font size can be changed by readerconfig
2013-01-06 23:21:11 -05:00
chrox
aa152a8a51 make readerconfig independent of koptoptions
So that other readers could reuse readerconfig
2013-01-06 14:01:34 +08:00
{Qingping,Dave} Hou
3ec818a3cd Merge pull request #684 from chrox/koptreader-new-ui
add reflow mode in pdf/djvu readers
2013-01-04 00:28:57 -08:00
chrox
349bcb996e use koptinterface to reflow text in pdf/djvu readers 2013-01-03 22:33:49 +08:00
chrox
e525264b01 save/restore koptconfig to setting files 2012-12-24 17:36:52 +08:00
chrox
a649301e69 make pdfreader and djvureader the defaults 2012-12-24 08:19:34 +08:00
chrox
074522a36b first usable koptreader for new UI 2012-12-24 08:16:41 +08:00
chrox
138def10c3 Demo version of koptreader config dialog. 2012-12-24 08:16:17 +08:00
Qingping Hou
93abd2fee7 add page status to readerrolling for better page view_mode support
* now when rendering in page view mode, we only keep track of page
number instead of pos inside document. Because using pos inside
document for page view mode is really a bad idea and will lead to
many unsovlabe bugs...
2012-12-22 13:27:46 +08:00
Qingping Hou
5ab98420bd use predefined variable instead of magic number for view_mode 2012-12-21 09:10:16 +08:00
Qingping Hou
efa37c97ab bug fix in readerfont
After set font in ReaderFont:onReadSettings, we have to send UpdatePos
event in order to set m_is_rendered(member of LVDocView) to true.

Otherwise position inside document will be reset to 0 on first view
render, this makes the first page of document is always displayed on
document open.

So far, I don't know why this call will alter the value of m_is_rendered.
It just works...
2012-12-21 06:00:51 +08:00
Qingping Hou
5d1c98e90a add setFontSize to credocument.lua 2012-12-17 14:50:50 +08:00
Qingping Hou
1675d8667b add cre view mode support in frontend 2012-12-13 12:41:48 +08:00
Qingping Hou
683c7eee2c handle corrupted usedbbox in Document:getUsedBBoxDimensions() 2012-12-07 16:42:27 -05:00
{Qingping,Dave} Hou
5cbbfaceff Merge pull request #649 from chrox/koptreader-new-ui
move page reflowing code to getPageDimensions method
2012-12-04 01:08:12 -08:00
chrox
fd461e4f3e move page reflowing code to getPageDimensions method 2012-12-04 10:36:36 +08:00
Qingping Hou
7b707ab367 add usedbbox support 2012-12-02 17:09:32 +08:00
Qingping Hou
7e04c97b70 bug fix for PdfDocument:getUsedBBox
when cache found, we should return cache.ubbox
not cache.data
2012-12-02 15:14:02 +08:00
chrox
aa9fe4b01c cache page size after page is reflowed
So that when page dimension is recalculated right page size
other than screen size is returned.
2012-11-29 21:58:12 +08:00
chrox
c462090600 add koptreader demo 2012-11-27 20:43:49 +08:00
Qingping Hou
e3617676a1 fix deprecated debug call in credocument.lua 2012-11-23 01:10:34 -05:00
Qingping Hou
36a4ead630 update document.lua according to API change in cre.cpp 2012-11-11 14:29:56 +08:00
Qingping Hou
ea022b651f add rendermode support for djvu documents 2012-10-09 18:26:01 -04:00
Qingping Hou
8ccbfba6cc Djvu Validate patch from tigran123
refer to commit in master(kpv) tree:
64b6ef4afd
2012-10-09 16:15:13 -04:00
Tigran Aivazian
d551e7fb63 Cleanup crereader fonts initialization.
Don't try to register the two fonts Dingbats.cff and StandardSymL.cff
with crengine because it will reject them anyway. But we cannot simply
remove these two fonts because they are used internally by mupdf to
emulate "builtin" fonts which are mandated by Adobe PDF specification to
be present in every valid implementation.
2012-10-03 13:08:27 -04:00
Qingping Hou
eb79e1c95c handle file with no extension in filechooser 2012-09-17 20:36:39 -04:00
Qingping Hou
25af917170 call cre.initCache() in CreDocument:engineInit() 2012-09-17 20:12:33 -04:00
Qingping Hou
c1ccff70ad minor adjustment for Makefile and document.lua 2012-08-25 22:52:12 +08:00
Qingping Hou
bad329811d add line space control feature for credocument 2012-06-12 21:12:04 +08:00
Qingping Hou
b3cdbeee19 add font size control feature for credocument
also rename getFont to getFontFace
2012-06-12 20:59:56 +08:00
Qingping Hou
acaf8d660e font menu for readerui 2012-06-12 17:42:28 +08:00
Qingping Hou
77761554d9 add CreDocument:engineInit() method 2012-06-12 14:52:35 +08:00
Qingping Hou
d89cbc43f9 replace getProvider with openDocument
now getProvider only returns the provider
2012-06-12 14:38:00 +08:00
Qingping Hou
2b39ba8b83 register all the supported formats for crengine 2012-06-11 23:50:11 +08:00
HW
ce5614ef6f cleanup, also removal of G_* constants
a bit of cleanup, switched width/height combo over to use
Geom() objects, moved framebuffer handling to Screen object,
callback syntax sanitizing, lots of small changes
2012-06-10 17:36:19 +02:00
Qingping Hou
e7d16de4e2 first demo for credocument 2012-06-05 15:23:36 +08:00
Qingping Hou
b40a748a78 move duplicate codes to document.lua 2012-06-03 22:26:16 +08:00
Qingping Hou
7f6773dc6f demo for djvu support
wait for code clean up
2012-06-03 11:11:15 +08:00
HW
60ccd7441e fixed menu info displaying, replaced debug() by DEBUG()
the replacement of debug() was necessary to be able to access the lua library "debug" (for backtraces etc.)
2012-05-28 18:59:16 +02:00
Qingping Hou
cf048e286d add toc menu support for readerui 2012-05-27 19:47:22 +08:00
HW
d5c7e6ccb5 factored out pdfdocument implementation 2012-05-19 01:13:53 +02:00
HW
9e531fc2db file reorganisation
all lua frontend files are now in the frontend/ directory.
all old code is cleaned up.
2012-05-19 01:10:57 +02:00