View Single Post
Old 06-14-2015, 06:41 AM   #17
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
I've added the missing `Fix kepub side bearing font cut-off bug` patch to the attachment in post #1, and included it below so you can paste it into your current libnickel.so.1.0.0.patch file:

Spoiler:
Code:
<Patch>
patch_name = `Fix kepub side bearing font cut-off bug`
patch_enable = `no`
# Multi-version patch: 3.16.0 - 3.16.0+
#
# In kepubs, characters with large side bearing values (such as italic f, J) can
# be cut off if they appear at the very end of a line. The problem occurs in
# normal reading mode when the margin adjustment slider is set to minimum and
# in full-screen mode at any margin slider setting. To fix it this patch adds
# one of the following lines to the built-in kepub stylesheet, depending on
# patch options chosen (first line is the default if no options are changed):
#
#  body>div{padding-left:.2em!important;padding-right: .2em!important}
#  body>div{padding-top: .2em!important;padding-bottom:.2em!important}
#  body>div{padding:     .2em                          .2em!important}
#  body>*  {padding-left:.2em!important;padding-right: .2em!important}
#  body>*  {padding-top: .2em!important;padding-bottom:.2em!important}
#  body>*  {padding:     .2em                          .2em!important}
#
# There are two main types of kepub, each affected differently by this patch:
#
# Type 1: kepubs created by Kobo from epub2 books, or created by Calibre with
#         a recent version of the KoboTouchExtended driver.
#
# Type 2: kepubs created by Kobo from epub3 books, or created by Calibre with
#         an old version of the KoboTouchExtended driver.
#
# Type 1 kepubs work best with this patch, the only side effects should be
# slightly larger screen margins. Some Type 2 kepubs might suffer additional
# side effects such as extra horizontal or vertical space between elements.
# There is an option below (marked **1**) where you can choose whether to
# fix the bug only for Type 1 kepubs (default) or for both types.
#
# There are also options below (marked **2**) to make the patch suit kepubs
# with horizontal or vertical text directions, or both. The side effects for
# Type 2 kepubs will likely be worse if the option for both horizontal and
# vertical is chosen.
#
find_base_address = `.\0K\0B\0H\0i\0g\0h\0l\0i\0g\0h\0t\0i\0n\0g\0,\0 \0.\0K\0B\0S\0e\0a\0r\0c\0h\0R\0e\0s\0u\0l\0t\0 \0{\0 \0b\0a\0c\0k\0g\0r\0o\0u\0n\0d\0-\0c\0o\0l\0o\0r\0:\0 \0#\0C\06\0C\06\0C\06\0`
#
replace_string = 0000, `.\0K\0B\0H\0i\0g\0h\0l\0i\0g\0h\0t\0i\0n\0g\0,\0 \0.\0K\0B\0S\0e\0a\0r\0c\0h\0R\0e\0s\0u\0l\0t\0 \0{\0 \0b\0a\0c\0k\0g\0r\0o\0u\0n\0d\0-\0c\0o\0l\0o\0r\0:\0 \0#\0C\06\0C\06\0C\06\0 \0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0;\0 \0}\0 \0\t\0`, `.\0K\0B\0H\0i\0g\0h\0l\0i\0g\0h\0t\0i\0n\0g\0,\0.\0K\0B\0S\0e\0a\0r\0c\0h\0R\0e\0s\0u\0l\0t\0{\0b\0a\0c\0k\0g\0r\0o\0u\0n\0d\0-\0c\0o\0l\0o\0r\0:\0#\0C\06\0C\06\0C\06\0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0}\0.\0K\0B\0S\0t\0a\0c\0k\0K\0`
#
replace_string = 0098, `.\0K\0B\0S\0t\0a\0c\0k\0K\0e\0y\0w\0o\0r\0d\0,\0 \0.\0K\0B\0S\0e\0a\0r\0c\0h\0R\0e\0s\0u\0l\0t\0,\0 \0.\0K\0B\0A\0n\0n\0o\0t\0a\0t\0i\0o\0n\0,\0 \0.\0K\0B\0H\0i\0g\0h\0l\0i\0g\0h\0t\0i\0n\0g\0 \0,\0 \0K\0B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i\0v\0{\0p\0a\0d\0d\0i\0n\0g\0-\0l\0e\0f\0t\0:\0.\02\0e\0m\0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0;\0p\0a\0d\0d\0i\0n\0g\0-\0r\0i\0g\0h\0t\0:\0 \0.\02\0e\0m\0!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0}\0 \0`
#
# Fix typo in annotations styles: KBAuthorAnnotation --> .KBAuthorAnnotation
replace_string = 0102, `\x20`, `.`
#
# Choose padding size: 1 = 0.1em, 2 = 0.2em, etc.
replace_string = 05FA, `2`, `2`
replace_string = 0636, `2`, `2`
#
#
# **1** Choose to fix bug for Type1 kepubs only, or both Type1 and Type2 kepubs.
# Default fixes the bug for Type 1 kepubs and has no effect on type 2 kepubs.
#
# Uncomment the following replace_string line to fix the bug for both types,
# but beware there can be undesirable side effects for some Type 2 kepubs:
#replace_string = 05CC, `b\0o\0d\0y\0>\0d\0i\0v\0`, `b\0o\0d\0y\0>\0*\0 \0 \0`
#
#
# **2** Choose padding location to suit text direction of your kepubs.
# Default is left/right padding (suits horizontal text directions only.)
#
# Either uncomment the following two replace_string lines for top/bottom
# padding (suits vertical text directions only) ...
#replace_string = 05EE, `l\0e\0f\0t\0:\0`, `t\0o\0p\0:\0 \0`
#replace_string = 0626, `r\0i\0g\0h\0t\0:\0 \0`, `b\0o\0t\0t\0o\0m\0:\0`
#
# ... or else uncomment the following two replace_string lines for top/bottom
# and left/right padding (suits both horizontal and vertical text directions,
# but may have some undesirable side effects on the layout of Type 2 kepubs,
# such as extra space between paragraphs.)
#replace_string = 05EC, `-\0l\0e\0f\0t\0:\0`, `:\0 \0 \0 \0 \0 \0`
#replace_string = 0600, `!\0i\0m\0p\0o\0r\0t\0a\0n\0t\0;\0p\0a\0d\0d\0i\0n\0g\0-\0r\0i\0g\0h\0t\0:\0`, `\x20\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`
#
</Patch>


The patch has changed a little but I think it will work just as well. (The new patch employs the body>div selector instead of the div#book-columns selector to save some space.)
GeoffR is offline   Reply With Quote