This patch will only be useful if you use the `ePub fixed/adjustable top/bottom margins` patch and have the top margin configured to be adjustable. If that is not you, then you might want to stop reading here.
Without this patch, you need to choose an adjustment multiple when configuring the `ePub fixed/adjustable top/bottom margins` patch to suit either full-screen or normal reading mode, and it is not possible to set a value that scales very well across the whole range of the margin slider in normal mode. This problem is caused by the built-in ePub top margin that is present in normal reading mode but not in full-screen mode.
Since I have been unable to find any way to remove that troublesome built-in top margin, this patch tackes the problem from another direction: it adds an exra left/right margin to compensate for the built-in top margin when in normal reading mode, but doesn't add any extra margin in full-screen mode.
This allows you to select the adjustment multiple that suits full-screen mode (e.g. 7 on the Glo) which should lead to the same margin proportions in normal mode too.
However all of this assumes that the body left/right margin and padding in the book are zero. If the book has a non-zero body margin or padding (or doesn't set a body margin at all which results in a small default margin) then the left/right margins will be too large.
(I edit all my ePubs to have zero body left/right margin and padding, and add a small default @page margin so that the books will still look okay if I read them on a device that doesn't have adjustable margins. The book's @page margin is overridden by the `ePub fixed/adjustable top/bottommargins` patch.)
Note also that the bottom margin will depend on the size of the footer. If you enable the `Disable reading footer` patch you get an invisible footer of 5px. You can change that to match the size of the built-in top margin (e.g. 15px on Glo and GloHD) if you wish.
I should add that I have been assuming that the ePub margins set by the margins slider are in multiples of 1% of screen width, because that is true on the Glo. However it is possible that this is not the case on all devices. I've only tested this on my Glo.
I'll add some screenshots later which should help explain what this is all about. This patch turned out to be more complicated than I first expected, so I might not continue with it if the refresh bug that affects full-screen mode is fixed.
Firmware 3.18.0, paste into libnickel.so.1.0.0.patch:
Spoiler:
Code:
<Patch>
patch_name = `Increase ePub L/R margins by 2% in normal reading mode only`
patch_enable = `yes`
#
# In AdobeStyling::update
#
# setMarginSize(getReadingLeftMargin(...))
# --> if (fullScreenReading())
# setMarginSize(getReadingLeftMargin(...))
# else
# setMarginSize(2+getReadingLeftMargin(...))
#
# setPageMarginSize(ceil(0.8*getReadingFontSize(...)))
# --> setPageMarginSize(103*getReadingFontSize(...)/128)
#
replace_bytes = 45F16A, 01 46, 05 46
replace_bytes = 45F16C, 48 46, 20 46
replace_bytes = 45F16E, AD F7 CC E9, A0 F7 36 EC
replace_bytes = 45F172, 20 46, 29 46
replace_bytes = 45F174, 41 46, 00 B9
replace_bytes = 45F176, A3 F7, 02 31
replace_bytes = 45F178, B0 E8, 48 46
replace_bytes = 45F17A, 07 EE 90 0A, AD F7 C6 E9
replace_bytes = 45F17E, F8 EE, 20 46
replace_bytes = 45F180, E7 1B, 41 46
replace_bytes = 45F182, 9F ED B1 0B, A3 F7 AA E8
replace_bytes = 45F186, 21 EE, 67 21
replace_bytes = 45F188, 80 0B, 41 43
replace_bytes = 45F18A, AC F7, C9 09
replace_bytes = 45F18C, 68 EE, 00 BF
replace_bytes = 45F18E, BD EE, 00 BF
replace_bytes = 45F190, C0 0B, 00 BF
replace_bytes = 45F192, 48 46, 00 BF
replace_bytes = 45F194, 10 EE, 00 BF
replace_bytes = 45F196, 10 1A, 48 46
#
# Replacement value: size of extra margin, a percentage of screen width.
replace_int = 45F176, 2, 2
</Patch>
Edit: These screenshots are from my Glo readng a sideloaded ePub that has zero body margin and padding. They demonstrate the effects of the following patches in combination:
* `Disable reading footer` (height set to 15px)
* `Custom left & right margins` (default)
* `ePub fixed/adjustable top/bottom margins` (multiple set to 7)
* `Increase ePub L/R margins by 2% in normal reading mode only` (as above)
1. In normal reading mode (fullScreenReading=false) with the margin slider set to
0%,
3%
6%:
2. In full-screen mode (fullScreenReadng=true) with the margin slider set to
2%,
5%,
8%:
As can be seen the margins are almost identical (within a pixel or two) in both readng modes, the only real dfference being that the margins could be made two steps smaller in full-screen mode. The font is Gentium Book Basic (unhinted.)