mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Added TextBoxWidget.has_split_inside_word flag
Used by coverbrowser's Text covers to choose the best font size.
This commit is contained in:
@@ -138,6 +138,9 @@ function TextBoxWidget:_splitCharWidthList()
|
||||
-- either a very long english word ocuppying more than one line,
|
||||
-- or the excessive char is itself splittable:
|
||||
-- we let that excessive char for next line
|
||||
if adjusted_idx == offset then -- let the fact a long word was splitted be known
|
||||
self.has_split_inside_word = true
|
||||
end
|
||||
cur_line_text = table.concat(self.charlist, "", offset, idx - 1)
|
||||
cur_line_width = cur_line_width - self.char_width_list[idx].width
|
||||
elseif c == " " then
|
||||
|
||||
@@ -194,10 +194,6 @@ function FakeCover:init()
|
||||
end
|
||||
inter_pad = math.floor(free_height / 2)
|
||||
|
||||
-- XXX We can benefit from adding to ui/widget/textboxwidget.lua at line 141
|
||||
-- ("either a very long english word"):
|
||||
-- if adjusted_idx == offset then self.has_split_inside_word = true end
|
||||
-- The following as no effect till then
|
||||
local textboxes_ok = true
|
||||
if (authors_wg and authors_wg.has_split_inside_word) or (title_wg and title_wg.has_split_inside_word) then
|
||||
-- We may get a nicer cover at next lower font size
|
||||
|
||||
Reference in New Issue
Block a user