readium / ts-toolkit

A toolkit for ebooks, audiobooks and comics written in Typescript
BSD 3-Clause "New" or "Revised" License
65 stars 10 forks source link

FXL improvements #75

Open JayPanoz opened 1 month ago

JayPanoz commented 1 month ago

We’re aware Navigator could do with some improvements for Fixed-Layout EPUB support, which is why it could be a good idea to have this issue so that people can discuss and weigh in. It should eventually lead to prioritisation of the bits and pieces to support.

Right now, to determine whether it should display a single page or a spread, FXLFramePoolManager primarily checks if it’s in portrait. The portrait getter uses a combination of the manifest's presentation.spread property (only checking for spread: none at the moment), and the current orientation of the screen, determined by the height being larger than the width. This serves as some sort of auto-layout mode for FXL that implementers get out of the box.

In Readium Playground, we already set some requirements re. a full-fledged auto-layout:

As for the user setting:

Note there’s a resize handler on resize and orientationChange. Not sure whether implementers would like to disable/prevent it, but this issue should hopefully help answer such a question.

chocolatkey commented 1 month ago

@JayPanoz Something I think would be useful for this discussion would be some examples of EPUBs with complex spread layout. The logic I implemented as a stopgap measure in the ts-toolkit at the moment has worked well for a large selection of EPUBs at DeMarque, because they're all just a simple "book-like" layout, with each page being like the page of a physical book, and landscape pages being full spreads.

JayPanoz commented 1 month ago

Yeah completely agree. At the time we created ReadiumCSS, we built a test-case of reflowable EPUB files that could help inform decisions and implement features reliably. It took a little bit of time at first but helped save a lot further down the line. It would be a good idea to do that for FXL too.

This is probably something we want to discuss with other Readium maintainers during the next call, as it could benefit them as well.

mickael-menu commented 1 month ago

If that's of any help, I modified Bella the dragon a while back to get unusual dimensions for testing purposes:

bella-landscape.epub.zip bella-tall.epub.zip

qnga commented 1 month ago

What about page: left/right?