Closed initramfs closed 1 year ago
Fixed with https://github.com/johnfactotum/foliate-js/commit/99e246ecb854a1b3c5116c21b1faacd1342ff030 and https://github.com/johnfactotum/foliate-js/commit/0cebcb93c43bab53013c75823bebe69b1d531766.
center gap between the two pages
I think this is due to the default margin on the body element, which can be fixed with body { margin: 0; }
.
This might be an extremely minor nitpick but even with margin: 0; padding: 0
on the html
and body
elements there still exists a 1 pixel gap between the spreads:
Thorium renders both variants (stylesheet-less and with stylesheet) as truly gapless:
Relevant EPUBs here (contains original EPUB + EPUB with stylesheet): FXL-Test.zip
On another note: I'm not well versed with any specifications of default values for CSS properties besides what is shown here (I'm not sure if this is normative), but should the body margin be set to 0 px for FXL content?
A slight gap is visible in your Thorium screenshot as well. I think it's an antialiasing artifact (antialiasing being applied to the individual pages which causes the gap to appear). As far as I know it's not really something that can be fixed as the antialiasing is controlled by the browser engine. It works for me, though, when using 200% HiDPI scaling:
Regarding the default user agent stylesheet, as far as I can tell, there aren't any special requirements for fixed layout. For EPUB in general, the reading system spec says
a reading system's user agent style sheet SHOULD support the [html] suggested default rendering.
Okay, I can reproduce the gapless rendering with 200% scale as well, also noticed Thorium's gapless rendering might have a bug as well (where the pages are actually overlapped by 1 or 2 pixels, producing the AA artifacts), though that's hard to confirm (increasing zoom level causes pages to definitively overlap on my system though).
In any case, thanks for fixing this bug, seems to be the only FOSS epub renderer right now that can actually render FXL RTL correctly.
Note: Most of the problems below probably stem from foliate-js, which does seem to have a disclaimer claiming the FXL renderer is unfinished. At the very least this bug report can serve as implementation tests/milestones to complete the renderer.
For EPUB 3 fixed-layout documents with a page progression direction of
rtl
(right to left) several rendering and navigation issues occur, as described below:On opening the EPUB document, instead of the cover page being shown, a small white box is presented: from this screen, neither the forward or backward navigation keys work to move the reader past this initial white box, only navigation directly via clicking the links in the navigation document work.
Advancing past this page (via clicking a link in the navigation document/TOC allows forward/backward navigation to work again) but it is possible to hit "previous" on the cover page, which will land back on this initial white box and break navigation again.
Rendering of true spreads results in a center gap between the two pages: While section 8.2.2.4 of the EPUB 3.3 specification doesn't specify that a gap cannot be present, I believe the expected behaviour is for gapless rendering (as seen on other EPUB renderers like Thorium).
Rendering of synthetic spreads with a 'gap' in the spread properties (e.g.
rendition:page-spread-right
followed byrendition:page-spread-center
, orrendition:page-spread-center
followed byrendition:page-spread-left
[in RTL mode]) results in a small white box for the unpopulated viewport along with the inability to navigate past that viewport: In the above screenshot, the left viewport is left unpopulated by having page 3 (P-03) declared asrendition:page-spread-right
and having page 4 (P-04, not shown above) declared asrendition:page-spread-center
in the spineitemref
. Attempt to navigate forward/next past the unpopulated viewport is broken (i.e. does not advance viewer) but navigating back/previous works as expected.The same is true for an unpopulated right viewport with the same symptoms as the previous example but with an inability to navigate back/previous, but navigating forward/next works.
Center spread does not use the entire renderer's dimensions, resulting in an overly small spread: The viewport dimensions for a center spread seems to be limited to that of a single 'side' (i.e. left/right) spread, resulting in a landscape page (typical of pages marked with
rendition:page-spread-center
) to be rendered overly small.Cannot open books from the library that are fixed-layout RTL: All books that are fixed-layout RTL show up as blanks in the library that fail to open: The only way to get them opened in the first place is to directly open the EPUB with the application. The example book does have a correctly tagged cover page that does correctly show up in the "About this book" dialog box (in the renderer).
To Reproduce Steps to reproduce the behavior:
FXL-Test.epub
from the archive.Note: The provided EPUB document does contain a few additional metadata and language tag tests (that trip up other readers like Thorium) but passes
epubcheck
with 0 warnings or errors. If an absolute minimal EPUB file that triggers all the bugs denoted here without the additional (unrelated) tests is desired, one can be provided. An example of a language-tag rendering issue in Thorium is shown here.Expected behavior The following screenshots represent the hypothetical correct rendering of the test EPUB document exhibited above:
Version:
Additional information: epub.js has significant issues with rendering RTL fixed-layout document that cause much more severe rendering issues than what is described here (with appropriate bug reports opened for them), hence this bug report targeting the GTK4 branch and foliate-js, since the codebase for that renderer should be under this project's control.