View Single Post
Old 06-26-2015, 01:24 PM   #39
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
`Enforce user line spacing in ePubs` patch

I've updated the attachment to post #1 to include the `Enforce user line spacing in ePubs` patch, however this patch can no longer be used together with the `ePub fixed/adjustable top/bottom margins` patch, because I couldn't fit both patches in the available space for the EPUB stylesheet.

I've attached a copy of the patch here for those who want to paste it into their existing libnickel.so.1.0.0.patch file instead of downloading the zip attached to post #1:
Spoiler:
Code:
<Patch>
patch_name = `Enforce user line spacing in ePubs`
patch_enable = `no`
#
# This patch cannot be enabled if the `ePub fixed/adjustable top/bottom margins`
# patch is enabled.
#
# This patch causes the line spacing setting selected from the reading settings
# (Aa) menu to be applied at body and paragraph level, instead of just at body
# level. This will result in the user-selected line spacing setting taking
# effect in some books where it wouldn't before, but there will still be some
# books where it won't take effect (such as those where the publisher has used
# <div> instead of <p> for paragraphs), and some books where it does take
# effect when it shouldn't (such as those where the publisher has used <p>
# instead of <h1>, <h2>, etc. for headings). The only way to get perfect
# results is to edit the epub and fix the problems at source.
#
replace_string = B2FBE8, `\x20\0l\0i\0n\0e\0-\0h\0e\0i\0g\0h\0t\0:\0 \0%\01\0 \0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0;\0\n\0`, `}\0b\0o\0d\0y\0,\0p\0{\0l\0i\0n\0e\0-\0h\0e\0i\0g\0h\0t\0:\0%\01\0!\0i\0m\0p\0o\0r\0t\0`
replace_string = B2FC34, `\x20\0p\0a\0d\0d\0i\0n\0g\0-\0b\0o\0t\0t\0o\0m\0:\0 \0%\01\0e\0m\0 \0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0;\0\n\0`, `a\0n\0t\0}\0 \0b\0o\0d\0y\0 \0{\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0\n\0`
</Patch>

(I don't know if this patch is really very useful, because the way the stylesheet cascade works in the EPUB reader means the line spacing set in th book's stylesheet by the publisher will still have priority in most cases. The way that Calibre 'flattens' the stylesheet during conversion can also result in the line spacing becoming fixed so that this patch can't override it, even if the original book didn't have the problem.)

Last edited by GeoffR; 06-26-2015 at 01:52 PM. Reason: The way that Calibre 'flattens' the stylesheet ...
GeoffR is offline   Reply With Quote