Just a quick note to say thanks! Being able to change the line spacing, in particular, is what I was missing without knowing it. Instructions were clear and installation was very easy.
Has something changed with firmware 3.12.0 and the "custom fonts sizes" patch?
The unpatched 3.12.0 on my 6" Aura now has around 40 selectable font sizes, previous firmware versions only had 24 font sizes. I note the "custom fonts sizes" patch still only has 24 values -- is this correct or should it now have 40 values?
Has something changed with firmware 3.12.0 and the "custom fonts sizes" patch?
The unpatched 3.12.0 on my 6" Aura now has around 40 selectable font sizes, previous firmware versions only had 24 font sizes. I note the "custom fonts sizes" patch still only has 24 values -- is this correct or should it now have 40 values?
Well spotted!
And, I really don't understand the reasoning, but instead of filling the big gaps between the smaller sizes they have added 16 new super-large sizes.
Here is a new patch to customise all 40 values. Suggestions for a different distribution are welcome before I replace the patch in post #1:
Thanks GeoffR, the new font size patch loads and appears to be working as it should.
I am however having a problem with the custom footer in this new firmware, it look to me as though something else may have changed with the way pages are displayed. Most combinations of font size and line size give marks at the bottom of each page. The following page has bits missing from the top of tall characters which correspond with the marks on the previous page.
Firmware 3.11.0 and patch gave me much better looking pages.
I am however having a problem with the custom footer in this new firmware, it look to me as though something else may have changed with the way pages are displayed. Most combinations of font size and line size give marks at the bottom of each page. The following page has bits missing from the top of tall characters which correspond with the marks on the previous page.
Firmware 3.11.0 and patch gave me much better looking pages.
Is it happening with both kepubs and epubs? Only with certain fonts?
I noticed it happening with some sideloaded fonts when reading kepubs, but I haven't seen it with the normal fonts I use, or when reading epubs.
If you are using a very small footer then maybe increasing the min-height and max-height by a little bit in the Custom reading footer patch might help, but I don't have any idea what is causing it.
It's with side loaded kepubs. I mainly use the standard Kobo font "Georgia", haven't tried any side loaded fonts. I've also tried just about all possible patch settings without success.
I'll have another play with the patch settings but suspect I'll be going back to firmware 3.11.0. together with your excellent patch for that version.
It's with side loaded kepubs. I mainly use the standard Kobo font "Georgia", haven't tried any side loaded fonts. I've also tried just about all possible patch settings without success.
I haven't tested much, but for me the problems start in kepubs when the line spacing is below a certain value, depending on font. With Georgia I have no problems when the line spacing is 0.86 or higher, but problems start at 0.84 and get worse as the value goes lower. I hadn't noticed it because I usually use Georgia with a line spacing 0.88 - 0.92.
Edit: Font size doesn't seem to matter much, it looks like it's mainly related to the line spacing value.
Edit2: The problem also happens with kepubs in full-screen mode, so it probably has nothing to do with the footer patch.
In epubs there seems to be no problem no matter how small the line spacing value.
Last edited by GeoffR; 12-14-2014 at 06:18 PM.
Reason: Also happens in full-screen mode
I've added a `Set kepub hyphenation` patch to post #2.
In the original firmware, the kepub hyphenation is turned on in the built-in stylesheet only if the justification button is set to full justification. With this patch hyphenation will always (or alternatively, never) be turned on, regardless of the justification setting.
Note that if the publisher has explicitly set the hyphenation in the book's stylesheet then the patch won't override it.
I see from your kepub hyphenation patch, you have a way to modify the kepub style sheet.
I also see from another post that chopped off bits of characters can be made to display correctly if a small amount of padding is added.
Adding the two bits of information and knowing nothing about the whole thing, I wondered if it's possible to create a patch to add a small amount of padding to the top of the kepub style sheet and if this would prevent the tops of tall characters being chopped off and displayed at the bottom of the previous page.
I see from your kepub hyphenation patch, you have a way to modify the kepub style sheet.
I also see from another post that chopped off bits of characters can be made to display correctly if a small amount of padding is added.
Adding the two bits of information and knowing nothing about the whole thing, I wondered if it's possible to create a patch to add a small amount of padding to the top of the kepub style sheet and if this would prevent the tops of tall characters being chopped off and displayed at the bottom of the previous page.
It is quite easy to replace a line in the built-in stylesheets with something else, as long as the replacement is not longer than the original line. The question would be: what line in the original stylesheet could I replace?
I think this is all the built-in kepub stylesheet, but parts of it are included conditional on various device settings, and there could be other bits I don't know about.
Spoiler:
Code:
body, p { line-height: %1 !important; }
body { margin: 0px %1% 0px %2% ! important;}
body {margin-top:0px; margin-bottom:0px;}
body { margin: 0px; }
img { display: block; margin-left: auto !important; margin-right: auto !important; width: auto !important; height: auto !important; }
body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; }
html { word-wrap: break-word; }
body { -kobo-font-hintstyle: 1;}
a:link, a:visited, a:hover, a:active { border-bottom: 1px dotted black !important; color: #696969 !important; }
* { font-family: %1 !important; }
.KBHighlighting { background-color: #C6C6C6 !important; } .KBStackKeyword, .KBSearchResult, .KBAnnotation, .KBHighlighting , KBAuthorAnnotation{ font-size: 100% !important; -webkit-text-combine: inherit !important; } .KBSearchResult { background-color: #C6C6C6 !important; } .KBStackKeyword a { color: black !important; } .KBAuthorAnnotation, .KBAuthorAnnotationContinued { background-color: transparent !important; text-decoration: none !important; } .KBStackKeyword[writingMode="horizontal-tb"] a { border-bottom: 1px solid black !important; } .KBAuthorAnnotation[writingMode="horizontal-tb"], .KBAuthorAnnotationContinued[writingMode="horizontal-tb"] { border-bottom: 2px dotted black !important; } .KBAnnotation[writingMode="horizontal-tb"], .KBAnnotationContinued[writingMode="horizontal-tb"] { border-bottom: 2px solid black !important; } .KBStackKeyword[writingMode="vertical-rl"] a { border-right: 1px solid black !important; } .KBAuthorAnnotation[writingMode="vertical-rl"], .KBAuthorAnnotationContinued[writingMode="vertical-rl"] { border-right: 2px dotted black !important; } .KBAnnotation[writingMode="vertical-rl"], .KBAnnotationContinued[writingMode="vertical-rl"] { border-right: 2px solid black !important; } .KBStackKeyword[writingMode="vertical-lr"] a { border-left: 1px solid black !important; } .KBAuthorAnnotation[writingMode="vertical-lr"], .KBAuthorAnnotationContinued[writingMode="vertical-lr"] { border-left: 2px dotted black !important; } .KBAnnotation[writingMode="vertical-lr"], .KBAnnotationContinued[writingMode="vertical-lr"] { border-left: 2px solid black !important; }
::selection { background: #FFFFFF !important; }
* { -webkit-hyphens: auto; }
* { -webkit-locale: '%1'; }
rt { font-family: 'A-OTF Gothic MB101 Pr6N' !important; }
body { width:100% !important; height: 100% !important; }
div, p { text-align: %1 !important; }
One of those lines is very long and has a lot of spaces, so it might be possible to remove some of the spaces and make room for some extra stuff.
Last edited by GeoffR; 12-15-2014 at 08:07 AM.
Reason: added stylesheet
Here are patchs to fix the bug that affects kepubs in full-screen mode where characters with large side bearing (e.g. f) are cut off if they appear at the end of a line.
Thanks to Anak for explaining how to fix this problem, see this post.
The patches work a little differently for sideloaded kepubs than for synced kepubs. There are likely to be side effects on the layout of sideloaded kepubs that don't occur with synced kepubs. Don't use the third patch unless you have sideloaded books in both horizontal and vertical languages.
For synced kepubs only (should work well with both horizontal and vertical language books):
Spoiler:
Code:
<Patch>
patch_name = `Fix kepub side bearing font cut-off bug (synced kepubs only)`
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-inner{padding:0 0.1em } (left/right only)
# div#book-inner{padding: 0.1em } (all sides)
# div#book-inner{padding: 0.1em 0} (top/bottom only)
#
# Note: This patch only fixes the problem for synced kepubs, it has no effect
# on sideloaded kepubs. Depending on the font used, the amount of padding might
# need to be increased, see below for options.
#
replace_string = DB4470, `.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\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\x00h\x00t\x00i\x00n\x00g\x00{\x00b\x00a\x00c\x00k\x00g\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}\x00.\x00K\x00B\x00S\x00t\x00a\x00c\x00`
#
replace_string = DB44E6, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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\x00K\x00e\x00y\x00w\x00o\x00r\x00d\x00,\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00,\x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\x00t\x00i\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}\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00{\x00b\x00a\x00c\x00k\x00`
#
replace_string = DB4626, `.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\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`, `g\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}\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\x00`
#
replace_string = DB469C, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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`, `c\x00k\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00}\x00d\x00i\x00v\x00#\x00b\x00o\x00o\x00k\x00-\x00i\x00n\x00n\x00e\x00r\x00{\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00:\x00 \x00 \x000\x00.\x001\x00e\x00m\x00 \x00 \x00}\x00\t\x00`
#
#
# Fix typo in annotations styles: KBAuthorAnnotation --> .KBAuthorAnnotation
replace_string = DB4554, `\x20`, `.`
#
# Replacement value: padding size, 2 = 0.2em (or 2% with percentage option)
replace_string = DB46EE, `1`, `2`
#
# Percentage option: Uncomment to set padding as a percentage of screen width:
#replace_string = DB46EA, `0\x00.`, `\x20\x00\x20`
#replace_string = DB46F0, `e\x00m`, `%\x00\x20`
#
# Uncomment for left/right padding only (suits horizontal text directions only)
#replace_string = DB46E6, `\x20`, `0`
#
# Uncomment for top/bottom padding only (suits vertical text directions only)
#replace_string = DB46F6, `\x20`, `0`
#
# Leave both of the above commented out for padding on all four sides
# (okay for both horizontal and vertical text directions)
#
</Patch>
For all kepubs (may have some side effects on layout of sideloaded kepubs; okay for either horizontal or vertical language books, but not both):
Spoiler:
Code:
<Patch>
patch_name = `Fix kepub side bearing font cut-off bug (all kepubs)`
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:
#
# body>*{padding-left:0.1em!important;padding-right: 0.1em!important}
# body>*{padding-top: 0.1em!important;padding-bottom:0.1em!important}
#
# Note: Unlike synced kepubs, the layout of sideloaded kepubs may be affected
# more than just by slightly larger page margins. Depending on the font used,
# the amount of padding might need to be increased, see below for options.
#
replace_string = DB4470, `.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\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\x00h\x00t\x00i\x00n\x00g\x00{\x00b\x00a\x00c\x00k\x00g\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}\x00.\x00K\x00B\x00S\x00t\x00a\x00c\x00`
#
replace_string = DB44E6, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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\x00K\x00e\x00y\x00w\x00o\x00r\x00d\x00,\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00,\x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\x00t\x00i\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}\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00{\x00b\x00a\x00c\x00k\x00`
#
replace_string = DB4626, `.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\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`, `g\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}\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\x00`
#
replace_string = DB469C, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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`, `c\x00k\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00}\x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00`
#
replace_string = DB46FC, `.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\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 \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`, `a\x00t\x00i\x00o\x00n\x00C\x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x00{\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\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}\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 \x00`
#
replace_string = DB4802, `.\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 \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`, `a\x00{\x00b\x00o\x00r\x00d\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}\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\x00`
#
replace_string = DB48C0, `.\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 \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`, `B\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{\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}\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\x00`
#
replace_string = DB49FA, `.\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 \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`, `t\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 \x00s\x00o\x00l\x00i\x00d\x00 \x00b\x00l\x00a\x00c\x00k\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00}\x00 \x00b\x00o\x00d\x00y\x00>\x00*\x00{\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00-\x00l\x00e\x00f\x00t\x00:\x000\x00.\x001\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 \x000\x00.\x001\x00e\x00m\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00}\x00`
#
#
# Fix typo in annotations styles: KBAuthorAnnotation --> .KBAuthorAnnotation
replace_string = DB4554, `\x20`, `.`
#
# Replacement values: padding size, 2 = 0.2em (or 2% for percentage option)
replace_string = DB4AC0, `1`, `2`
replace_string = DB4AFE, `1`, `2`
#
# Percentage option: Uncomment to set padding as a percentage of screen width:
#replace_string = DB4ABC, `0\x00.`, `\x20\x00\x20`
#replace_string = DB4AC2, `e\x00m`, `%\x00\x20`
#replace_string = DB4AFA, `0\x00.`, `\x20\x00\x20`
#replace_string = DB4B00, `e\x00m`, `%\x00\x20`
#
# Default is left/right padding only (suits horizontal text directions only)
#
# Uncomment for top/bottom padding only (suits vertical text directions only)
#replace_string = DB4AB2, `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`
</Patch>
For all kepubs (will have some side effects on layout of sideloaded kepubs, such as increased space between paragraphs; okay for both horizontal and vertical language books):
Spoiler:
Code:
<Patch>
patch_name = `Fix kepub side bearing font cut-off bug (all kepubs, padding all sides)`
patch_enable = `yes`
#
# This patch adds the following line to the built-in kepub stylesheet:
#
# body>*{padding:0.1em 0.1em 0.1em 0.1em!important}
#
# Note: This patch will cause changes to the layout of most sideloaded kepubs,
# such as adding exra space between paragraphs. This is because sideloaded
# kepubs usually lack a <div> wrapper (a <body><div>...</div></body> structure.)
# With Kobo-created kepubs the padding will be applied to this <div> wrapper,
# but with sideloaded kepubs it will be applied to each individual element
# immediately below <body>.
#
replace_string = DB4470, `.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\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\x00h\x00t\x00i\x00n\x00g\x00{\x00b\x00a\x00c\x00k\x00g\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}\x00.\x00K\x00B\x00S\x00t\x00a\x00c\x00`
#
replace_string = DB44E6, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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\x00K\x00e\x00y\x00w\x00o\x00r\x00d\x00,\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00,\x00.\x00K\x00B\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x00B\x00H\x00i\x00g\x00h\x00l\x00i\x00g\x00h\x00t\x00i\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}\x00.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\x00s\x00u\x00l\x00t\x00{\x00b\x00a\x00c\x00k\x00`
#
replace_string = DB4626, `.\x00K\x00B\x00S\x00e\x00a\x00r\x00c\x00h\x00R\x00e\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`, `g\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}\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\x00`
#
replace_string = DB469C, `.\x00K\x00B\x00S\x00t\x00a\x00c\x00k\x00K\x00e\x00y\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`, `c\x00k\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00}\x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\x00,\x00.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00`
#
replace_string = DB46FC, `.\x00K\x00B\x00A\x00u\x00t\x00h\x00o\x00r\x00A\x00n\x00n\x00o\x00t\x00a\x00t\x00i\x00o\x00n\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 \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`, `a\x00t\x00i\x00o\x00n\x00C\x00o\x00n\x00t\x00i\x00n\x00u\x00e\x00d\x00{\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\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}\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 \x00`
#
replace_string = DB4802, `.\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 \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`, `a\x00{\x00b\x00o\x00r\x00d\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}\x00 \x00b\x00o\x00d\x00y\x00>\x00*\x00{\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00:\x000\x00.\x001\x00e\x00m\x00 \x000\x00.\x001\x00e\x00m\x00 \x000\x00.\x001\x00e\x00m\x00 \x000\x00.\x001\x00e\x00m\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00}\x00 \x00 \x00`
#
#
# Fix typo in annotations styles: KBAuthorAnnotation --> .KBAuthorAnnotation
replace_string = DB4554, `\x20`, `.`
#
# Replacement values: padding size, 2 = 0.2em (or 2% with percentage option)
# Order: top, right, bottom, left.
replace_string = DB487C, `1`, `2`
replace_string = DB4888, `1`, `2`
replace_string = DB4894, `1`, `2`
replace_string = DB48A0, `1`, `2`
#
# Percentage option: Uncomment to set padding as a percentage of screen width:
#replace_string = DB4878, `0\x00.`, `\x20\x00\x20`
#replace_string = DB487E, `e\x00m`, `%\x00\x20`
#replace_string = DB4884, `0\x00.`, `\x20\x00\x20`
#replace_string = DB488A, `e\x00m`, `%\x00\x20`
#replace_string = DB4890, `0\x00.`, `\x20\x00\x20`
#replace_string = DB4896, `e\x00m`, `%\x00\x20`
#replace_string = DB489C, `0\x00.`, `\x20\x00\x20`
#replace_string = DB48A2, `e\x00m`, `%\x00\x20`
#
</Patch>
(To apply the patches with kpg.exe, change replace_string to replace_xor_00)
Last edited by GeoffR; 12-19-2014 at 01:49 PM.
Reason: Updated all patches to use 0.2em padding bydefault, updated `all kepubs` patches to use body>* selector, thanks jellby
Tried both patches, they run and installs ok but I still have the very tips of f's, at the end of a line, cut off.
That's with kepubs created with Calibre's "KoboTouchExtended" driver.
Note:
This issue is so slight on my reader that I hadn't noticed it before. It's nowhere near as pronounced as the top and bottom of page issue I'm seeing both with full-screen mode and with the custom footer patch -- as reported above.
Tried both patches, they run and installs ok but I still have the very tips of f's, at the end of a line, cut off.
That's with kepubs created with Calibre's "KoboTouchExtended" driver.
Thanks. It looks like this patch will only work with Kobo-bought kepubs then, unless Calibre can be made to add whatever is missing in the kepubs it creates.
Quote:
Note:
This issue is so slight on my reader that I hadn't noticed it before. It's nowhere near as pronounced as the top and bottom of page issue I'm seeing both with full-screen mode and with the custom footer patch -- as reported above.
If the issue happens in full-screen mode too then it seems unlikely to be related to the footer patch. Have you tried without the footer patch?
Tried both patches, they run and installs ok but I still have the very tips of f's, at the end of a line, cut off.
Which font(s) still has (have) cut off issues? Embedded fonts or side loaded?
Does this happen with all fonts or with just a few? My guess is that it only happens with some fonts. Those fonts have very likely a Negative Right Side Bearing that is larger than the soft margin.
Especially italic sub family fonts tend to have larger N(R)SB and regular or bold fonts seems to be "fixed", but (bold)italic sub family fonts might still have the cut off issue.
I noticed that the soft margin is set to 1%. This might be too small to fix the cut off problem for all fonts.
Maybe you should try to increase the soft margin to 1.5-2%, that might solve it. This is just trial and error.
1% of the screen width (on both sides):
Touch: 1% × 600 = 6px
Glo/Aura: 1% × 758 = 8px
HD models: 1% × 1080 = 11px
IMO, a very small "safety" margin.