<Patch>
patch_name = `Fix kepub side bearing font cut-off bug`patch_enable = `yes`## In kepubs, characters with large side bearing values (such as f) can be cut# off if they appear at the very end of a line. The problem seems to be most# noticable in full-screen mode. To fix it this patch adds one of the following# lines to the built-in kepub stylesheet:## div#book-columns{padding-left:.2em!important;padding-right: .2em!important}# div#book-columns{padding-top: .2em!important;padding-bottom:.2em!important}# div#book-columns{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 new 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.##replace_string = DB4470, `.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x0 0h\x00t\x00i\x00n\x00g\x00 \x00{\x00 \x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d \x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00 \x00#\x00C\x006\x00C\x006\x00C\x006\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x0 0h\x00t\x00i\x00n\x00g\x00{\x00b\x00a\x00c\x00k\x0 0g\x00r\x00o\x00u\x00n\x00d\x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00#\x00C\x006\x00C \x006\x00C\x006\x00!\x00i\x00m\x00p\x00o\x00r\x00t \x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00S\x00t\x00a \x00c\x00k\x00`#replace_string = DB44E6, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x0 0y\x00w\x00o\x00r\x00d\x00,\x00 \x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R \x00e\x00s\x00u\x00l\x00t\x00,\x00 \x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t \x00i\x00o\x00n\x00,\x00 \x00.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g \x00h\x00t\x00i\x00n\x00g\x00 \x00,\x00 \x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n \x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00{\x00 \x00f\x00o\x00n\x00t\x00-\x00s\x00i\x00z\x00e\x00:\x00 \x001\x000\x000\x00%\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00-\x00w\x00e\x00b\x00k\x00i\x00t\x00-\x00t\x00e\x00x\x00t\x00-\x00c\x00o\x00m\x00b\x00i\x00n\x00e\x00:\x00 \x00i\x00n\x00h\x00e\x00r\x00i\x00t\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `K\x00e\x00y\x00w\x00o\x00r\x00d\x00,\x00.\x00K\x0 0B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x0 0u\x00l\x00t\x00,\x00.\x00K\x00B\x00A\x00n\x00n\x0 0o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x0 0B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\x00t\x0 0i\x00n\x00g\x00,\x00 \x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n \x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00{\x00f \x00o\x00n\x00t\x00-\x00s\x00i\x00z\x00e\x00:\x001\x000\x000\x00%\x00! \x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00; \x00-\x00w\x00e\x00b\x00k\x00i\x00t\x00-\x00t\x00e\x00x\x00t\x00-\x00c\x00o\x00m\x00b\x00i\x00n\x00e\x00:\x00i\x00n \x00h\x00e\x00r\x00i\x00t\x00!\x00i\x00m\x00p\x00o \x00r\x00t\x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00S \x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l \x00t\x00{\x00b\x00a\x00c\x00k\x00g\x00r\x00`#repl ace_string = DB4626, `.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x0 0e\x00s\x00u\x00l\x00t\x00 \x00{\x00 \x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d \x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00 \x00#\x00C\x006\x00C\x006\x00C\x006\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `o\x00u\x00n\x00d\x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00#\x00C\x006\x00C \x006\x00C\x006\x00!\x00i\x00m\x00p\x00o\x00r\x00t \x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00S\x00t\x00a \x00c\x00k\x00K\x00e\x00y\x00w\x00o\x00r\x00d\x00 \x00a\x00{\x00c\x00o\x00l\x00o\x00r\x00:\x00b\x00l \x00a\x00c\x00k\x00!\x00`#replace_string = DB469C, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x0 0y\x00w\x00o\x00r\x00d\x00 \x00a\x00 \x00{\x00 \x00c\x00o\x00l\x00o\x00r\x00:\x00 \x00b\x00l\x00a\x00c\x00k\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00}\x0 0.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x0 0n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x0 0.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x0 0n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00`#replace _string = DB46FC, `.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x0 0n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x0 0 \x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A \x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00C \x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x00 \x00{\x00 \x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d \x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00 \x00t\x00r\x00a\x00n\x00s\x00p\x00a\x00r\x00e\x00n \x00t\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00t\x00e\x00x\x00t\x00-\x00d\x00e\x00c\x00o\x00r\x00a\x00t\x00i\x00o\x00n \x00:\x00 \x00n\x00o\x00n\x00e\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `n\x00C\x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x0 0{\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x0 0d\x00-\x00c\x00o\x00l\x00o\x00r\x00:\x00t\x00r\x00a\x00n \x00s\x00p\x00a\x00r\x00e\x00n\x00t\x00!\x00i\x00m \x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00t\x00e \x00x\x00t\x00-\x00d\x00e\x00c\x00o\x00r\x00a\x00t\x00i\x00o\x00n \x00:\x00n\x00o\x00n\x00e\x00!\x00i\x00m\x00p\x00o \x00r\x00t\x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00S \x00t\x00a\x00c\x00k\x00K\x00e\x00y\x00w\x00o\x00r \x00d\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00 \x00a\x00{\x00b\x00o\x00r\x00`#replace_string = DB4802, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x0 0y\x00w\x00o\x00r\x00d\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00 \x00a\x00 \x00{\x00 \x00b\x00o\x00r\x00d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x00 \x001\x00p\x00x\x00 \x00s\x00o\x00l\x00i\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x001\x00p\x00x \x00 \x00s\x00o\x00l\x00i\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00!\x00i\x00m\x00p\x00o \x00r\x00t\x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00A \x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t \x00a\x00t\x00i\x00o\x00n\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00,\x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r \x00`#replace_string = DB48C0, `.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x0 0n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00,\x00 \x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A \x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00C \x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00 \x00{\x00 \x00b\x00o\x00r\x00d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x00 \x002\x00p\x00x\x00 \x00d\x00o\x00t\x00t\x00e\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x0 0C\x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00{\x00b\x00o\x00r\x00d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x002\x00p\x00x \x00 \x00d\x00o\x00t\x00t\x00e\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00!\x00i\x00m\x00p\x00o \x00r\x00t\x00a\x00n\x00t\x00}\x00.\x00K\x00B\x00A \x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00,\x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a \x00t\x00i\x00o\x00n\x00C\x00o\x00n\x00t\x00i\x00n \x00u\x00e\x00d\x00[\x00w\x00`#replace_string = DB49FA, `.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x0 0i\x00o\x00n\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00,\x00 \x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t \x00i\x00o\x00n\x00C\x00o\x00n\x00t\x00i\x00n\x00u \x00e\x00d\x00[\x00w\x00r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d \x00e\x00=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n \x00t\x00a\x00l\x00-\x00t\x00b\x00"\x00]\x00 \x00{\x00 \x00b\x00o\x00r\x00d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x00 \x002\x00p\x00x\x00 \x00s\x00o\x00l\x00i\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t \x00;\x00 \x00}\x00 \x00\t\x00`, `r\x00i\x00t\x00i\x00n\x00g\x00M\x00o\x00d\x00e\x0 0=\x00"\x00h\x00o\x00r\x00i\x00z\x00o\x00n\x00t\x0 0a\x00l\x00-\x00t\x00b\x00"\x00]\x00{\x00b\x00o\x00r\x00d\x00e\x00r\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x002\x00p\x00x \x00 \x00s\x00o\x00l\x00i\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00!\x00i\x00m\x00p\x00o \x00r\x00t\x00a\x00n\x00t\x00}\x00d\x00i\x00v\x00# \x00b\x00o\x00o\x00k\x00-\x00c\x00o\x00l\x00u\x00m\x00n\x00s\x00{\x00p\x00a \x00d\x00d\x00i\x00n\x00g\x00-\x00l\x00e\x00f\x00t\x00:\x00.\x002\x00e\x00m\x00! \x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00; \x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00-\x00r\x00i\x00g\x00h\x00t\x00:\x00 \x00.\x002\x00e\x00m\x00!\x00i\x00m\x00p\x00o\x00r \x00t\x00a\x00n\x00t\x00}\x00\t\x00`## Fix typo in annotations styles: KBAuthorAnnotation --> .KBAuthorAnnotationreplace_string = DB4552, `\x20`, `.`## Choose padding size: 1 = 0.1em, 2 = 0.2em, etc.replace_string = DB4AC0, `2`, `2`replace_string = DB4AFC, `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 = DB4A82, `d\x00i\x00v\x00#\x00b\x00o\x00o\x00k\x00-\x00c\x00o\x00l\x00u\x00m\x00n\x00s\x00`, `b\x00o\x00d\x00y\x00>\x00*\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00`### **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 = DB4AB4, `l\x00e\x00f\x00t\x00:\x00`, `t\x00o\x00p\x00:\x00 \x00`#replace_string = DB4AEC, `r\x00i\x00g\x00h\x00t\x00:\x00 \x00`, `b\x00o\x00t\x00t\x00o\x00m\x00:\x00`## ... 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 spece between paragraphs.)#replace_string = DB4AB2, `-\x00l\x00e\x00f\x00t\x00:\x00`, `:\x00 \x00 \x00 \x00 \x00 \x00`#replace_string = DB4AC6, `!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x0 0;\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00-\x00r\x00i\x00g\x00h\x00t\x00:\x00`, `\x20\x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00`# </Patch>