cre hyphenation: allow for setting min left/right fragment length (#3890)

When hyphenating a word, the existing algorithms enforced a minimal
length of 2 for each word fragments on left or right side.
This adds a widget to allow changing these minimal sizes (from 1 to 10).
This commit is contained in:
poire-z
2018-04-19 14:24:04 +02:00
committed by GitHub
parent 3223ae670f
commit 7f6aebe399
4 changed files with 357 additions and 9 deletions

View File

@@ -411,6 +411,17 @@ function CreDocument:setHyphDictionary(new_hyph_dictionary)
end
end
function CreDocument:setHyphLeftHyphenMin(value)
-- default crengine value is 2: reset it if no value provided
logger.dbg("CreDocument: set hyphenation left hyphen min", value or 2)
self._document:setIntProperty("crengine.hyphenation.left.hyphen.min", value or 2)
end
function CreDocument:setHyphRightHyphenMin(value)
logger.dbg("CreDocument: set hyphenation right hyphen min", value or 2)
self._document:setIntProperty("crengine.hyphenation.right.hyphen.min", value or 2)
end
function CreDocument:clearSelection()
logger.dbg("clear selection")
self._document:clearSelection()