bump_crengine: various fixes, tweaks and cleanups (#6188)

Includes:
- Don't reset invisible BR to display: inline
- ldomTextCollector: handle inline-block/table as inline
- Avoid re-rendering on font hinting mode change
- List markers: fix positionning when floats involved
- GIF decoding: avoid uneeded abort on LZW table overflow
- Adds getUnknownEntities(), can help with debugging
- Don't check stylesheet hashes when loading from cache
- Hardcoded elements and attributes list: cleanup
- Full rendering: 2 small optimisations
- Strut confinning: deal with images earlier
- lvtextfm: some cleanup and reordering
cre.cpp:
- fix getPageFromXPointer() and getPosFromXPointer()
  to not fail on invisible nodes and work on the next
  visible node (so links whose target is display:none
  can work).

Add support for 2 settings one can set manually
in reader.settings.reader.lua:
["cre_background_color"] = "0xccffcc",
["cre_background_image"] = "/path/to/bg_paper.jpg",
reviewable/pr6192/r1
poire-z 4 years ago committed by GitHub
parent 16e42116ee
commit 177551918f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit ab837d73bae87efeb92950b4f00b6b55e5d45927
Subproject commit 4a91eefe3a42f926ebe262658c258c9929544836

@ -258,6 +258,11 @@ function ReaderRolling:onCloseDocument()
end
end
logger.dbg("cre cache used:", cache_file_path or "none")
-- Unknown elements and attributes, uncomment if needed for debugging:
-- local elements, attributes, namespaces = self.ui.document:getUnknownEntities()
-- if elements ~= "" then logger.info("cre unknown elements: ", elements) end
-- if attributes ~= "" then logger.info("cre unknown attributes: ", attributes) end
-- if namespaces ~= "" then logger.info("cre unknown namespaces: ", namespaces) end
end
function ReaderRolling:onCheckDomStyleCoherence()

@ -205,6 +205,14 @@ function CreDocument:setupDefaultView()
self._document:setIntProperty("crengine.page.header.font.size",
G_reader_settings:readSetting("cre_header_status_font_size"))
end
-- One can set these to change from white background
if G_reader_settings:readSetting("cre_background_color") then
self:setBackgroundColor(G_reader_settings:readSetting("cre_background_color"))
end
if G_reader_settings:readSetting("cre_background_image") then
self:setBackgroundImage(G_reader_settings:readSetting("cre_background_image"))
end
end
function CreDocument:loadDocument(full_document)
@ -893,6 +901,11 @@ function CreDocument:setStatusLineProp(prop)
self._document:setStringProperty("window.status.line", prop)
end
function CreDocument:setBackgroundColor(bgcolor) -- use nil to set to white
logger.dbg("CreDocument: set background color", bgcolor)
self._document:setBackgroundColor(bgcolor)
end
function CreDocument:setBackgroundImage(img_path) -- use nil to unset
logger.dbg("CreDocument: set background image", img_path)
self._document:setBackgroundImage(img_path)
@ -941,6 +954,10 @@ function CreDocument:getStatistics()
return self._document:getStatistics()
end
function CreDocument:getUnknownEntities()
return self._document:getUnknownEntities()
end
function CreDocument:canHaveAlternativeToc()
return true
end

Loading…
Cancel
Save