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

RTL fixed layout spread mode rendition.display() always display the offset at right panel #1070

Open
hyhchan opened this issue Jun 1, 2020 · 2 comments

Comments

@hyhchan
Copy link

hyhchan commented Jun 1, 2020

when displaying RTL fixed layout epub consists of one pic per page:
rendition.display(offset) when offset is odd number, the offset page is displayed on the right panel (correct) but the corresponding left page (the next page for rtl epub) is blank.
when offset is even number, the offset page is displayed on the right panel with the next page on the left panel. Expected behaviour is displaying on the left panel, with the right panel displaying the previous page. Even if the spine item has "page-spread-left" specified the attributed is just ignored.

@danielweck
Copy link

hello, would you mind sharing a test file for this? many thanks!

@hyhchan
Copy link
Author

hyhchan commented Jun 2, 2020

This is a epub I made to test the rtl.

test-rtl-epub.zip

I tried to trace the calls but I don't have enough overall knowledge to completely understand what's under the hood, but if the display() call is routing to the default manager display(), it seems that the logic assume the page is rendered on the left, and check if the page is forced to be displayed on the right. If it is forced to be displayed on the right then it just skip a blank page and put the page on the right. It's ok on flipping pages on ltr books, but if the display is jumped (by calling display(offset) or a click from the TOC which lands on the opposite page) the left page will be blanked (as in #927 on the last comment), also if the book is rtl the first page is already at the right and will probably has the page-spread-right tag on the itemref and the code will just skip the left page. And it seems that on a rtl book the code will put the first render on the right panel, and without checking page-spread-left the request to put the page on the left is never realized.

Again this may be the wrong place to look for the error but hope it helps ...

And if this is the place the error occurs, one quick fix maybe when rendering pre-paginated page, always check for the page-spread-* flag and then always render the opposite page (don't know if this logic will break flow layout epubs, but for pre-paginated pages it should work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants