mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user