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

Epub Right to left fixed layout navigation cannot turn to next page when in landscape mode #415

Closed
hyhchan opened this issue May 31, 2020 · 7 comments
Labels
epub.js Related to Epub.js not our bug Needs to be fixed upstream or elsewhere

Comments

@hyhchan
Copy link

hyhchan commented May 31, 2020

When reading fixed layout epub that progress from right to left in the landscape mode, the navigation to advance to the next page doesn't work. Pressing right arrow will go back to previous page, and pressing left arrow has no effect. Portrait mode (showing only one page) works.

In the previous version (2.1.2) the navigation in landscape mode works but pressing right arrow will advance while pressing left arrow will go back to previous page (looks like the progression direction was ignored).

Further, when jumping to a particular page (say by entering the page number or selecting a chapter mark that links to an odd number page) the page will always shown on the right side. And then the pages afterwards will be shifted by one page. On Apple books if the chapter mark falls on an odd number page (the page should show up on the left side) the page will render on the right and the previous page (page i-1) will show up on the right side, so the fixed layout moving forward will be preserved.

attached a test epub file that I created to show the issues. The file works as intended on Apple Books app.

test-rtl-epub.zip

Thanks

@johnfactotum
Copy link
Owner

These are Epub.js bugs (it only happens in more recent versions of Epub.js; the version used on their website is outdated).

About the second point, I did notice this with fixed layout books; see futurepress/epub.js#927 (comment). Not sure why navigation is broken, but probably due to the same PR.

@johnfactotum johnfactotum added epub.js Related to Epub.js not our bug Needs to be fixed upstream or elsewhere labels Jun 1, 2020
@hyhchan
Copy link
Author

hyhchan commented Jun 1, 2020

As you said maybe they haven't update their testing version on their website yet. I tried opening epub on https://futurepress.github.io/epub.js/examples/input.html and the
rendition.next() and rendition.prev() works as expected, although the rendition.display() call seems to make the called offset page always on the right panel and screw up the display.
I think I can help doing some testing but need some direction on where to start.

@johnfactotum
Copy link
Owner

johnfactotum commented Jun 1, 2020

The release builds are available on jsDelivr: https://cdn.jsdelivr.net/npm/epubjs/dist/, which is convenient when quickly testing the released versions.

To build it yourself, clone Epub.js's repo and run npm install then npm run prepare, then you can open /examples/input.html.

@hyhchan
Copy link
Author

hyhchan commented Jun 5, 2020

Tracked down some of the bugs in epub and reported 2 issues related to this futurepress/epub.js#1069 and futurepress/epub.js#1070 but looks like it is no easy fix ... it's related to how epub process books and probably will need some big overhaul to incorporate rtl book flows.

@hyhchan
Copy link
Author

hyhchan commented Jun 6, 2020

@johnfactotum I did some really dirty hack to epub.js to make the RTL fixed layout work for me, but no guarantee that it will work on other epubs nor will it break any working epubs. Let me know if you want to take a look and see if you want to incorporate those into foliate before epub.js is fixed properly.

@johnfactotum
Copy link
Owner

@hyhchan Can you open a PR to Epub.js? You can add "WIP" in the title or make it a draft if you feel that it's not ready for merging.

@johnfactotum
Copy link
Owner

Fixed in the new renderer (#962).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epub.js Related to Epub.js not our bug Needs to be fixed upstream or elsewhere
Projects
None yet
Development

No branches or pull requests

2 participants