View Single Post
Old 02-21-2013, 04:09 PM   #4
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,694
Karma: 3818505
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
@elemenoP,

Try these simple changes (in red) in your custom Charis css file. This should increase the number of your epubs which 'just work':
Code:
@font-face { 
	font-family: serif; 
	font-weight: normal; 
	font-style: normal; 
	src: url(res:///Data/fonts/CharisSILR.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: bold; 
	font-style: normal;
	src: url(res:///Data/fonts/CharisSILB.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: normal; 
	font-style: italic; 
	src: url(res:///Data/fonts/CharisSILI.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: bold; 
	font-style: italic; 
	src: url(res:///Data/fonts/CharisSILBI.ttf); 
}
body, body.book, body.text, body.calibre, body.calibre1, body.calibre2, body.calibre3, body.calibre4 { 
	font-family: serif;
	text-align:justify;
	font-size: 1em;
	line-height: 3.2em;
	margin-top: 1em;
	margin-left: 1em;
	margin-right: 1em;
}
You will still have some epubs which don't work, in which case you need to do as Mark suggests and take a look at the internal css in the epub. You can only do this for non-DRM epubs. For example:
  • if the Charis font is not being displayed you should check the internal css for occurrences of font-family: something-or-other; and manually remove them.
  • if it's the massive line-height which isn't working, search the internal css for other occurrences of line-height: something-or-other; and manually remove them.

And another couple of comments whilst we're on the subject:
  • Your settings of margin-left: 1em; margin-right: 1em;
    I'm guessing you're trying to create page left/right margins. You might like to specify these in point-units (e.g. 5pt) rather than em-units. This is because em-units scale as you use the zoom button. Point-units will stay fixed no matter what you do with the zoom button.
  • Your setting margin-top: 1em
    I'm not sure what your aim is with this setting. It will just give you a top margin of 1em before the first paragraph only of each piece of the epub's html, which is usually a chapter. If your intention was to create some whitespace at the top of every page then you need to use an @page setting instead, e.g. @page {margin-top: 10pt} again using point-units rather than em-units. In fact you could use the @page for all your page borders if you wanted, i.e. change your Charis css code following all the @font-faces to something like (plug in whatever values you want)
    Code:
    @page {margin-top: 10pt; margin-bottom: 0; margin-left: 5pt; margin-right: 5pt}
    body, body.book, body.text, body.calibre, body.calibre1, body.calibre2, body.calibre3, body.calibre4 { 
    	font-family: serif;
    	text-align:justify;
    	font-size: 1em;
    	line-height: 3.2em;
    	margin-left: 0;
    	margin-right: 0;
    The above code should override any stupidly big margins in the original epub with your preferred values.
  • lastly, once you've got the Charis font and line-height displaying correctly, if the font-size isn't quite right for you, just adjust the font-size value from 1em to 0.95em or 1.05em (or whatever) until it's perfect.

Finally, please note that the latest version of PRS+ has introduced some extra options for adjusting font-size, page margins, line-height, etc directly from the Sony. But, IMHO, it does require a bit more experience with css style manipulation to get it to work satisfactorily.
jackie_w is offline   Reply With Quote