Thread: PRS-T1 Modified Sony home screen
View Single Post
Old 07-15-2012, 10:25 PM   #366
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@JSWolf,
You are welcome to add your own opinions, but neither yours nor mine are the 'One True Way'. But taking your points one at a time:
  • I included a line-height merely as an illustrative option of what you can use if you feel like it, along with an example of how to supercede it when using a different font. In addition, the case for including it is that it is a good way of (trying) to override an unwanted line-height value which may already be in an epub's internal css file. Retail epubs often set a line-height in their body{...} css.
  • Similarly, I listed the @page{...} as optional. It's a way (I think) of
    a) not needing to add margins to every single epub using calibre
    b) overriding page margins in calibre epubs, that you wish you'd never put in, in the first place.
    Putting the @page{} in here should override any already in the epub. I think I need to test that rash statement tomorrow. Edit: Did some testing. I'm sticking to my original reasoning.
  • Adding margin-left: 0; margin-right: 0 in the body{...} css. I'll concede that one and add it to the original post. It's a good way to try and neutralise the ludicrous left/right margins, publishers put in retail epubs. I missed it because it's one of the things I obsessively edit manually in every epub.
  • Adding margin-top: 0; margin-bottom: 0; to the body{...} css. This may suit you (and probably many others) but it wouldn't suit everyone, me for one. I like a bit of space between some types of paragraphs and a lot of space between other types e.g. scenebreaks. Include it if you want, but it's one of the things that is difficult to achieve your 'perfect' result unless you manually selectively edit parts of every epub.
  • With retail epubs which have DRM still in place and which include their own embedded fonts, you have a better chance of overriding with your custom font choice if you put the font-family: serif in a body{...} statement, as per my example, rather than the html{...} statement, as per your example.
    However, some people may like to use the publisher's embedded font in these special circumstances. In which case, your way is better. Although, since most (95%+ ?) retail epubs which do embed fonts, embed the standard Charis font rather than your superior darkened version (did I really just say that ) why would I ever want to use the embedded font.
  • Re: widows and orphans... I deliberately didn't include these for 2 reasons. Firstly, this was meant to be a primer and not everyone knows (or cares) what widows and orphans are. Secondly, and more important, I have tried to use them on the PRST1 and couldn't get them to work. I frequently saw multi-line paragraphs which had the first line on one page and the rest of the paragraph on the next page - which I thought those settings were supposed to stop. I also saw the converse, namely all but the last line of a paragraph on one page and its last line on the next page.
    [Edit: for anyone who cares strongly about widows and orphans. After further testing, you can try to override any epub internal css by editing the body{...} statement of default.css as follows:
    1. to specifically NOT ALLOW widows and orphans, add widows: 2; orphans: 2;
    2. to specifically ALLOW widows and orphans, add widows: 0; orphans: 0;
    Doing nothing at all should be equivalent to (a), unless the epub creator has specified otherwise in the epub's internal css.
  • As for repeating all css code in all css files. You can choose to do it this way if you prefer, but I'm an old-school programmer type. If I have to hard-code anything, I do it in the minimum of places so that when I want to change it I only have to do it once. It's purely a personal choice and everyone should do what they are most comfortable with.
  • Lastly, people who are new to all this may not want to get into the finer points of using calibre's 'Modify Epub' plugin (which would also require learning about DRM removal beforehand) . I'm trying to suggest a default.css file which can customise as many epubs as possible without having to learn much about css, and nothing at all about DRM removal and calibre plugins. [Added: calibre's Modify Epub plugin is an excellent tool, for those who wish to dig a bit deeper.]

BTW, I'm happy to further debate Sony vs. css best practice with you, if you like, but this thread is not the place to do it. PM me any time you like. Might be fun

Last edited by jackie_w; 07-17-2012 at 07:32 AM. Reason: followup on widows & orphans
jackie_w is offline