View Single Post
Old 10-17-2015, 12:50 AM   #43
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
`Force user line spacing in ePubs`

This patch prevents the ePub reader from recognising the line-height property in the book's stylesheet, which has the same effect as completely stripping the line-height property or filtering it out during a Calibre conversion.

I don't recomment using this patch because it will spoil the formatting of some well-made ePubs, it is better to selectively fix just the badly-made ePubs and leave the well-made ones alone, but if you are routinely stripping the line-height from all your books anyway anyway then this patch does no worse.

This is a two-part patch, it is a stronger replacement for the `Enorce user line spacing in ePubs` patch which doesn't work on many books, so disable that patch if you were using it. Paste this patch at the end of the libnickel.so.1.0.0.patch file, otherwise it will interfere with the `ePub unitless line height` patch.

(This patch should work on all firmware versions from 3.3.0 onwards, but to apply it to versions 3.3.0 - 3.12.0 you would need to use the patch32lsb tools from the instructions for patching firmware version 3.12.1 or later.)

Part 1: paste at the end of libnickel.so.1.0.0.patch
Spoiler:
Code:
<Patch>
patch_name = `Force user line spacing in ePubs (part 1 of 2)`
patch_enable = `yes`
# Multi-version patch: 3.3.0 - 3.18.0+
#
# This is part 1 of 2. Also enable part 2 in librmsdk.so.1.0.0.patch
#
# This patch prevents any line-height style set in the book's stylesheet from
# being recognised. It will spoil the formatting of some books, but will ensure
# that the line spacing set with the adjustment slider takes effect.
#
find_base_address = `\0\0\x20\0l\0i\0n\0e\0-\0h\0e\0i\0g\0h\0t\0`
replace_string = 0004, `l`, `_`
</Patch>


Part 2: paste into librmsdk.so.1.0.0.patch
Spoiler:
Code:
<Patch>
patch_name = `Force user line spacing in ePubs (Part 2 of 2)`
patch_enable = `yes`
# Multi-version patch: 3.3.0 - 3.18.0+
#
# This is part 2 of 2. Also enable part 1 in libnickel.so.1.0.0.patch
#
# This patch prevents any line-height style set in the book's stylesheet from
# being recognised. It will spoil the formatting of some books, but will ensure
# that the line spacing set with the adjustment slider takes effect. (Unless
# the publisher has used the font shorthand style; see below.)
#
find_base_address = `\0line-height\0`
replace_string = 0001, `l`, `_`
#
# Uncomment the following two lines to also prevent the font shorthand style
# from being recognised. The font shorthand style is not very common in ePubs,
# but where used it can also prevent the line spacing from being adjusted.
# Beware that this option will likely have much bigger side-effects on the
# book's formatting, because the font shorthand style is used to set the
# font-size, font family, and other styles in addition to line-height.
#
#find_base_address = `\0font\0`
#replace_string = 0001, `f`, `_`
</Patch>
GeoffR is offline   Reply With Quote