Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2015, 06:43 PM   #106
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
If you want the top margin 25px and bottom margin zero, just enable the patch and don't change anything else, the example already sets the margin to 25px.

But in general:

1. Select one of the alternatives by uncommenting one and commenting out the other, but don't edit these lines otherwise.

2. Set the margin size by changing the replacement value in the last line of the patch. The margin size you set in the last line applies to both alternatives. The example changes the initial value from 10px to 25px.

Last edited by GeoffR; 01-06-2015 at 06:45 PM. Reason: spelling
GeoffR is offline   Reply With Quote
Old 01-06-2015, 08:42 PM   #107
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,310
Karma: 136006010
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by GeoffR View Post
Set the margin size by changing the very last line of the patch. The example changes it from 10px to 25px:
Code:
# Replacement value: a 2-digit number (margin size in pixels) seperated by \x00
# E.g. 25 = 2\x005, 30 = 3\x000, etc.
replace_string = C99BAC, `1\x000`, `2\x005`
If you wanted it bigger, say 40px, then change the last line to:
Code:
replace_string = C99BAC, `1\x000`, `4\x000`
Is the default top margin really 1\x000? If so, that would explain the small blank space at the top of the screen. So if we JUST do
Code:
replace_string = C99BAC, `1\x000`, `0\x000`
would that work?
JSWolf is offline   Reply With Quote
Advert
Old 01-06-2015, 08:49 PM   #108
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
Quote:
Originally Posted by JSWolf View Post
Is the default top margin really 1\x000? If so, that would explain the small blank space at the top of the screen. So if we JUST do
Code:
replace_string = C99BAC, `1\x000`, `0\x000`
would that work?
There is no default top @page margin in the unpatched firmware. The small top margin you see with epubs in normal reading mode (I see 15px on my Glo) doesn't seem to be set via the stylesheet, I think it is either a spacing widget, or a reduction in the viewport. Any @page margin size is in addition to that built-in margin.
GeoffR is offline   Reply With Quote
Old 01-06-2015, 08:59 PM   #109
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
Improved `ePub fixed/adjustable top/bottom margins` patch.

I have a new patch that replaces both the `ePub adjustable top/bottom margin` and `ePub fixed top/bottom margin` patches.

With this patch you can choose the top and bottom @page margin behaviour independently. E.g. you can choose an adjustable top margin with a fixed bottom margin of custom size, or both margins adjustable, or both margins of different fixed sizes, etc.

Spoiler:
Code:
<Patch>
patch_name = `ePub fixed/adjustable top/bottom margins`
patch_enable = `yes`
#
# If enabled, this patch sets the @page margin sizes in epubs, overriding any
# @page margin set in the book's stylesheet.
#
# By default the top and bottom margins are set to be adjustable, their size
# similar to the left/right margin size set by the adjustment slider. There
# are options to set the top and/or bottom margin to a fixed size instead.
#
# Note that this patch has the side-effect of removing the body bottom padding
# from the built-in stylesheet, which means that there will no longer be a line
# of padding added automatically at the end of chapters.
#
# getReadingLineHeight(...) --> getReadingLeftMargin(...)
replace_bytes = 51EBC0, 4A F7 EC E8, 2C F7 F4 ED
# QString.arg(double, ...) --> QString.arg(int64, ...)
replace_bytes = 51EBC4, 20 22 4F F0 FF 33, 20 21 01 22 0A 23
replace_bytes = 51EBCE, AD F8 04 20 00 93, 02 91 42 43 01 93
replace_bytes = 51EBD8, 00 22 67 23 37 F7 EA EC, 00 23 00 93 2C F7 94 E9
#      padding-bottom: %1em !important;\n
# --> }@page{margin:%1px 0 %1px 0}\nbody{
replace_string = C99B8C, `\x20\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x00 \x00%\x001\x00e\x00m\x00 \x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00\n\x00`, `}\x00@\x00p\x00a\x00g\x00e\x00{\x00m\x00a\x00r\x00g\x00i\x00n\x00:\x00%\x001\x00p\x00x\x00 \x000\x00 \x00%\x001\x00p\x00x\x00 \x000\x00}\x00\n\x00b\x00o\x00d\x00y\x00{\x00`
#
# Optional replacement value: Uncomment for a fixed top margin size in px,
# default 25px. Replacement value is margin size, two digits separated by \x00
# (Leave commented out for an adjustable top margin.)
#replace_string = C99BA8, `%\x001`, `2\x005`
#
# Optional replacement value: Uncomment for a fixed bottom margin size in px,
# default 00px. Replacement value is margin size, two digits separated by \x00
# (Leave commented out for an adjustable bottom margin.)
#replace_string = C99BB6, `%\x001`, `0\x000`
#
# Replacement value: Sets the value of the adjustable top/bottom margin (if any)
# to a multiple of readingLeftMargin, in pixels. Suggested values are:
# Normal reading mode: 5px (Touch/Mini), 6px (Glo/Aura), 8px (AuraHD/H2O)
# Full-screen reading mode: 6px (Touch/Mini), 7px (Glo/Aura), 10px (AuraHD/H2O)
replace_int = 51EBC6, 1, 6
</Patch>

Last edited by GeoffR; 01-06-2015 at 09:09 PM. Reason: spelling
GeoffR is offline   Reply With Quote
Old 01-07-2015, 10:44 AM   #110
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 794
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quote:
Originally Posted by GeoffR View Post
I have a new patch that replaces both the `ePub adjustable top/bottom margin` and `ePub fixed top/bottom margin` patches.

With this patch you can choose the top and bottom @page margin behaviour independently. E.g. you can choose an adjustable top margin with a fixed bottom margin of custom size, or both margins adjustable, or both margins of different fixed sizes, etc.
Geoff, you are a treasure. Thank you so much for these patches; I really appreciate them. I wish Kobo would get with the program and incorporate the same flexibility into their stock firmware. But, since they either won't or can't, your patches make my ebook reading much more pleasurable. Thanks.
icallaci is offline   Reply With Quote
Advert
Old 01-08-2015, 07:14 PM   #111
JoshR
Junior Member
JoshR began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Sep 2014
Device: Kobo Aura HD
Quote:
Originally Posted by icallaci View Post
Geoff, you are a treasure. Thank you so much for these patches; I really appreciate them. I wish Kobo would get with the program and incorporate the same flexibility into their stock firmware. But, since they either won't or can't, your patches make my ebook reading much more pleasurable. Thanks.
+1

Thanks for all you do for us.
JoshR is offline   Reply With Quote
Old 01-09-2015, 10:23 AM   #112
VirtualRider
Junior Member
VirtualRider began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2015
Device: Kobo H20
Hi,

I'd also like to thank you for your work! This patcher makes my KoboH2O experience way more joyful.

I may have overlooked it, but is there a patch/setting to disable the header on (sideloaded) kepubs and to keep the footer displayed? I like to have the number of pages to the next chapter shown to me, which does not seem to be possible with the epub-engine.

King regards,
VR
VirtualRider is offline   Reply With Quote
Old 01-09-2015, 09:09 PM   #113
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
Quote:
Originally Posted by VirtualRider View Post
Hi,

I'd also like to thank you for your work! This patcher makes my KoboH2O experience way more joyful.

I may have overlooked it, but is there a patch/setting to disable the header on (sideloaded) kepubs and to keep the footer displayed? I like to have the number of pages to the next chapter shown to me, which does not seem to be possible with the epub-engine.

King regards,
VR
There is no patch to remove the kepub header.

There used to be a ShowPageHeader feature setting that could be added to the device's .conf file, but it doesn't work with the current firmware, and anyway it only removed the title, the big gap at the top of the page remained.

I could probably make a patch to do something similar, i.e. one that just makes the title invisible without changing the size of the header, but I guess that is not what you want.
GeoffR is offline   Reply With Quote
Old 01-09-2015, 09:21 PM   #114
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
From the discussion in this thread it appears that the `Fix kepub side bearing font cut-off bug (synced kepubs only)` patch won't work with some synced kepubs.

The kepubs affected are those synced kepubs which don't have an epub2 download option (i.e. ones where the publisher has supplied Kobo with an epub3 instead of an epub2). Using the `Fix kepub side bearing font cut-off bug (all kepubs)` version of the patch instead will work, but there might be some side effects on the layout of some of those kepubs.
GeoffR is offline   Reply With Quote
Old 01-10-2015, 02:57 AM   #115
howyoudoin
how YOU doin?
howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.
 
howyoudoin's Avatar
 
Posts: 1,100
Karma: 7371047
Join Date: Feb 2009
Location: India
Device: Kindle Keyboard, iPad Pro 10.5”, Kobo Aura H2O, Kobo Libra 2
Quote:
Originally Posted by GeoffR View Post
There is no patch to remove the kepub header.

There used to be a ShowPageHeader feature setting that could be added to the device's .conf file, but it doesn't work with the current firmware, and anyway it only removed the title, the big gap at the top of the page remained.

I could probably make a patch to do something similar, i.e. one that just makes the title invisible without changing the size of the header, but I guess that is not what you want.
On my H2O, the showpageheader setting gets rid of the header and gives me one extra line of text, I've noted. There's still the blank space at the top, but not as large as with the header on.
howyoudoin is offline   Reply With Quote
Old 01-10-2015, 03:02 AM   #116
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
Quote:
Originally Posted by howyoudoin View Post
On my H2O, the showpageheader setting gets rid of the header and gives me one extra line of text, I've noted. There's still the blank space at the top, but not as large as with the header on.
Is this with firmware 3.12.0? When I tried it on my Glo but it didn't have any effect.
GeoffR is offline   Reply With Quote
Old 01-10-2015, 06:17 AM   #117
howyoudoin
how YOU doin?
howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.
 
howyoudoin's Avatar
 
Posts: 1,100
Karma: 7371047
Join Date: Feb 2009
Location: India
Device: Kindle Keyboard, iPad Pro 10.5”, Kobo Aura H2O, Kobo Libra 2
Quote:
Originally Posted by GeoffR View Post
Is this with firmware 3.12.0? When I tried it on my Glo but it didn't have any effect.
Yeah. H2O with 3.12.0
howyoudoin is offline   Reply With Quote
Old 01-10-2015, 06:36 AM   #118
VirtualRider
Junior Member
VirtualRider began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2015
Device: Kobo H20
Quote:
Originally Posted by GeoffR View Post
There used to be a ShowPageHeader feature setting that could be added to the device's .conf file, but it doesn't work with the current firmware, and anyway it only removed the title, the big gap at the top of the page remained.

I could probably make a patch to do something similar, i.e. one that just makes the title invisible without changing the size of the header, but I guess that is not what you want.
I've just tried to add 'showPageHeader="false"' into the Reading section of the kobo config. After a full page refresh, the header was invisible, but with spacing (H20 at 3.12.0). Maybe there is a way via a negative @page top-margin to get rid of the space? Would it be possible to add such a margin to kepub's only?

I am primarily interested to get the number of pages to the next chapter in some quick way, which is displayed in the menu on kepubs, so the full screen reading mode on kepubs would be perfectly fine for me.

However, I'm currently dealing with 'sliced' text at the bottom and top of my pages, which is why I'm settling with regular epubs for now. Some pixel of the last line of a page are being displayed, the rest of the line is being cut and displayed on the top of the next page. I will try to add more padding with the `Fix kepub side bearing font cut-off bug (all kepubs, padding all sides)` and see if this fixes the problem, when I find the time.

Kind regards,
VR
VirtualRider is offline   Reply With Quote
Old 01-10-2015, 06:40 AM   #119
howyoudoin
how YOU doin?
howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.howyoudoin ought to be getting tired of karma fortunes by now.
 
howyoudoin's Avatar
 
Posts: 1,100
Karma: 7371047
Join Date: Feb 2009
Location: India
Device: Kindle Keyboard, iPad Pro 10.5”, Kobo Aura H2O, Kobo Libra 2
Quote:
Originally Posted by VirtualRider View Post
......However, I'm currently dealing with 'sliced' text at the bottom and top of my pages....... Some pixel of the last line of a page are being displayed, the rest of the line is being cut and displayed on the top of the next page......
I had that when I enabled the setting to disable header. When I closed the current book and opened up another one, the sliced text disappeared and hasn't been back since then.
howyoudoin is offline   Reply With Quote
Old 01-10-2015, 09:01 AM   #120
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@VirtualRider: If we're talking about the same thing (cf. here & there), it appears to be related to low line-heights .

That shouldn't deter you from checking if more top/bottom padding helps, though
NiLuJe is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Instructions for patching firmware 3.11.0 GeoffR Kobo Developer's Corner 226 06-01-2015 05:32 AM
Instructions for patching firmware 3.2.0 DNSB Kobo Developer's Corner 66 12-05-2014 07:28 AM
Instructions for patching firmware 3.8.0 GeoffR Kobo Developer's Corner 92 10-22-2014 07:22 AM
Instructions for patching firmware 3.3.x, 3.4.x, 3.5.x GeoffR Kobo Developer's Corner 285 08-27-2014 10:06 AM
Instructions for patching firmware 3.1.1 GeoffR Kobo Developer's Corner 64 04-18-2014 01:23 PM


All times are GMT -4. The time now is 07:59 PM.


MobileRead.com is a privately owned, operated and funded community.