-
Notifications
You must be signed in to change notification settings - Fork 7
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
Checklist for Readium CSS integration #1
Comments
When choosing a specific font, as a rule of thumb we should fall back on one of the known font stacks, e.g. --USER__fontFamily: "SF Mono" var(--RS__monospaceTf); |
We discussed about this in private so for the benefit of everyone, here is a recap on the concept of type scale, its purpose and use cases. DefinitionType scale, also known as modular scale, is a sequence of numbers that relate to one another in a meaningful way. As typographer Robert Bringhurst put it:
So in ReadiumCSS we have this
An interactive web app such as this one will illustrate what happens when you change the type scale. For more details, you can also check this 2011 article. PurposeIt was initially implemented in ReadiumCSS as a way to get relatively foolproof typography in many circumstances – it’s also implemented in the default stylesheet for instance. And we also had this issue of the font-size setting which doesn’t have anything standard in CSS (or a JS API) so we parsed lots of stylesheets to find a reasonable default ratio ( It became clear it was a good idea to expose this variable to reading system developers so that they could change this ratio as they see fit. Use cases
Admittedly all of these use cases are kinda going the extra mile, but it could also be a “design differentiator” if you’re willing to take great care of typography in your app – we’ve done our best to provide a sound and better-than-average basis in ReadiumCSS so handling this [Edit] I guess we could add this comment AS-IS in the Readium CSS docs if it can be helpful (after all we already have a glossary for i18n). |
Although the vast majority of the UX can be ltr, I’m noticing that vertical writing + the toc panel is an open question BTW. In Requirements for Japanese Text Layout:
They just mention indexes for |
On a related note, would you like this warning about Mongolian directly in the docs? It only exists in this ReadMe at the moment. |
So yeah there’s this issue in Readium CSS for that. If we deem it’s in ReadiumCSS’ scope (although it hasn’t necessarily been clarified it would be trivial to handle it in a efficient and compatible way with the Highlights API we discussed months ago), then it would have to go through a major “code change.” There’s also this issue in r2-navigator-js which should be relevant to this discussion. |
Thanks for the explanation, the use cases are particularly useful 👍 So for mobile test apps, I think it's fine to ignore this property for now to keep it simple. I actually think that we need a native wrapper/module around Readium CSS for mobile toolkits. Something similar to what we have with
Except for the effective reading progression and the primary language, which should probably be in the shared models + EPUB parsers and not particularly tied to Readium CSS. (I'm not sure about This wouldn't be the upcoming "Rendering/User Settings" API, which should be format-agnostic. But this would be a lower-level API that the User Settings API would use when rendering EPUBs.
I think it would make sense, I actually didn't read the README in
After thinking more about this, I believe that highlights should not be in the scope of Readium CSS. If we have some default highlight colors in Readium, they should maybe be documented in |
Some quick answers for the stuff that doesn’t need much thought.
So Then But yeah in the end ReadiumCSS is relying on this as a web browsers actually do (default font-stacks, word breaking rules, etc.).
Just noticed this morning, sorry. I can see I should also mention the fact only Windows has a typeface for traditional Mongolian – Android you have to install a downloadable font if I’m not mistaken, iOS and web you’re pretty much out of luck. I tried contacting the type designer of a popular Mongolian font in 2018 so that Readium projects could use it – through a contact form in Chinese – but never got an answer, unfortunately.
Yeah me neither given how limiting a ReadiumCSS module would be. And we shouldn’t forget other formats – I’m assuming web publications could have TTS with sync/overlaid highlights, notes, etc. as differentiating features from web browsers. So we should probably open a vote in the ReadiumCSS issue tracker on dropping this highlights module. |
An issue related to Readium CSS, but to be fixed on the native side: Some books won't change their font size unless publisher's styles are disabled (note to self: 9782081418011.epub). This occurs when a book uses absolute font units, which Readium CSS can only handle when the Here are two potential solutions which require to provide a native wrapper for Readium CSS, to handle this seamlessly for reading apps:
|
Here are a few points regarding the Readium CSS integration which should be double-checked or fixed in the mobile toolkits.
ReadiumCSS-default.css
needs to be injected if the book doesn't have any style.allowtransparency
to make sure that background color settings work properly.Should we use Readium CSS highlight colors? There's an on-going discussion.Nope.xml:lang
.<dc:language>
, thepage-progression-direction
must be taken into account.dir=
attribute with CJK languagesThe text was updated successfully, but these errors were encountered: