From c6c4cbcab1acee495b3e55cfabd41c2dd13084b8 Mon Sep 17 00:00:00 2001 From: chrox Date: Mon, 7 Apr 2014 00:22:47 +0800 Subject: [PATCH 1/3] add dewatermark option for pdf/djvu documents --- frontend/document/koptinterface.lua | 124 +++++++++++++++++++--------- frontend/ui/data/koptoptions.lua | 9 +- frontend/ui/data/strings.lua | 1 + koreader-base | 2 +- 4 files changed, 96 insertions(+), 40 deletions(-) diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 212798073..e36c58ffb 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -54,7 +54,7 @@ function KoptInterface:createContext(doc, pageno, bbox) local kc = KOPTContext.new() local screen_size = Screen:getSize() local lang = doc.configurable.doc_language - if lang == "chi_sim" or lang == "chi_tra" or + if lang == "chi_sim" or lang == "chi_tra" or lang == "jpn" or lang == "kor" then kc:setCJKChar() end @@ -110,7 +110,7 @@ end --[[ auto detect bbox --]] -function KoptInterface:getAutoBBox(doc, pageno) +function KoptInterface:getAutoBBox(doc, pageno) local native_size = Document.getNativePageDimensions(doc, pageno) local bbox = { x0 = 0, y0 = 0, @@ -125,7 +125,8 @@ function KoptInterface:getAutoBBox(doc, pageno) local kc = self:createContext(doc, pageno, bbox) --DEBUGBT() --DEBUG("getAutoBBox:native page size", native_size) - local x0, y0, x1, y1 = page:getAutoBBox(kc) + page:getPagePix(kc) + local x0, y0, x1, y1 = kc:getAutoBBox() local w, h = native_size.w, native_size.h if (x1 - x0)/w > 0.1 or (y1 - y0)/h > 0.1 then bbox.x0, bbox.y0, bbox.x1, bbox.y1 = x0, y0, x1, y1 @@ -156,7 +157,8 @@ function KoptInterface:getSemiAutoBBox(doc, pageno) local page = doc._document:openPage(pageno) local kc = self:createContext(doc, pageno, bbox) local auto_bbox = {} - auto_bbox.x0, auto_bbox.y0, auto_bbox.x1, auto_bbox.y1 = page:getAutoBBox(kc) + page:getPagePix(kc) + auto_bbox.x0, auto_bbox.y0, auto_bbox.x1, auto_bbox.y1 = kc:getAutoBBox() auto_bbox.x0 = auto_bbox.x0 + bbox.x0 auto_bbox.y0 = auto_bbox.y0 + bbox.y0 auto_bbox.x1 = auto_bbox.x1 + bbox.x0 @@ -232,7 +234,9 @@ end function KoptInterface:renderPage(doc, pageno, rect, zoom, rotation, gamma, render_mode) if doc.configurable.text_wrap == 1 then - return self:renderreflowedPage(doc, pageno, rect, zoom, rotation, render_mode) + return self:renderReflowedPage(doc, pageno, rect, zoom, rotation, render_mode) + elseif doc.configurable.page_opt == 1 then + return self:renderOptimizedPage(doc, pageno, rect, zoom, rotation, render_mode) else return Document.renderPage(doc, pageno, rect, zoom, rotation, gamma, render_mode) end @@ -241,8 +245,8 @@ end --[[ inherited from common document interface render reflowed page into tile cache. ---]] -function KoptInterface:renderreflowedPage(doc, pageno, rect, zoom, rotation, render_mode) +--]] +function KoptInterface:renderReflowedPage(doc, pageno, rect, zoom, rotation, render_mode) doc.render_mode = render_mode local bbox = doc:getPageBBox(pageno) local context_hash = self:getContextHash(doc, pageno, bbox) @@ -257,16 +261,54 @@ function KoptInterface:renderreflowedPage(doc, pageno, rect, zoom, rotation, ren -- whole page won't fit into cache error("aborting, since we don't have enough cache for this page") end - local page = doc._document:openPage(pageno) -- prepare cache item with contained blitbuffer local tile = TileCacheItem:new{ size = fullwidth * fullheight / 2 + 64, -- estimation excerpt = Geom:new{ w = fullwidth, h = fullheight }, pageno = pageno, - bb = Blitbuffer.new(fullwidth, fullheight) } - page:rfdraw(kc, tile.bb) + tile.bb = kc:dstToBlitBuffer() + Cache:insert(renderpg_hash, tile) + return tile + else + return cached + end +end + +--[[ +inherited from common document interface +render optimized page into tile cache. +--]] +function KoptInterface:renderOptimizedPage(doc, pageno, rect, zoom, rotation, render_mode) + doc.render_mode = render_mode + local bbox = doc:getPageBBox(pageno) + local context_hash = self:getContextHash(doc, pageno, bbox) + local renderpg_hash = "renderoptpg|"..context_hash..zoom + + local cached = Cache:check(renderpg_hash) + if not cached then + local page_size = Document.getNativePageDimensions(doc, pageno) + local bbox = { + x0 = 0, y0 = 0, + x1 = page_size.w, + y1 = page_size.h, + } + local kc = self:createContext(doc, pageno, bbox) + local page = doc._document:openPage(pageno) + kc:setZoom(zoom) + page:getPagePix(kc) page:close() + DEBUG("optimizing page", pageno) + kc:optimizePage() + local fullwidth, fullheight = kc:getPageDim() + -- prepare cache item with contained blitbuffer + local tile = TileCacheItem:new{ + size = fullwidth * fullheight / 2 + 64, -- estimation + excerpt = Geom:new{ w = fullwidth, h = fullheight }, + pageno = pageno, + } + tile.bb = kc:dstToBlitBuffer() + kc:free() Cache:insert(renderpg_hash, tile) return tile else @@ -277,6 +319,8 @@ end function KoptInterface:hintPage(doc, pageno, zoom, rotation, gamma, render_mode) if doc.configurable.text_wrap == 1 then self:hintReflowedPage(doc, pageno, zoom, rotation, gamma, render_mode) + elseif doc.configurable.page_opt == 1 then + self:renderOptimizedPage(doc, pageno, nil, zoom, rotation, gamma, render_mode) else Document.hintPage(doc, pageno, zoom, rotation, gamma, render_mode) end @@ -310,7 +354,9 @@ end function KoptInterface:drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma, render_mode) if doc.configurable.text_wrap == 1 then - self:drawReflowedPage(doc, target, x, y, rect, pageno, zoom, rotation, render_mode) + self:drawContextPage(doc, target, x, y, rect, pageno, zoom, rotation, render_mode) + elseif doc.configurable.page_opt == 1 then + self:drawContextPage(doc, target, x, y, rect, pageno, zoom, rotation, render_mode) else Document.drawPage(doc, target, x, y, rect, pageno, zoom, rotation, gamma, render_mode) end @@ -320,7 +366,7 @@ end inherited from common document interface draw cached tile pixels into target blitbuffer. --]] -function KoptInterface:drawReflowedPage(doc, target, x, y, rect, pageno, zoom, rotation, render_mode) +function KoptInterface:drawContextPage(doc, target, x, y, rect, pageno, zoom, rotation, render_mode) local tile = self:renderPage(doc, pageno, rect, zoom, rotation, render_mode) --DEBUG("now painting", tile, rect) target:blitFrom(tile.bb, @@ -364,7 +410,7 @@ function KoptInterface:getReflowedTextBoxes(doc, pageno) local kc = self:waitForContext(cached.kctx) --kc:setDebug() local fullwidth, fullheight = kc:getPageDim() - local boxes = kc:getReflowedWordBoxes(0, 0, fullwidth, fullheight) + local boxes = kc:getReflowedWordBoxes("dst", 0, 0, fullwidth, fullheight) Cache:insert(hash, CacheItem:new{ rfpgboxes = boxes }) return boxes end @@ -388,7 +434,7 @@ function KoptInterface:getNativeTextBoxes(doc, pageno) local kc = self:waitForContext(cached.kctx) --kc:setDebug() local fullwidth, fullheight = kc:getPageDim() - local boxes = kc:getNativeWordBoxes(0, 0, fullwidth, fullheight) + local boxes = kc:getNativeWordBoxes("dst", 0, 0, fullwidth, fullheight) Cache:insert(hash, CacheItem:new{ nativepgboxes = boxes }) return boxes end @@ -398,7 +444,7 @@ function KoptInterface:getNativeTextBoxes(doc, pageno) end --[[ -get text boxes in reflowed page via optical method, +get text boxes in reflowed page via optical method, i.e. OCR pre-processing in Tesseract and Leptonica. --]] function KoptInterface:getReflowedTextBoxesFromScratch(doc, pageno) @@ -414,7 +460,7 @@ function KoptInterface:getReflowedTextBoxesFromScratch(doc, pageno) local fullwidth, fullheight = reflowed_kc:getPageDim() local kc = self:createContext(doc, pageno) kc:copyDestBMP(reflowed_kc) - local boxes = kc:getNativeWordBoxes(0, 0, fullwidth, fullheight) + local boxes = kc:getNativeWordBoxes("dst", 0, 0, fullwidth, fullheight) Cache:insert(hash, CacheItem:new{ scratchrfpgboxes = boxes }) kc:free() return boxes @@ -425,7 +471,7 @@ function KoptInterface:getReflowedTextBoxesFromScratch(doc, pageno) end --[[ -get text boxes in native page via optical method, +get text boxes in native page via optical method, i.e. OCR pre-processing in Tesseract and Leptonica. --]] function KoptInterface:getNativeTextBoxesFromScratch(doc, pageno) @@ -442,7 +488,7 @@ function KoptInterface:getNativeTextBoxesFromScratch(doc, pageno) kc:setZoom(1.0) local page = doc._document:openPage(pageno) page:getPagePix(kc) - local boxes = kc:getNativeWordBoxes(0, 0, page_size.w, page_size.h) + local boxes = kc:getNativeWordBoxes("src", 0, 0, page_size.w, page_size.h) Cache:insert(hash, CacheItem:new{ scratchnativepgboxes = boxes }) page:close() kc:free() @@ -453,7 +499,7 @@ function KoptInterface:getNativeTextBoxesFromScratch(doc, pageno) end --[[ -get page regions in native page via optical method, +get page regions in native page via optical method, --]] function KoptInterface:getPageRegions(doc, pageno) local bbox = doc:getPageBBox(pageno) @@ -510,7 +556,7 @@ function KoptInterface:getReflewOCRWord(doc, pageno, rect) if cached then local kc = self:waitForContext(cached.kctx) local ok, word = pcall( - kc.getTOCRWord, kc, + kc.getTOCRWord, kc, "dst", rect.x, rect.y, rect.w, rect.h, self.tessocr_data, self.ocr_lang, self.ocr_type, 0, 1) Cache:insert(hash, CacheItem:new{ rfocrword = word }) @@ -527,6 +573,7 @@ get word from OCR in native page function KoptInterface:getNativeOCRWord(doc, pageno, rect) self.ocr_lang = doc.configurable.doc_language local hash = "ocrword|"..doc.file.."|"..pageno..rect.x..rect.y..rect.w..rect.h + DEBUG("hash", hash) local cached = Cache:check(hash) if not cached then local bbox = { @@ -541,10 +588,11 @@ function KoptInterface:getNativeOCRWord(doc, pageno, rect) page:getPagePix(kc) local word_w, word_h = kc:getPageDim() local ok, word = pcall( - kc.getTOCRWord, kc, + kc.getTOCRWord, kc, "src", 0, 0, word_w, word_h, self.tessocr_data, self.ocr_lang, self.ocr_type, 0, 1) Cache:insert(hash, CacheItem:new{ ocrword = word }) + DEBUG("word", word) page:close() kc:free() return word @@ -606,7 +654,7 @@ function KoptInterface:getWordFromBoxes(boxes, pos) local wb = boxes[i][j] if lb and wb then local box = Geom:new{ - x = wb.x0, y = lb.y0, + x = wb.x0, y = lb.y0, w = wb.x1 - wb.x0, h = lb.y1 - lb.y0, } @@ -648,7 +696,7 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1) local lb = boxes[i] if i > i_start and i < i_stop then local line_box = Geom:new{ - x = lb.x0, y = lb.y0, + x = lb.x0, y = lb.y0, w = lb.x1 - lb.x0, h = lb.y1 - lb.y0, } @@ -656,7 +704,7 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1) elseif i == i_start and i < i_stop then local wb = boxes[i][j_start] local line_box = Geom:new{ - x = wb.x0, y = lb.y0, + x = wb.x0, y = lb.y0, w = lb.x1 - wb.x0, h = lb.y1 - lb.y0, } @@ -664,7 +712,7 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1) elseif i > i_start and i == i_stop then local wb = boxes[i][j_stop] local line_box = Geom:new{ - x = lb.x0, y = lb.y0, + x = lb.x0, y = lb.y0, w = wb.x1 - lb.x0, h = lb.y1 - lb.y0, } @@ -673,7 +721,7 @@ function KoptInterface:getTextFromBoxes(boxes, pos0, pos1) local wb_start = boxes[i][j_start] local wb_stop = boxes[i][j_stop] local line_box = Geom:new{ - x = wb_start.x0, y = lb.y0, + x = wb_start.x0, y = lb.y0, w = wb_stop.x1 - wb_start.x0, h = lb.y1 - lb.y0, } @@ -713,23 +761,23 @@ get word and word box from position in reflowed page ]]-- function KoptInterface:getWordFromReflowPosition(doc, boxes, pos) local pageno = pos.page - + local scratch_reflowed_page_boxes = self:getReflowedTextBoxesFromScratch(doc, pageno) local scratch_reflowed_word_box = self:getWordFromBoxes(scratch_reflowed_page_boxes, pos) --DEBUG("word box from scratch", scratch_reflowed_word_box) - + local reflowed_page_boxes = self:getReflowedTextBoxes(doc, pageno) local reflowed_word_box = self:getWordFromBoxes(reflowed_page_boxes, pos) --DEBUG("word box from reflow", reflowed_word_box) - + local reflowed_pos_abs = scratch_reflowed_word_box.box:center() local reflowed_pos_rel = getBoxRelativePosition(scratch_reflowed_word_box.box, reflowed_word_box.box) --DEBUG("word box absolote center", reflowed_pos_abs) --DEBUG("word box relative center", reflowed_pos_rel) - + local native_pos = self:reflowToNativePosTransform(doc, pageno, reflowed_pos_abs, reflowed_pos_rel) local native_word_box = self:getWordFromBoxes(boxes, native_pos) - + local word_box = { word = native_word_box.word, pbox = native_word_box.box, -- box on page @@ -760,8 +808,8 @@ function KoptInterface:getLinkFromPosition(doc, pageno, pos) local function inside_box(pos, box) if pos then local x, y = pos.x, pos.y - if box.x <= x and box.y <= y - and box.x + box.w >= x + if box.x <= x and box.y <= y + and box.x + box.w >= x and box.y + box.h >= y then return true end @@ -840,26 +888,26 @@ get text and text boxes from screen positions for reflowed page ]]-- function KoptInterface:getTextFromReflowPositions(doc, native_boxes, pos0, pos1) local pageno = pos0.page - + local scratch_reflowed_page_boxes = self:getReflowedTextBoxesFromScratch(doc, pageno) local reflowed_page_boxes = self:getReflowedTextBoxes(doc, pageno) - + local scratch_reflowed_word_box0 = self:getWordFromBoxes(scratch_reflowed_page_boxes, pos0) local reflowed_word_box0 = self:getWordFromBoxes(reflowed_page_boxes, pos0) local scratch_reflowed_word_box1 = self:getWordFromBoxes(scratch_reflowed_page_boxes, pos1) local reflowed_word_box1 = self:getWordFromBoxes(reflowed_page_boxes, pos1) - + local reflowed_pos_abs0 = scratch_reflowed_word_box0.box:center() local reflowed_pos_rel0 = getBoxRelativePosition(scratch_reflowed_word_box0.box, reflowed_word_box0.box) local reflowed_pos_abs1 = scratch_reflowed_word_box1.box:center() local reflowed_pos_rel1 = getBoxRelativePosition(scratch_reflowed_word_box1.box, reflowed_word_box1.box) --DEBUG("absolute positions", reflowed_pos_abs0, reflowed_pos_abs1) --DEBUG("relative positions", reflowed_pos_rel0, reflowed_pos_rel1) - + local native_pos0 = self:reflowToNativePosTransform(doc, pageno, reflowed_pos_abs0, reflowed_pos_rel0) local native_pos1 = self:reflowToNativePosTransform(doc, pageno, reflowed_pos_abs1, reflowed_pos_rel1) --DEBUG("native positions", native_pos0, native_pos1) - + local reflowed_text_boxes = self:getTextFromBoxes(reflowed_page_boxes, pos0, pos1) local native_text_boxes = self:getTextFromBoxes(native_boxes, native_pos0, native_pos1) local text_boxes = { diff --git a/frontend/ui/data/koptoptions.lua b/frontend/ui/data/koptoptions.lua index 0d78890dd..0811b7cbf 100644 --- a/frontend/ui/data/koptoptions.lua +++ b/frontend/ui/data/koptoptions.lua @@ -123,7 +123,7 @@ local KoptOptions = { options = { { name = "text_wrap", - name_text = _("Reflow"), + name_text = S.REFLOW, toggle = {S.ON, S.OFF}, values = {1, 0}, default_value = DKOPTREADER_CONFIG_TEXT_WRAP, @@ -139,6 +139,13 @@ local KoptOptions = { }, } }, + { + name = "page_opt", + name_text = S.DEWATERMARK, + toggle = {S.ON, S.OFF}, + values = {1, 0}, + default_value = 0, + }, { name="doc_language", name_text = S.DOC_LANG, diff --git a/frontend/ui/data/strings.lua b/frontend/ui/data/strings.lua index a5ae01e8a..1188fe585 100644 --- a/frontend/ui/data/strings.lua +++ b/frontend/ui/data/strings.lua @@ -13,6 +13,7 @@ S.TEXT_ALIGN = _("Text Align") S.FONTSIZE_FINE_TUNING = _("Fine Tuning") S.CONTRAST = _("Contrast") S.REFLOW = _("Reflow") +S.DEWATERMARK = _("Dewatermark") S.DOC_LANG = _("Document Language") S.VERTICAL_TEXT = _("Vertical Text") S.WORD_GAP = _("Word Gap") diff --git a/koreader-base b/koreader-base index 14f92c892..c08774440 160000 --- a/koreader-base +++ b/koreader-base @@ -1 +1 @@ -Subproject commit 14f92c89257527ef77f2dfd52e92181276c96452 +Subproject commit c087744408a309b06c626825698d3e9c034a95db From df65c1069a332ce6b62c02f2c99313ffc6e27e67 Mon Sep 17 00:00:00 2001 From: chrox Date: Mon, 7 Apr 2014 00:25:10 +0800 Subject: [PATCH 2/3] remove unnecessary DEBUG --- frontend/apps/reader/modules/readerfrontlight.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/apps/reader/modules/readerfrontlight.lua b/frontend/apps/reader/modules/readerfrontlight.lua index 86637bff8..ae3330dff 100644 --- a/frontend/apps/reader/modules/readerfrontlight.lua +++ b/frontend/apps/reader/modules/readerfrontlight.lua @@ -33,10 +33,9 @@ function ReaderFrontLight:init() } }, } - DEBUG("Device:getModel() ~= 'Kobo_phoenix' and 3.0 or nil =", Device:getModel() ~= 'Kobo_phoenix' and 3.0 or nil) self.ui.menu:registerToMainMenu(self) end - + end function ReaderFrontLight:onAdjust(arg, ges) @@ -44,9 +43,9 @@ function ReaderFrontLight:onAdjust(arg, ges) if powerd.flIntensity ~= nil then DEBUG("frontlight intensity", powerd.flIntensity) local step = math.ceil(#self.steps * ges.distance / Screen:getWidth()) - DEBUG("step = ", step) + DEBUG("step = ", step) local delta_int = self.steps[step] or self.steps[#self.steps] - DEBUG("delta_int = ", delta_int) + DEBUG("delta_int = ", delta_int) if ges.direction == "north" then powerd:setIntensity(powerd.flIntensity + delta_int) elseif ges.direction == "south" then @@ -69,13 +68,13 @@ end function ReaderFrontLight:onSwipe(arg, ges) if ges.direction == "north" or ges.direction == "south" then - DEBUG("onSwipe activated") + DEBUG("onSwipe activated") return self:onShowIntensity() end end function ReaderFrontLight:onPanRelease(arg, ges) - DEBUG("onPanRelease activated") + DEBUG("onPanRelease activated") return self:onShowIntensity() end From 6432ad2324e7274bfa4be46b0c9b415b7c513225 Mon Sep 17 00:00:00 2001 From: chrox Date: Mon, 7 Apr 2014 00:43:04 +0800 Subject: [PATCH 3/3] update pot file --- l10n/templates/koreader.pot | 321 ++++++++++++++++++------------------ 1 file changed, 160 insertions(+), 161 deletions(-) diff --git a/l10n/templates/koreader.pot b/l10n/templates/koreader.pot index 57bca81d9..d3b6c0757 100644 --- a/l10n/templates/koreader.pot +++ b/l10n/templates/koreader.pot @@ -6,38 +6,38 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://github.com/koreader/koreader-base/issues\n" -"POT-Creation-Date: 2014-03-09 12:11+0000\n" +"POT-Creation-Date: 2014-04-06 16:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: reader.lua:118 +#: reader.lua:119 msgid "" "-d start in debug mode" msgstr "" -#: reader.lua:120 +#: reader.lua:121 msgid "" "-h show this usage help" msgstr "" -#: reader.lua:119 +#: reader.lua:120 msgid "" "-p [rows] enable Lua code profiling" msgstr "" -#: frontend/ui/data/strings.lua:47 +#: frontend/ui/data/strings.lua:48 msgid "" "0 deg" msgstr "" -#: frontend/ui/data/strings.lua:49 +#: frontend/ui/data/strings.lua:50 msgid "" "10 deg" msgstr "" -#: frontend/ui/data/strings.lua:48 +#: frontend/ui/data/strings.lua:49 msgid "" "5 deg" msgstr "" @@ -52,23 +52,23 @@ msgid "" ">>" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:294 +#: frontend/apps/reader/modules/readerhighlight.lua:294 #: frontend/ui/widget/dictquicklookup.lua:147 msgid "" "Add Note" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:83 +#: frontend/apps/reader/modules/readerfrontlight.lua:107 msgid "" "Apply" msgstr "" -#: frontend/ui/reader/readertypeset.lua:54 +#: frontend/apps/reader/modules/readertypeset.lua:54 msgid "" "Auto" msgstr "" -#: frontend/ui/data/strings.lua:21 +#: frontend/ui/data/strings.lua:22 msgid "" "Auto Straighten" msgstr "" @@ -109,23 +109,23 @@ msgid "" "Auto-detected Kobo" msgstr "" -#: frontend/ui/reader/readerbookmark.lua:14 +#: frontend/apps/reader/modules/readerbookmark.lua:14 msgid "" "Bookmarks" msgstr "" -#: frontend/ui/reader/readergoto.lua:36 +#: frontend/apps/reader/modules/readergoto.lua:36 #: frontend/ui/widget/confirmbox.lua:26 msgid "" "Cancel" msgstr "" -#: frontend/ui/reader/readerhyphenation.lua:32 +#: frontend/apps/reader/modules/readerhyphenation.lua:32 msgid "" "Change Hyphenation to " msgstr "" -#: frontend/ui/reader/readerfont.lua:18 +#: frontend/apps/reader/modules/readerfont.lua:18 msgid "" "Change font" msgstr "" @@ -150,29 +150,24 @@ msgid "" "Cut" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:44 -msgid "" -"Decrease front light intensity to " -msgstr "" - -#: frontend/ui/reader/readerfont.lua:188 +#: frontend/apps/reader/modules/readerfont.lua:188 msgid "" "Decrease gamma to " msgstr "" -#: frontend/ui/reader/readerfont.lua:159 +#: frontend/apps/reader/modules/readerfont.lua:159 msgid "" "Decrease line space to " msgstr "" -#: frontend/ui/data/strings.lua:19 +#: frontend/ui/data/strings.lua:20 msgid "" "Defect Size" msgstr "" #: frontend/apps/filemanager/filemanager.lua:109 #: frontend/apps/filemanager/filemanagerhistory.lua:30 -#: frontend/ui/reader/readerhighlight.lua:186 +#: frontend/apps/reader/modules/readerhighlight.lua:186 msgid "" "Delete" msgstr "" @@ -184,20 +179,25 @@ msgstr "" #: frontend/ui/data/strings.lua:16 msgid "" +"Dewatermark" +msgstr "" + +#: frontend/ui/data/strings.lua:17 +msgid "" "Document Language" msgstr "" -#: frontend/ui/reader/readermenu.lua:114 +#: frontend/apps/reader/modules/readermenu.lua:114 msgid "" "Document menu" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:193 +#: frontend/apps/reader/modules/readerhighlight.lua:193 msgid "" "Edit" msgstr "" -#: frontend/ui/data/strings.lua:26 +#: frontend/ui/data/strings.lua:27 msgid "" "Embedded Style" msgstr "" @@ -227,17 +227,22 @@ msgid "" "Firmware revision" msgstr "" -#: frontend/ui/data/strings.lua:23 +#: frontend/ui/data/strings.lua:24 msgid "" "Font Weight" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:70 +#: frontend/apps/reader/modules/readerfrontlight.lua:94 msgid "" "Frontlight Level" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:60 +#: frontend/apps/reader/modules/readerfrontlight.lua:62 +msgid "" +"Frontlight intensity is set to " +msgstr "" + +#: frontend/apps/reader/modules/readerfrontlight.lua:84 msgid "" "Frontlight settings" msgstr "" @@ -247,28 +252,28 @@ msgid "" "Full Screen" msgstr "" -#: frontend/ui/data/strings.lua:24 +#: frontend/ui/data/strings.lua:25 msgid "" "Gamma" msgstr "" -#: frontend/ui/reader/readergoto.lua:10 +#: frontend/apps/reader/modules/readergoto.lua:10 msgid "" "Go To" msgstr "" -#: frontend/ui/reader/readergoto.lua:11 +#: frontend/apps/reader/modules/readergoto.lua:11 msgid "" "Go to Page or Location" msgstr "" #: frontend/apps/filemanager/filemanagermenu.lua:74 -#: frontend/ui/reader/readermenu.lua:72 +#: frontend/apps/reader/modules/readermenu.lua:72 msgid "" "Help" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:286 +#: frontend/apps/reader/modules/readerhighlight.lua:286 #: frontend/ui/widget/dictquicklookup.lua:140 msgid "" "Highlight" @@ -279,47 +284,42 @@ msgid "" "History" msgstr "" -#: frontend/ui/reader/readerhyphenation.lua:7 +#: frontend/apps/reader/modules/readerhyphenation.lua:7 msgid "" "Hyphenation" msgstr "" -#: reader.lua:125 +#: reader.lua:126 msgid "" "If you don't pass any path, the last viewed document will be opened" msgstr "" -#: reader.lua:122 +#: reader.lua:123 msgid "" "If you give the name of a directory instead of a file path, a file" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:41 -msgid "" -"Increase front light intensity to " -msgstr "" - -#: frontend/ui/reader/readerfont.lua:185 +#: frontend/apps/reader/modules/readerfont.lua:185 msgid "" "Increase gamma to " msgstr "" -#: frontend/ui/reader/readerfont.lua:163 +#: frontend/apps/reader/modules/readerfont.lua:163 msgid "" "Increase line space to " msgstr "" -#: frontend/ui/data/strings.lua:22 +#: frontend/ui/data/strings.lua:23 msgid "" "Indentation" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:96 +#: frontend/apps/reader/modules/readerhighlight.lua:96 msgid "" "Invert" msgstr "" -#: frontend/ui/data/strings.lua:55 +#: frontend/ui/data/strings.lua:56 msgid "" "LTR" msgstr "" @@ -329,7 +329,7 @@ msgid "" "Language" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:84 +#: frontend/apps/reader/modules/readerhighlight.lua:84 msgid "" "Lighten" msgstr "" @@ -339,12 +339,12 @@ msgid "" "Line Spacing" msgstr "" -#: frontend/ui/reader/readergoto.lua:50 +#: frontend/apps/reader/modules/readergoto.lua:50 msgid "" "Location" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:324 +#: frontend/apps/reader/modules/readerhighlight.lua:324 msgid "" "More" msgstr "" @@ -359,13 +359,13 @@ msgid "" "Not supported device model!" msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:90 +#: frontend/apps/reader/modules/readerfrontlight.lua:114 #: frontend/ui/widget/confirmbox.lua:25 msgid "" "OK" msgstr "" -#: frontend/ui/reader/readergoto.lua:43 +#: frontend/apps/reader/modules/readergoto.lua:43 msgid "" "Page" msgstr "" @@ -391,7 +391,7 @@ msgid "" msgstr "" #: frontend/apps/filemanager/filemanagermenu.lua:77 -#: frontend/ui/reader/readermenu.lua:75 +#: frontend/apps/reader/modules/readermenu.lua:75 msgid "" "Please report bugs to https://github.com/koreader/ koreader/issues, Click at the bottom of the page for more options" msgstr "" @@ -401,33 +401,32 @@ msgid "" "Please restart reader for new language setting to take effect." msgstr "" -#: frontend/ui/data/strings.lua:28 +#: frontend/ui/data/strings.lua:29 msgid "" "Progress Bar" msgstr "" -#: frontend/ui/data/strings.lua:56 +#: frontend/ui/data/strings.lua:57 msgid "" "RTL" msgstr "" -#: reader.lua:116 +#: reader.lua:117 msgid "" "Read all the books on your E-Ink reader" msgstr "" -#: frontend/ui/reader/readerfont.lua:211 +#: frontend/apps/reader/modules/readerfont.lua:211 msgid "" "Redrawing with font " msgstr "" -#: frontend/ui/data/koptoptions.lua:126 #: frontend/ui/data/strings.lua:15 msgid "" "Reflow" msgstr "" -#: frontend/ui/data/strings.lua:20 +#: frontend/ui/data/strings.lua:21 msgid "" "Render Quality" msgstr "" @@ -452,7 +451,7 @@ msgid "" "Scroll Mode" msgstr "" -#: reader.lua:128 +#: reader.lua:129 msgid "" "See http://github.com/koreader/kindlepdfviewer for more info." msgstr "" @@ -469,22 +468,22 @@ msgid "" "Select Option Item" msgstr "" -#: frontend/ui/reader/readerfont.lua:144 +#: frontend/apps/reader/modules/readerfont.lua:144 msgid "" "Set font size to " msgstr "" -#: frontend/ui/reader/readerhighlight.lua:75 +#: frontend/apps/reader/modules/readerhighlight.lua:75 msgid "" "Set highlight drawer " msgstr "" -#: frontend/ui/reader/readertypeset.lua:9 +#: frontend/apps/reader/modules/readertypeset.lua:9 msgid "" "Set render style" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:313 +#: frontend/apps/reader/modules/readerhighlight.lua:313 msgid "" "Share" msgstr "" @@ -494,27 +493,27 @@ msgid "" "Standby" msgstr "" -#: frontend/ui/reader/readerzooming.lua:292 +#: frontend/apps/reader/modules/readerzooming.lua:292 msgid "" "Switch zoom mode" msgstr "" -#: frontend/ui/data/strings.lua:58 +#: frontend/ui/data/strings.lua:59 msgid "" "TBLTR" msgstr "" -#: frontend/ui/data/strings.lua:57 +#: frontend/ui/data/strings.lua:58 msgid "" "TBRTL" msgstr "" -#: frontend/ui/reader/readertoc.lua:112 +#: frontend/apps/reader/modules/readertoc.lua:122 msgid "" "Table of Contents" msgstr "" -#: frontend/ui/reader/readertoc.lua:14 +#: frontend/apps/reader/modules/readertoc.lua:14 msgid "" "Table of contents" msgstr "" @@ -529,12 +528,12 @@ msgid "" "Text Align" msgstr "" -#: reader.lua:127 +#: reader.lua:128 msgid "" "This software is licensed under the GPLv3." msgstr "" -#: frontend/ui/reader/readerfrontlight.lua:75 +#: frontend/apps/reader/modules/readerfrontlight.lua:99 msgid "" "Toggle" msgstr "" @@ -549,88 +548,88 @@ msgid "" "Toggle switch" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:305 +#: frontend/apps/reader/modules/readerhighlight.lua:305 msgid "" "Translate" msgstr "" -#: frontend/ui/reader/readerpaging.lua:143 +#: frontend/apps/reader/modules/readerpaging.lua:143 msgid "" "Turn off page overlap" msgstr "" -#: frontend/ui/reader/readerpaging.lua:144 +#: frontend/apps/reader/modules/readerpaging.lua:144 msgid "" "Turn on page overlap" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:90 +#: frontend/apps/reader/modules/readerhighlight.lua:90 msgid "" "Underscore" msgstr "" #: frontend/apps/filemanager/filemanagermenu.lua:82 -#: frontend/ui/reader/readermenu.lua:80 +#: frontend/apps/reader/modules/readermenu.lua:80 msgid "" "Version" msgstr "" -#: frontend/ui/data/strings.lua:17 +#: frontend/ui/data/strings.lua:18 msgid "" "Vertical Text" msgstr "" -#: frontend/ui/data/strings.lua:25 +#: frontend/ui/data/strings.lua:26 msgid "" "View Mode" msgstr "" -#: frontend/ui/data/strings.lua:18 +#: frontend/ui/data/strings.lua:19 msgid "" "Word Gap" msgstr "" -#: frontend/ui/data/strings.lua:27 +#: frontend/ui/data/strings.lua:28 msgid "" "Writing Direction" msgstr "" -#: frontend/ui/reader/readerscreenshot.lua:34 +#: frontend/apps/reader/modules/readerscreenshot.lua:34 msgid "" "Writing screen to " msgstr "" -#: frontend/ui/reader/readerzooming.lua:311 +#: frontend/apps/reader/modules/readerzooming.lua:311 msgid "" "Zoom to fit content" msgstr "" -#: frontend/ui/reader/readerzooming.lua:299 +#: frontend/apps/reader/modules/readerzooming.lua:299 msgid "" "Zoom to fit content height" msgstr "" -#: frontend/ui/reader/readerzooming.lua:295 +#: frontend/apps/reader/modules/readerzooming.lua:295 msgid "" "Zoom to fit content width" msgstr "" -#: frontend/ui/reader/readerzooming.lua:315 +#: frontend/apps/reader/modules/readerzooming.lua:315 msgid "" "Zoom to fit page" msgstr "" -#: frontend/ui/reader/readerzooming.lua:307 +#: frontend/apps/reader/modules/readerzooming.lua:307 msgid "" "Zoom to fit page height" msgstr "" -#: frontend/ui/reader/readerzooming.lua:303 +#: frontend/apps/reader/modules/readerzooming.lua:303 msgid "" "Zoom to fit page width" msgstr "" -#: frontend/ui/data/strings.lua:32 +#: frontend/ui/data/strings.lua:33 msgid "" "auto" msgstr "" @@ -640,7 +639,7 @@ msgid "" "cancel" msgstr "" -#: reader.lua:123 +#: reader.lua:124 msgid "" "chooser will show up and let you select a file" msgstr "" @@ -656,7 +655,7 @@ msgid "" "chose selected option" msgstr "" -#: frontend/ui/reader/readertypeset.lua:48 +#: frontend/apps/reader/modules/readertypeset.lua:48 msgid "" "clear all external styles" msgstr "" @@ -672,218 +671,218 @@ msgid "" "close dialog" msgstr "" -#: frontend/ui/readerui.lua:44 -#: frontend/ui/readerui.lua:73 +#: frontend/apps/reader/readerui.lua:44 +#: frontend/apps/reader/readerui.lua:73 msgid "" "close document" msgstr "" -#: frontend/ui/widget/menu.lua:443 +#: frontend/ui/widget/menu.lua:449 msgid "" "close menu" msgstr "" -#: frontend/ui/data/strings.lua:43 +#: frontend/ui/data/strings.lua:44 msgid "" "darker" msgstr "" -#: frontend/ui/data/strings.lua:44 +#: frontend/ui/data/strings.lua:45 msgid "" "darkest" msgstr "" -#: frontend/ui/data/strings.lua:38 +#: frontend/ui/data/strings.lua:39 msgid "" "decrease" msgstr "" -#: frontend/ui/reader/readerfont.lua:35 +#: frontend/apps/reader/modules/readerfont.lua:35 msgid "" "decrease font size" msgstr "" -#: frontend/ui/reader/readerfont.lua:43 +#: frontend/apps/reader/modules/readerfont.lua:43 msgid "" "decrease line space" msgstr "" -#: frontend/ui/data/strings.lua:42 +#: frontend/ui/data/strings.lua:43 msgid "" "default" msgstr "" -#: frontend/ui/data/strings.lua:59 +#: frontend/ui/data/strings.lua:60 msgid "" "full" msgstr "" -#: frontend/ui/reader/readerrolling.lua:51 +#: frontend/apps/reader/modules/readerrolling.lua:51 msgid "" "go to 11%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:53 +#: frontend/apps/reader/modules/readerrolling.lua:53 msgid "" "go to 22%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:55 +#: frontend/apps/reader/modules/readerrolling.lua:55 msgid "" "go to 33%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:57 +#: frontend/apps/reader/modules/readerrolling.lua:57 msgid "" "go to 44%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:59 +#: frontend/apps/reader/modules/readerrolling.lua:59 msgid "" "go to 55%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:61 +#: frontend/apps/reader/modules/readerrolling.lua:61 msgid "" "go to 66%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:63 +#: frontend/apps/reader/modules/readerrolling.lua:63 msgid "" "go to 77%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:65 +#: frontend/apps/reader/modules/readerrolling.lua:65 msgid "" "go to 88%" msgstr "" -#: frontend/ui/reader/readerrolling.lua:67 +#: frontend/apps/reader/modules/readerrolling.lua:67 msgid "" "go to end" msgstr "" -#: frontend/ui/reader/readerrolling.lua:30 +#: frontend/apps/reader/modules/readerrolling.lua:30 msgid "" "go to next view" msgstr "" -#: frontend/ui/reader/readerrolling.lua:35 +#: frontend/apps/reader/modules/readerrolling.lua:35 msgid "" "go to previous view" msgstr "" -#: frontend/ui/reader/readerrolling.lua:49 +#: frontend/apps/reader/modules/readerrolling.lua:49 msgid "" "go to start" msgstr "" -#: frontend/ui/widget/menu.lua:445 +#: frontend/ui/widget/menu.lua:451 msgid "" "goto next page of the menu" msgstr "" -#: frontend/ui/widget/menu.lua:448 +#: frontend/ui/widget/menu.lua:454 msgid "" "goto previous page of the menu" msgstr "" -#: frontend/ui/data/strings.lua:46 +#: frontend/ui/data/strings.lua:47 msgid "" "high" msgstr "" -#: frontend/ui/reader/readerhighlight.lua:19 +#: frontend/apps/reader/modules/readerhighlight.lua:19 msgid "" "highlight text" msgstr "" -#: frontend/ui/data/strings.lua:39 +#: frontend/ui/data/strings.lua:40 msgid "" "increase" msgstr "" -#: frontend/ui/reader/readerfont.lua:31 +#: frontend/apps/reader/modules/readerfont.lua:31 msgid "" "increase font size" msgstr "" -#: frontend/ui/reader/readerfont.lua:39 +#: frontend/apps/reader/modules/readerfont.lua:39 msgid "" "increase line space" msgstr "" -#: frontend/ui/data/strings.lua:51 +#: frontend/ui/data/strings.lua:52 msgid "" "landscape" msgstr "" -#: frontend/ui/data/strings.lua:37 +#: frontend/ui/data/strings.lua:38 msgid "" "large" msgstr "" -#: frontend/ui/data/strings.lua:41 +#: frontend/ui/data/strings.lua:42 msgid "" "lighter" msgstr "" -#: frontend/ui/data/strings.lua:40 +#: frontend/ui/data/strings.lua:41 msgid "" "lightest" msgstr "" -#: frontend/ui/data/strings.lua:45 +#: frontend/ui/data/strings.lua:46 msgid "" "low" msgstr "" -#: frontend/ui/data/strings.lua:33 +#: frontend/ui/data/strings.lua:34 msgid "" "manual" msgstr "" -#: frontend/ui/data/strings.lua:36 +#: frontend/ui/data/strings.lua:37 msgid "" "medium" msgstr "" -#: frontend/ui/data/strings.lua:60 +#: frontend/ui/data/strings.lua:61 msgid "" "mini" msgstr "" -#: frontend/ui/reader/readerrolling.lua:45 +#: frontend/apps/reader/modules/readerrolling.lua:45 msgid "" "move view down" msgstr "" -#: frontend/ui/reader/readerrolling.lua:40 +#: frontend/apps/reader/modules/readerrolling.lua:40 msgid "" "move view up" msgstr "" -#: frontend/ui/reader/readerpanning.lua:25 +#: frontend/apps/reader/modules/readerpanning.lua:25 msgid "" "move visible area down" msgstr "" -#: frontend/ui/reader/readerpanning.lua:28 +#: frontend/apps/reader/modules/readerpanning.lua:28 msgid "" "move visible area left" msgstr "" -#: frontend/ui/reader/readerpanning.lua:31 +#: frontend/apps/reader/modules/readerpanning.lua:31 msgid "" "move visible area right" msgstr "" -#: frontend/ui/reader/readerpanning.lua:22 +#: frontend/apps/reader/modules/readerpanning.lua:22 msgid "" "move visible area up" msgstr "" -#: frontend/ui/widget/menu.lua:530 +#: frontend/ui/widget/menu.lua:538 msgid "" "no choices available" msgstr "" @@ -893,12 +892,12 @@ msgid "" "no text" msgstr "" -#: frontend/ui/data/strings.lua:31 +#: frontend/ui/data/strings.lua:32 msgid "" "off" msgstr "" -#: frontend/ui/data/strings.lua:30 +#: frontend/ui/data/strings.lua:31 msgid "" "on" msgstr "" @@ -908,124 +907,124 @@ msgid "" "opening file" msgstr "" -#: frontend/ui/data/strings.lua:54 +#: frontend/ui/data/strings.lua:55 msgid "" "page" msgstr "" -#: frontend/ui/widget/menu.lua:524 +#: frontend/ui/widget/menu.lua:532 msgid "" "page " msgstr "" -#: frontend/ui/data/strings.lua:50 +#: frontend/ui/data/strings.lua:51 msgid "" "portrait" msgstr "" -#: frontend/ui/reader/readerrotation.lua:20 +#: frontend/apps/reader/modules/readerrotation.lua:20 msgid "" "rotate left by 90 degrees" msgstr "" -#: frontend/ui/reader/readerrotation.lua:24 +#: frontend/apps/reader/modules/readerrotation.lua:24 msgid "" "rotate right by 90 degrees" msgstr "" -#: frontend/ui/data/strings.lua:53 +#: frontend/ui/data/strings.lua:54 msgid "" "scroll" msgstr "" #: frontend/ui/widget/configdialog.lua:440 -#: frontend/ui/widget/menu.lua:457 +#: frontend/ui/widget/menu.lua:463 msgid "" "select current menu item" msgstr "" -#: frontend/ui/data/strings.lua:34 +#: frontend/ui/data/strings.lua:35 msgid "" "semi-auto" msgstr "" -#: frontend/ui/reader/readertoc.lua:22 +#: frontend/apps/reader/modules/readertoc.lua:22 msgid "" "show Table of Content menu" msgstr "" -#: frontend/ui/reader/readerbookmark.lua:23 +#: frontend/apps/reader/modules/readerbookmark.lua:23 msgid "" "show bookmarks" msgstr "" -#: frontend/ui/reader/readerconfig.lua:18 +#: frontend/apps/reader/modules/readerconfig.lua:18 msgid "" "show config dialog" msgstr "" -#: frontend/ui/reader/readerfont.lua:28 +#: frontend/apps/reader/modules/readerfont.lua:28 msgid "" "show font menu" msgstr "" #: frontend/apps/filemanager/filemanagermenu.lua:36 -#: frontend/ui/reader/readermenu.lua:45 +#: frontend/apps/reader/modules/readermenu.lua:45 msgid "" "show menu" msgstr "" -#: frontend/ui/data/strings.lua:35 +#: frontend/ui/data/strings.lua:36 msgid "" "small" msgstr "" -#: frontend/ui/data/strings.lua:52 +#: frontend/ui/data/strings.lua:53 msgid "" "toggle bold" msgstr "" -#: reader.lua:115 +#: reader.lua:116 msgid "" "usage: ./reader.lua [OPTION] ... path" msgstr "" -#: frontend/ui/reader/readerzooming.lua:25 +#: frontend/apps/reader/modules/readerzooming.lua:25 msgid "" "zoom in" msgstr "" -#: frontend/ui/reader/readerzooming.lua:30 +#: frontend/apps/reader/modules/readerzooming.lua:30 msgid "" "zoom out" msgstr "" -#: frontend/ui/reader/readerzooming.lua:40 +#: frontend/apps/reader/modules/readerzooming.lua:40 msgid "" "zoom to fit content" msgstr "" -#: frontend/ui/reader/readerzooming.lua:60 +#: frontend/apps/reader/modules/readerzooming.lua:60 msgid "" "zoom to fit content height" msgstr "" -#: frontend/ui/reader/readerzooming.lua:50 +#: frontend/apps/reader/modules/readerzooming.lua:50 msgid "" "zoom to fit content width" msgstr "" -#: frontend/ui/reader/readerzooming.lua:35 +#: frontend/apps/reader/modules/readerzooming.lua:35 msgid "" "zoom to fit page" msgstr "" -#: frontend/ui/reader/readerzooming.lua:55 +#: frontend/apps/reader/modules/readerzooming.lua:55 msgid "" "zoom to fit page height" msgstr "" -#: frontend/ui/reader/readerzooming.lua:45 +#: frontend/apps/reader/modules/readerzooming.lua:45 msgid "" "zoom to fit page width" msgstr ""