mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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.
This commit is contained in:
committed by
Qingping Hou
parent
10132d1c59
commit
e5a3ecd3e5
@@ -427,6 +427,13 @@ function CreDocument:setFloatingPunctuation(enabled)
|
||||
self._document:setIntProperty("crengine.style.floating.punctuation.enabled", enabled)
|
||||
end
|
||||
|
||||
function CreDocument:setTxtPreFormatted(enabled)
|
||||
logger.dbg("CreDocument: set txt preformatted", enabled)
|
||||
self._document:setIntProperty("crengine.file.txt.preformatted", enabled)
|
||||
-- monospace is really kind of ugly for this...
|
||||
self._document:setStringProperty("styles.pre.font-face", "font-family: \"" .. self.default_font .. "\"")
|
||||
end
|
||||
|
||||
function CreDocument:getVisiblePageCount()
|
||||
return self._document:getVisiblePageCount()
|
||||
end
|
||||
@@ -458,8 +465,8 @@ function CreDocument:findText(pattern, origin, reverse, caseInsensitive)
|
||||
end
|
||||
|
||||
function CreDocument:register(registry)
|
||||
registry:addProvider("txt", "application/txt", self)
|
||||
registry:addProvider("log", "application/txt", self)
|
||||
registry:addProvider("txt", "text/plain", self)
|
||||
registry:addProvider("log", "text/plain", self)
|
||||
registry:addProvider("txt.zip", "application/zip", self)
|
||||
registry:addProvider("log.zip", "application/zip", self)
|
||||
registry:addProvider("epub", "application/epub", self)
|
||||
|
||||
Reference in New Issue
Block a user