ts-toolkit
ts-toolkit copied to clipboard
FXL improvements
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:
- defaulting to a single page spread for anything smaller in width than an arbitrary breakpoint (e.g. iPad in landscape mode)
- displaying a two page spread for anything larger than that
- but supporting the following properties as well:
"page": "center"to force a single centered page"meaningfulSpread": trueor"spread": "both"in thereadingOrderto force the display of a full spread.
As for the user setting:
- support for a single page mode
- support for a forced spread mode
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.
@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.
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.
If that's of any help, I modified Bella the dragon a while back to get unusual dimensions for testing purposes:
What about page: left/right?