Commit Graph

524 Commits (master)

Author SHA1 Message Date
chrox 92219a1f1e cleanup: expand tab to 4 spaces 10 years ago
chrox 560444c168 add fallback_font option in G_reader_settings 10 years ago
chrox 0eee130f5a clipping page bbox 10 years ago
chrox 9f507e6447 add 'full/mini' options for progress bar of crereader 10 years ago
chrox b42b4ed204 save highlight to pdf document 10 years ago
chrox 22c437c393 fix init koptcontext with all zero bbox 10 years ago
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.
10 years ago
chrox bfff863861 fix cannot highlight hyphenated words in crereader 10 years ago
Paulo Matias c55d5e025e Avoid crash on backends which don't define getLinkFromPosition 10 years ago
chrox d24d5e413e add following page link in reflowed page 10 years ago
chrox 9e3e070522 check link on the fly when tapping 10 years ago
Paulo Matias dacd3d2acb Fix crash trying to select text in an empty page 10 years ago
chrox e947f83548 fix dogear not shown properly in crereader 10 years ago
chrox ce3b58538c fix no getPageLinks method in djvudocument 10 years ago
chrox 34e28d28e6 page links for crereader and pdfreader
Swipe right will return to previous page or position.
10 years ago
chrox 637904a711 add text highlight for credocument
Three highlight drawers "lighten", "underscore" and "invert" are
available in reader menu.
This should implement #176.
10 years ago
chrox 3275413366 add missing registry for fb2 document 10 years ago
chrox 1329f10fa5 add goto link function for CreDocument 10 years ago
chrox a6e885e77d show battery icon in crereader page header 11 years ago
chrox 865815b42b set visible page count when loading document 11 years ago
chrox 23982b185e add debug information in credocument api 11 years ago
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.
11 years ago
chrox eaa9535133 move logMemoryUsage from koptinterface to document 11 years ago
chrox 14e94f39a4 explicitly call free method of Blitbuffer 11 years ago
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.
11 years ago
chrox 62e12ddfba import document module on-demand 11 years ago
chrox f7387822aa handle xps files in pdfdocument backend 11 years ago
chrox 3b9eaafadd add dictionary lookup in crereader 11 years ago
chrox 7247a9e3a2 add writing direction option when reflowing
This probably will fix #195.
11 years ago
chrox 2fd66e1fa3 typo fix 11 years ago
chrox 84ad0f2307 fix null export highlight in reflowed mode 11 years ago
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.
11 years ago
chrox 5bf56cbf4c check position nullity in getTextFromBoxes 11 years ago
chrox 2590cc7ca5 highlight text from scratch instead of reusing rectmaps in reflowing mode 11 years ago
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.
11 years ago
chrox 90d55cbde4 set auto detect word gap in reflowing by default 11 years ago
chrox 4cfdce6105 fix several local calls of Math.round 11 years ago
HW 09cd5c4104 Make DEBUG a require()d local 11 years ago
HW 748a443cd5 Merge remote-tracking branch 'upstream/master'
resolved conflicts with refactored structure
11 years ago
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).
11 years ago
HW ef111b99c6 Refactored to use strictly locals 11 years ago
Qingping Hou bc91b932d1 style cleanup in document.lua 11 years ago
Qingping Hou a59723c053 add pic document type 11 years ago
Qingping Hou 10bf048d77 move configurable to Document class
since every document type is depend on it now
11 years ago
chrox c86bb46ef7 add gotoLocation for credocument 11 years ago
chrox 506dbed865 save cre3.ini on closing each credocument
and page margin settings will be restored before rendering.
This patch should fix #299.
11 years ago
chrox 32ffacdf77 adjust font sizes in credocument according to screen dpi
and font sizes list is moved to defaults.lua
11 years ago
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.
11 years ago
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.
11 years ago
chrox 1ee6d5a9c5 add DEBUGBT function to traceback certain location 11 years ago
chrox 39da1251ec free blitbuffer as soon as tile is kicked out from cache
other than waiting for the lazy garbage collector of lua
11 years ago
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.
11 years ago
chrox ffd31613a5 estimate cache size of koptcontext
This should fix #285.
11 years ago
chrox f2cf10a015 refactoring koptcontext creation function 11 years ago
Qingping Hou a8a589c27b only set two pages mode for crengine in kindle dxg 11 years ago
chrox aefb58f5bf bugfix: fix invalid auto page cropping 11 years ago
chrox 1808c7e5c3 add document language option in config dialog
Document language setting is used for better text extraction and OCR.
11 years ago
chrox 2e5d2b9930 add semi-auto bbox option in page crop dialog 11 years ago
{Qingping,Dave} Hou c423c031b3 Merge pull request #146 from chrox/master
semi-automatic bbox finding
11 years ago
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.
11 years ago
Giorgio Micotti 98a2e50652 Add cbz to the supported extensions of pdf viewer. 11 years ago
Deyuan Deng 9528f4a95b when open document, check if provider is nil 11 years ago
Qingping Hou 18122fe067 add defaults.lua 11 years ago
chrox 94526fa26d add page margin options in CREOptions 11 years ago
chrox 7c78e83e49 add hightlight/dictionary lookup in scanned pdf/djvu 11 years ago
chrox cb873ee528 init/free OCR engine when necessary 11 years ago
chrox 1a8bd4ca8c try to drop cache before OCR 11 years ago
chrox 936dfc6fd1 add text highlight in both reflow and non-reflow mode 11 years ago
Qingping Hou 1783b16d69 credoc fix: load metadata info after document is rendered 11 years ago
chrox ac548d768c don't bother to consume background context
since now each context is independent and has its own dst bitmap.
11 years ago
chrox fb05f9a428 add auto page crop 11 years ago
chrox 22b650d0c7 move kopt/cre options into ui/data directory & wrap strings in config options 11 years ago
Qingping Hou 09e1c0af06 add gettext to document modules 11 years ago
Qingping Hou f12ff20c37 discard bbox with zero area 11 years ago
chrox b2c23c6f4f cleanup: use lowercase option name && better reflow for vertical text 11 years ago
chrox 607c4baf2e add fine tuning of font size in koptinterface 11 years ago
Qingping Hou c5ff50abdf remove trailing spaces 11 years ago
chrox ef68ccebfe add background hinting in koptinterface 11 years ago
chrox 591a27ddfe log reflow duration for benchmarking 11 years ago
chrox a2dc5e00a2 bugfix: reset page scroll states when switching reflow on/off 11 years ago
chrox 63e5e7e577 add scroll mode for pdf/djvu reader 11 years ago
chrox 6561475cf7 return bbox immediately to save several CPU cycles 11 years ago
chrox 8c01b59776 clamp used bbox to page dimension 11 years ago
chrox 87eec1b539 save/restore view mode and embedded css mode 11 years ago
chrox 4c1fc6be5c make larger default page margin 11 years ago
chrox 86a65003d1 set manual cropping if bbox exists 11 years ago
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.
11 years ago
chrox 14bcec4b81 remove arguments of RestoreZoomMode events defined in KoptOptions
Now zoom mode restoration is handled by ReaderKoptListener
11 years ago
chrox 9efdefb22f add gamma correction for pdf/djvu reader 11 years ago
chrox df7f7714e4 remove default options in KoptOptions and CreOptions 11 years ago
{Qingping,Dave} Hou e6e561ce52 Merge pull request #760 from chrox/restore_zoom_mode
restore zoom mode when toggling reflow on/off
11 years ago
chrox 666bb3d8ae restore zoom mode when toggling reflow on/off 11 years ago
chrox 78f8ca9029 cleanup: remove debug info on bbox 11 years ago
Qingping Hou f3452234ea add math.lua, move all math related helpers in to it 11 years ago
chrox c53f866a93 cleanup: use screen size in page hash explicitly 11 years ago
chrox 7af80f63f6 check screen mode in koptinterface 11 years ago
chrox 1f511757c5 bugfix: calculate current config value or arg at runtime 11 years ago
{Qingping,Dave} Hou 85b4d60efc Merge pull request #735 from chrox/ui-tweaks
set menu font size according to screen dpi
11 years ago
chrox 21c972a786 hide DPI dependency in Font module 11 years ago
Qingping Hou ae6c4bd03a Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/ui/reader/readerconfig.lua
11 years ago
chrox 0ed5d05bc0 hash current bbox explicitly 11 years ago
chrox 4675a220d8 add current bbox in page rendering hash
So that changing bbox could take effect on current page.
11 years ago
Qingping Hou f91c913530 set default_arg for screen_mode option on runtime 11 years ago
Qingping Hou 0dba667937 rename setScreenViewMode to setScreenMode 11 years ago
Qingping Hou 03b73712bc Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into rotate
Conflicts:
	frontend/document/koptinterface.lua
11 years ago
chrox 1be80d15ae code cleanup 11 years ago
chrox 1c40d127cd add icon option items in config dialog 11 years ago
chrox 25bcbfa53a set menu font size according to screen dpi 11 years ago
chrox a1aa41136c add manual page crop for pdf/djvu documents 11 years ago
Qingping Hou 2d9534e092 add screen rotate to readerconfig 11 years ago
chrox 563fd50dc3 add toggle switch widget in config option 11 years ago
Qingping Hou 6d8ebb4126 adapt credocument to new changes in cre.cpp 11 years ago
Qingping Hou 65910b2017 add default_css to credocument 11 years ago
Qingping Hou 6c4da43dbf add setStyleSheet method to credocument 11 years ago
{Qingping,Dave} Hou 55b2d4f993 Merge pull request #714 from chrox/config_ui
some config UI changes
12 years ago
chrox 494585ce41 rename 'screen rotation' option in koptinterface to 'vertical text' 12 years ago
chrox 6ed1a9012b show more options 12 years ago
Qingping Hou 93d3aea905 pass filename properly for zipped fb2 in CreDocument:init() 12 years ago
Qingping Hou 874890aaec save and restore gamma_index for crengine 12 years ago
Qingping Hou 02ea5f1fbf read header font from config 12 years ago
Qingping Hou 687aabc173 adapt ui to loadDocument before setFont 12 years ago
Qingping Hou 789b5d57e2 read page information for crerengine 12 years ago
Qingping Hou 79839021ed Merge branch 'new_ui_code' into hint_page_fix
Conflicts:
	frontend/ui/reader/readerview.lua
12 years ago
{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
12 years ago
Qingping Hou c8dce5f351 Merge branch 'new_ui_code' of github.com:hwhw/kindlepdfviewer into hint_page_fix
Conflicts:
	frontend/document/document.lua
12 years ago
Qingping Hou 93cad1428c add render_mode into render hash 12 years ago
Qingping Hou 1fa0d886bd add render mode to hint page 12 years ago
chrox c8b699c068 bugfix: check renderpg hash before hinting page 12 years ago
Qingping Hou 59a424203b add font gamma to readerconfig 12 years ago
Qingping Hou 5ce4f24c37 move CreOptions to credocument.lua 12 years ago
Qingping Hou 2fa919e1b6 add CreDocument:toggleFontBolder 12 years ago
Qingping Hou ac1cf212d1 add setViewMode to CreDocument 12 years ago
Qingping Hou fdc05b066c add readerconfig to document supported by crengine
* now font size can be changed by readerconfig
12 years ago
chrox aa152a8a51 make readerconfig independent of koptoptions
So that other readers could reuse readerconfig
12 years ago
{Qingping,Dave} Hou 3ec818a3cd Merge pull request #684 from chrox/koptreader-new-ui
add reflow mode in pdf/djvu readers
12 years ago
chrox 349bcb996e use koptinterface to reflow text in pdf/djvu readers 12 years ago
chrox e525264b01 save/restore koptconfig to setting files 12 years ago
chrox a649301e69 make pdfreader and djvureader the defaults 12 years ago
chrox 074522a36b first usable koptreader for new UI 12 years ago
chrox 138def10c3 Demo version of koptreader config dialog. 12 years ago
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...
12 years ago
Qingping Hou 5ab98420bd use predefined variable instead of magic number for view_mode 12 years ago
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...
12 years ago
Qingping Hou 5d1c98e90a add setFontSize to credocument.lua 12 years ago
Qingping Hou 1675d8667b add cre view mode support in frontend 12 years ago
Qingping Hou 683c7eee2c handle corrupted usedbbox in Document:getUsedBBoxDimensions() 12 years ago
{Qingping,Dave} Hou 5cbbfaceff Merge pull request #649 from chrox/koptreader-new-ui
move page reflowing code to getPageDimensions method
12 years ago
chrox fd461e4f3e move page reflowing code to getPageDimensions method 12 years ago
Qingping Hou 7b707ab367 add usedbbox support 12 years ago
Qingping Hou 7e04c97b70 bug fix for PdfDocument:getUsedBBox
when cache found, we should return cache.ubbox
not cache.data
12 years ago
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.
12 years ago
chrox c462090600 add koptreader demo 12 years ago
Qingping Hou e3617676a1 fix deprecated debug call in credocument.lua 12 years ago
Qingping Hou 36a4ead630 update document.lua according to API change in cre.cpp 12 years ago
Qingping Hou ea022b651f add rendermode support for djvu documents 12 years ago
Qingping Hou 8ccbfba6cc Djvu Validate patch from tigran123
refer to commit in master(kpv) tree:
64b6ef4afd
12 years ago
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.
12 years ago
Qingping Hou eb79e1c95c handle file with no extension in filechooser 12 years ago
Qingping Hou 25af917170 call cre.initCache() in CreDocument:engineInit() 12 years ago
Qingping Hou c1ccff70ad minor adjustment for Makefile and document.lua 12 years ago
Qingping Hou bad329811d add line space control feature for credocument 12 years ago
Qingping Hou b3cdbeee19 add font size control feature for credocument
also rename getFont to getFontFace
12 years ago
Qingping Hou acaf8d660e font menu for readerui 12 years ago
Qingping Hou 77761554d9 add CreDocument:engineInit() method 12 years ago
Qingping Hou d89cbc43f9 replace getProvider with openDocument
now getProvider only returns the provider
12 years ago
Qingping Hou 2b39ba8b83 register all the supported formats for crengine 12 years ago
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
12 years ago
Qingping Hou e7d16de4e2 first demo for credocument 12 years ago
Qingping Hou b40a748a78 move duplicate codes to document.lua 12 years ago
Qingping Hou 7f6773dc6f demo for djvu support
wait for code clean up
12 years ago
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.)
12 years ago
Qingping Hou cf048e286d add toc menu support for readerui 12 years ago
HW d5c7e6ccb5 factored out pdfdocument implementation 12 years ago
HW 9e531fc2db file reorganisation
all lua frontend files are now in the frontend/ directory.
all old code is cleaned up.
12 years ago