bump crengine: word spacing and hyphenation tweaks

Includes:
- New option to tune word spacing: space width scale percent
- Text: look for hyphenation in more words if needed
- CSS: fix "hyphens:none" should override inherited "hyphens:auto"
- getHtml(): grab dir= and lang= attributes from upper nodes

Replace our Word Gap/Space condensing toggle/setting with
a new Word Spacing toggle/setting, made of 2 values:
- 1st number scales the normal width of spaces in all font
  (100% uses the font space width untouched)
- 2nd number applies after the 1st has been applied, and
  tells how much these spaces can additionally be condensed
  to make more text fit on a line.
This commit is contained in:
poire-z
2019-11-28 22:39:06 +01:00
parent e4dd1826fa
commit 5541d5f5d3
12 changed files with 128 additions and 72 deletions

View File

@@ -703,11 +703,16 @@ function CreDocument:setFontKerning(mode)
self._document:setIntProperty("font.kerning.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)
function CreDocument:setWordSpacing(values)
-- values should be a table of 2 numbers (e.g.: { 90, 75 })
-- - space width scale percent (hard scale the width of each space char in
-- all fonts - 100 to use the normal font space glyph width unchanged).
-- - min space condensing percent (how much we can additionally decrease
-- a space width to make text fit on a line).
logger.dbg("CreDocument: set space width scale", values[1])
self._document:setIntProperty("crengine.style.space.width.scale.percent", values[1])
logger.dbg("CreDocument: set space condensing", values[2])
self._document:setIntProperty("crengine.style.space.condensing.percent", values[2])
end
function CreDocument:setStyleSheet(new_css_file, appended_css_content )