cre: add Word Gap setting to bottom config panel (#4026)

Maps to crengine's Space Condensing feature (named Word Gap
as a similar feature is named for PDF)
This commit is contained in:
Robert
2018-06-30 16:55:43 +02:00
committed by poire-z
parent 27dfa30181
commit d29a65b96e
7 changed files with 45 additions and 19 deletions

View File

@@ -132,13 +132,6 @@ function CreDocument:init()
G_reader_settings:readSetting("cre_header_status_font_size"))
end
-- min space condensing percent (how much we can decrease a space width to
-- make text fit on a line) default is 50%
if G_reader_settings:readSetting("cre_min_space_condensing_percent") then
self._document:setIntProperty("crengine.style.space.condensing.percent",
G_reader_settings:readSetting("cre_min_space_condensing_percent"))
end
-- set fallback font face
self._document:setStringProperty("crengine.font.fallback.face",
G_reader_settings:readSetting("fallback_font") or self.fallback_font)
@@ -527,6 +520,13 @@ function CreDocument:setFontHinting(mode)
self._document:setIntProperty("font.hinting.mode", mode)
end
-- min space condensing percent (how much we can decrease a space width to
-- make text fit on a line) 25...100%
function CreDocument:setSpaceCondensing(value)
logger.dbg("CreDocument: set space condensing", value)
self._document:setIntProperty("crengine.style.space.condensing.percent", value)
end
function CreDocument:setStyleSheet(new_css_file, appended_css_content )
logger.dbg("CreDocument: set style sheet:",
new_css_file and new_css_file or "no file",