View Single Post
Old 05-30-2011, 02:07 PM   #45
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,913
Karma: 4329601
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by kiwidude View Post
I'm pretty ignorant about the xpgt files and their purpose so forgive my dumb questions on this, but I want to make sure I have this right.
As you're a Kindle owner I'm more than impressed that you've been prepared to take on this epub project at all

Quote:
Originally Posted by kiwidude View Post
Does an xpgt file override css? So if you see an ePub squashed against the sides and you want to adjust it, you are saying that modifying the xpgt file will always "fix" the issue, regardless of what css is or is not present?
I stand to be corrected on this, but to the best of my knowledge the xpgt and css margins are cumulative. The css margins are visible in the calibre Viewer, the xpgt ones are not (this would be a nice Viewer enhancement but not relevant to this discussion).

I believe the xpgt margins are page-oriented. The xpgt is referenced in each and every epub html file in a <link> statement in the heading. To the best of my knowledge, if the epub css has left/right margins set to zero or no left/right margins at all, then non-zero margins in the xpgt will still result in whitespace around the text on every page when viewed on the device.

Calibre conversion PageSetup margins seem to be applied as follows:
- left/right are placed once, in the epub's css file in the css selector class used on the <body> tag
- top/bottom are placed in the heading of each and every epub html file between <style> tags as a
Code:
@page{margin-bottom: mpt; margin-top: npt}
Quote:
Originally Posted by kiwidude View Post
What if the ePub has no xpgt file? Would this function then be expected to generate and add an xpgt file to the ePub?
Probably not. It sounds like a lot of work and on the whole people find xpgt files a PITA and may not thank you for creating extra ones.
jackie_w is offline   Reply With Quote