[RTL UI] Bidi-wrap filenames, paths, urls, metadata

bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
This commit is contained in:
poire-z
2020-01-04 01:18:51 +01:00
parent a31abf79de
commit 0599c440cc
50 changed files with 378 additions and 182 deletions

View File

@@ -627,8 +627,7 @@ function Menu:init()
if self.show_path then
self.path_text = TextWidget:new{
face = Font:getFace("xx_smallinfofont"),
text = self.path,
para_direction_rtl = false, -- force LTR
text = BD.directory(self.path),
max_width = self.dimen.w - 2*Size.padding.small,
truncate_left = true,
}
@@ -1035,7 +1034,7 @@ function Menu:updateItems(select_number)
self:updatePageInfo(select_number)
if self.show_path then
self.path_text:setText(self.path)
self.path_text:setText(BD.directory(self.path))
end
UIManager:setDirty(self.show_parent, function()