View Single Post
Old 05-05-2013, 08:28 AM   #3
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Assuming that you are using an already existing engine to render the XHTML pages, what you should do is patching the source code of the pages extracted from the EPUB container, before passing them to the renderer.

In general, this will require analyzing the CSS cascade, the XHTML of the page (style can be defined both in <head> and inline), etc. Wherever needed, you must change/add your own style definitions for the various elements, according to your user-generated settings.

It is a pretty complicate endeavour, but a simple start consists in injecting the user-generated settings as last <style> element in the head of the XHTML page. This overrides CSS declarations, but it might be overridden by inline style statemets. However this technique should probably suffice for a vast majority of eBooks.
AlPe is offline   Reply With Quote