View Single Post
Old 07-21-2015, 05:02 AM   #7
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
As others have said, you will need to remove the line-height style from some parts of the CSS to fix it. (And although it is not common, some books might also have a font: style, shorthand for font-family/font-size/line-height, that will need to be changed.)


The way I see it there seem to be two causes of the problem:

1. Calibre 'flattens' the CSS when you do a conversion, even just an EPUB --> EPUB conversion, which destroys some of the structure of the original stylesheet. Even if the book worked perfectly before the conversion it might not work properly after the conversion, because the CSS structure is different.

2. The publisher needs the power to override the user-selected line spacing in some special cases in order to get the proper layout, such as when the opening paragraph starts with an oversized capital letter. But unfortunately some publishers abuse this power by forcing a fixed line spacing to be used for the whole book.


To fix the problems:

1.A quick and dirty fix is to strip all line-height styles from the stylesheet, but beware that this will spoil the layout of some books. One way to do this is by adding line-height to Filter Style information --> Other CSS Properties when converting with Calibre.

Click image for larger version

Name:	calibre-convert.png
Views:	287
Size:	8.0 KB
ID:	140417

2. A slow but clean fix is to edit the stylesheet by hand and remove the line-height styles only from the classes used for paragraphs in the the main body of text. If the book was created/converted with Calibre you might also need to remove line-height from the .calibre class usually used for <body>. This fix is usually quite easy if you are editing the original epub, but it will be a lot more work if the book has had its stylesheet 'flattened' by Calibre.


(Similar causes and fixes apply when the use of text-align prevents the justification button working.)

Last edited by GeoffR; 07-21-2015 at 05:39 AM. Reason: added screenshot
GeoffR is offline   Reply With Quote