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.
|