Skip to content

Upgrade to Readium CSS v2 #38

@mickael-menu

Description

@mickael-menu

The new Readium CSS v2 is almost ready. We want to upgrade the mobile toolkits' Preferences API to support it.

We probably need to revisit #5 at the same time.


Implementation feedback from Daniel (Slack):

Hello, Thorium update: FYI, I cherry-picked the ReadiumCSS v2 technique to scale the font size proportionally across headings etc. (zoom). This was a trivial change in our local copy of ReadiumCSS (still v1) ... however, as I anticipated, the introduction of zoom broke our highlighting engine (which is used to render annotations, search results, TTS utterances + word-level segments). Thankfully I found solutions that didn't require a complete rewrite 😉
To be precise, the highlightings powered by the web browser's native functionality (CSS.Highlights) were unaffected: "underline", "strikethrough" and "solid background". However we render SVG polygons for the "outline" style, for margin indicators, and for mouse cursor hit-testing (we actually render "underline" in Japanese vertical documents with SVG due to problems with the native technique). Recently we also introduced a new TTS highlighting style that masks surrounding text in order to put the emphasis on the currently-playing DOM Range, as well as a "sliding ruler" variant of this masking visual effect. The polygons used to implement all this exist in the (slightly different) coordinate systems of reflowable documents in scroll and paginated modes (right-to-left, left-to-right, and vertical writing mode), and of course in fixed layout documents (which have they own zooming technique separate from ReadiumCSS zoom).
The one thing I had to change in ReadiumCSS v2 zoom is where it is applied: in Thorium due to how we paginate (CSS columns) we can't zoom the HTML root element, instead we apply the rule to the body element

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions