View Single Post
Old 05-25-2022, 07:59 AM   #855
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 446
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by Barty View Post
The idea is to lazily tweak CSS.
If selection is Some(Selection { start: TextLocation::Dynamic(offset), .. }), then offset is an absolute byte offset that refers to a particular position in the spine seen as a continuous byte stream.

You can find the underlying vertebra using EpubDocument::vertebra_coordinates. You'll then need to parse that file as XML and find the element with the biggest byte offset less or equal to offset - start_offset.

I guess you'll also have to store the additional rules in the reading state.
baskerville is offline   Reply With Quote