-
Notifications
You must be signed in to change notification settings - Fork 20
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
in scroll mode, "page width" (line length) is too short #130
Comments
PS: my opinion (as a user, not specifically a developer) has always been that configuring "margin sizes" is the wrong approach, to me it makes a lot more sense to allow customisation of the "line length" (optimal text run width depending on user preferences / abilities, available screen real estate, etc.). With this perspective in mind, the "margin size" is then just a byproduct / side effect of configuring the "page width" (not the other way around, as was the case in Readium "1" if I remember correctly). Side note: the implementation of margin indicators (e.g. highlights / annotations), previous/next icon buttons (+ various other reading system affordances) must factor in the fact that margins are dependent on (derived from) the chosen / preferred / default line width. |
👍 I'm also in favor of adding an explicit I would still keep an explicit |
Thanks Past Me for documenting design decisions, etc. as it helped catching up on this issue quite a lot. So @danielweck pointed the variable pagination/scroll are using internally e.g. As a side note, it was also used to force a reflow in webkit-based views/browsers. I’ll have to check whether that bug still occurs as a side quest. While scroll mode is obviously not using CSS multicolumn, it’s re-using these variables – either explicitly or through the cascade. readium-css/css/src/modules/ReadiumCSS-scroll.css Lines 24 to 27 in 5830114
And the user setting for page margins ( readium-css/css/src/modules/user-settings-submodules/ReadiumCSS-pageMargins_pref.css Lines 9 to 12 in 5830114
This also points out an issue in documentation as these 2 are explicitly listed under Anyways, I guess adding a |
TODO: define how a One could complain it only works in scroll mode while it could also be applied in single column – but in that case how should it behave in 2 columns (pseudo spread). Also, how it should interact with |
Draft for a proposed resolution.
At the moment it’s still unclear to me how this should behave in 2-columns as I need some practical implementation to see what’s possible. |
Note to self: some authors’ styles may have a |
Proposed resolution: While page margins can be kept for Reading System purposes and even as a user setting – if only for legacy/deprecation, a new USER variable should be created for line length so that it can be set. It’s still unclear what would be best as a value e.g. CSS units (length), multiplier as is the case with page-margins, etc. so please feel free to record your preference in this issue. This line length setting should override authors’ Documentation should be updated accordingly. |
The problem with "margins" in "pages" is that this tangible / physical concept does not technically map to column gap very well, as the whitespace is uniformly distributed across columns. This equidistant property is an inherent characteristic of the layout model which we can't fix (and it has its benefits anyway, so better live with it) but this is a problem on any widescreen, let me post screenshots which are easier than words :) |
The image above is a mockup, that's what I'd like to achieve in Thorium navigator ... technically it's a bit more complicated than it looks due to viewport calculations and applying masks (to hide the before/next CSS columns beyond the current page spread) The margin indicators for annotations would still work, but there would be a number of changes in the arithmetics involved in computing character-level visibility, etc. It's a lot trickier than it sounds due to the current layout model. To be honest, the more I think about it, the more I believe the easiest (less bug-prone) solution would be to shrink the actual viewport (out of process iframe, in Electron) and possibly collaborate from the navigator with the application to achieve the desired rendering layout. |
Yes, that's my sentiment as well. But it gets tricky to have proper page-turn animations. Maybe using snapshots we can provide a better experience with slide or fade-out pages. |
Ah yeah sorry I’ve just noticed that the wording of the resolution wasn’t super clear so I’ll try my best to clarify for the benefit of everyone reading this conversation first. So I’d be more than happy to remove And I guess that with a new
However, that doesn’t fundamentally change how things currently work, it just replaces page margins with users’ line length (or the default one). So question. Would removing any inline margin, padding, (gut feeling is not zero-ing the column |
A couple of thoughts:
|
Yeah to be fair the mention of “experimental features” in #139 was already a hint that maybe we would draw the conclusion a new major version may be warranted. In any case in hindsight it’s become clear we should remove the pain points for implementers and keep the library as an unopinionated tool. When reviewing issues, I became aware that a lot were maybe symptoms of a bigger problem – something I tried to explain in the doc. So that may well change the perception of pagination and how it’s designed. We’re already removing “responsive columns” so that apps/toolkits can implement that aspect as they see fit. Going the extra mile and trying another approach wouldn’t be that surprising to be honest. |
Would you mind explaining what does that entail? |
@mickael-menu I may create a Codepen demo so that it’s a little bit easier to experience directly in a browser and can serve as an illustration but basically, there’s no limit to the number of columns visible in the viewport. If it’s large enough and it can fit 3 columns ( What So that’s why I’m not sure whether it could be a better option, especially as CSS Multicol is one of the rare specs that doesn’t ship with a JavaScript API, and you can’t access easily the number of columns it has created, the dimensions of the “paginated document”/fragmented box, the dimensions of the columns, etc. Things may become overly complex real fast, or maybe it could actually help as the app would be in control of the entire thing. I don’t personally have an answer to that question. |
How would an app hide the extra visible columns in this case? If it's displaying a blank view above them, that might be an issue for the page-turn animations (scrolls mostly). |
yeah my naive description / wishlist above blissfully ignored the fact that the CSS column layout heuristics create some kind of push/pull tension between "what I ideally want" and "what the rendering engine decides to do". |
See edrlab/thorium-reader#2061
Relevant code and doc: https://github.com/search?q=repo%3Areadium%2Freadium-css%20RS__maxLineLength&type=code
The text was updated successfully, but these errors were encountered: