Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump crengine, fribidi, xtext - some CoverBrowser Mosaic tweaks #5693

Merged
merged 2 commits into from Dec 16, 2019

Conversation

@poire-z
Copy link
Contributor

poire-z commented Dec 16, 2019

Also CoverBrowser: Mosaic: better words wrap in text covers

  • Update words wrapping tweaks for use_xtext: add zero-width spaces around dots and underscores to allow more wraps.
  • Fix overlap of directory name and nbitems for long directory names.

Before:
image
image

After:
image
image


This change is Reviewable

- bump crengine: (Upstream) DocX: fix paragraphs with single hyperlink
- bump fribidi to 1.0.8 (for nested isolates fix)
- xtext.makeLine(): return no_allowed_break_met=true when that
  happens, so we know the line breaks inside a word.

TextBoxWidget: add forgotten property (when use_xtext=true) when no
line break opportunity was found: has_split_inside_word=true.
(Only used by CoverBrowser Mosaic mode to make nicer text covers
by reducing font size when that happens.)
@Frenzie Frenzie added this to the 2019.12 milestone Dec 16, 2019
@poire-z

This comment has been minimized.

Copy link
Contributor Author

poire-z commented Dec 16, 2019

Guess I'd better use utf8 hex codes for the zero width spaces... They're not visible in the diff, and probably to most people who use a modern text editor that supports utf8, unlike me :)
(edit: and let me check why these zero width spaces don't help on my Kobo...)

Update words wrapping tweaks for use_xtext: add zero-width spaces
around dots and underscores to allow more wraps.
Fix overlap of directory name and nbitems for long directory names.
@poire-z poire-z force-pushed the poire-z:bump_cre_fribidi_xtext branch from 528a604 to 7f2b9a8 Dec 16, 2019
@poire-z

This comment has been minimized.

Copy link
Contributor Author

poire-z commented Dec 16, 2019

OK. The last dot before suffix trick:
title = title:gsub("%.\xE2\x80\x8B(%w%w?%w?%w?%w?)$", "\xE2\x80\x8B.%1")
works in History (where I tested on the emulator), but not in FileBrowser (where I tested on my Kobo), because... of the bidi isolate wrap for filename, which adds a 3-bytes "Pop Directional Isolate" at the end of the filename there, so the 5x %w I try to match failed because there's 3+3 or 4+3 bytes there...
I was beginning to think these Bidi wrapping were going to get bothering - but I just realized we wrap them too early (in getMenuText, where I added that cause it was convenient), and it should be delayed to the last moment, where it's given to a TextWidget or TextBoxWidget.
Anyway, should not prevent merging this. But I'll need another pass on Menu.lua and these CoverBrowser files (maybe tomorrow).
No real issue not having that clean for the release, but you tell me how much time I have :)

@poire-z poire-z merged commit 1d55afa into koreader:master Dec 16, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@poire-z poire-z deleted the poire-z:bump_cre_fribidi_xtext branch Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.