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 08-28-2014, 04:53 AM   #1
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
Instructions for patching firmware 3.8.0

Before starting:

1. Make sure your Kobo ereader is already running firmware version 3.8.0 (048bb0b071).

2. Check that your battery is well charged.


Patching from Windows, Linux (i386/x86_64), or Mac (OS X 10.8-10.9, i386/x86_64):

1. Download and extract patch_kobo_38.zip attached.

2. Download the Kobo firmware archive version 3.8.0 for your device (See this thread) into the 3.8.0_source subdirectory. (Don't extract.)

3. Read and edit all the *.patch files in the 3.8.0_source subdirectory in order to: choose which patches to enable (patch_enable=`yes`) or disable (patch_enable=`no`); and to change some of the replacement values to suit your device and preferences. (See the section below on customising the patches.)

4. In Windows double-click 3.8.0.bat; For Linux/mac run ./3.8.0.sh from the command line.

5. If there were no errors, copy the resulting KoboRoot.tgz from the 3.8.0_target subdirectory to the .kobo directory on your ereader.

6. Safely eject and unplug the device, which will then update and restart.


To return your ereader to its original unpatched state:

1. Edit all the 3.8.0_source/*.patch files to disable all patches (set patch_enable = `no` for every patch).

2. Repeat steps 4-6 of the procedure above.


Customising the patches to suit your preferences and device

Some patches require no customisation, you can choose simply to enable them or not. But the following patches allow more customisation and their initial values should be considered examples only.

1. Custom reading footer style: There are three example styles, comment out the styles you don't want by adding a "#" character at the beginning of the line beginning with replace_, and leave the style you want uncommented.

More complex customisation is possible by editing the replacement css text, see the Kobo Patcher thread for examples.

2. My 15 line spacing values: Change the lines of the enabled patch starting with replace_float: the middle number is the original spacing value, the number to change is on the right.

The values are the line spacings set by the adjustment slider. The actual spacing depends on the font used, but for most fonts a value of 0.7 gives very tight spacing with ascenders/descenders overlapping, a value of about 0.9 gives a spacing similar to that of a mass-market paperback. The smallest value available in the unpatched firmware is 1.0.

3. Custom font sizes: Change the lines starting with replace_int. The middle number is the original value, the number to change is on the right.

The values are the font sizes set by the adjustment slider, they are in pixels so the absolute size depends on the device: size 20 on the Glo is about the same as size 25 on the AuraHD. Some books change the base font size, so you may need font sizes that are larger or smaller than your normal reading size to allow for adjusting such books.

4. Custom left & right margins: Change the lines starting with replace_int. The middle number is the original value, the number to change is on the right.

The values are the margin widths (in units of about 1% screen width I think) set by the adjustment slider. The margin size is added to whatever margin is fixed in the book (if any) and in reading software (The kepub reader has a base margin of about 2 units, the epub reader has a base margin of zero).

5. Brightness fine control: Change the lines starting with replace_int. The middle number is the original value, the number to change is on the right.

The values are the percentage amounts that the brightness slider changes when the small or large sun symbols are tapped. (Both should probably be set to the same value).

6. ePub adjustable top/bottom margin (disabled by default): Comment out one of the replace_string lines (i.e. add a '#' character to the beginning of the line) and leave the other uncommented to select whether both top and bottom, or just the top margin, should be made adjustable. Change the right-most number of the replace_int line to set the size of the top/bottom margins relative to the left/right margins, depending on your device. (The suggested values should make the top/bottom margins roughly equal to the left/right margins).
Attached Files
File Type: zip patch_kobo_38.zip (464.1 KB, 1713 views)

Last edited by GeoffR; 08-30-2014 at 12:14 AM. Reason: Updated patch_kobo_38.zip with separate custom header style patches for Touch and Mini
GeoffR is offline   Reply With Quote
Old 08-28-2014, 05:01 AM   #2
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
Notes and other patches

Notes:

The following patches are no longer needed because of fixes in the firmware:
- Disable pinch-to-zoom font resizing
- Synopsis font size fix

There are now three seperate `Custom header style` patches for Touch, Mini, and other devices. With only a Glo to test on, the other patches are a bit of a guess. Let me know if they don't work. (Note that the size of the header can't be changed, only the style of the font used for the header text.)


Other patches:

If you know of any other patches for firmware 3.8.0, post in this thread and I'll include them in this post.

ePub fixed top margin: (libnickel.so.1.0.0)
Spoiler:
Code:
<Patch>
patch_name = `ePub fixed top margin`
patch_enable = `no`
#
# If enabled, this patch sets the top page margin for ePubs to a fixed value
# by adding a line like @page{margin:10px 0 0 0} to the built-in stylesheet.
# Note that it has the side-effect of overriding any existing @page margins
# set in the book's stylesheet and removing the pre-existing padding-bottom
# from the built-in stylesheet's body rule.
#
# Modify stylesheet, set top margin: @page {margin:10px 0 0 0}
replace_string = BBF850, `\x20\x00p\x00a\x00d\x00d\x00i\x00n\x00g\x00-\x00b\x00o\x00t\x00t\x00o\x00m\x00:\x00\x20\x00%\x001\x00e\x00m\x00\x20\x00!\x00i\x00m\x00p\x00o\x00r\x00t\x00a\x00n\x00t\x00;\x00\n\x00`, `}\x00\n\x00@\x00p\x00a\x00g\x00e\x00\x20\x00{\x00m\x00a\x00r\x00g\x00i\x00n\x00:\x001\x000\x00p\x00x\x00\x20\x000\x00\x20\x000\x00\x20\x000\x00}\x00\n\x00b\x00o\x00d\x00y\x00\x20\x00{\x00`
#
# Replacement value: a 2-digit number (margin size in pixels) seperated by \x00
# E.g. 25 = 2\x005
replace_string = BBF870, `1\x000`, `2\x005`
</Patch>


Attached are the main patches from post #1 for use with kpg.exe.
Attached Files
File Type: zip kpg_conf_380.zip (4.9 KB, 889 views)

Last edited by GeoffR; 10-15-2014 at 03:17 PM. Reason: Added epub fixed top margin patch
GeoffR is offline   Reply With Quote
Advert
Old 08-28-2014, 05:11 AM   #3
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
Thanks much for the update, this was one of the first things I was looking for after updating to 3.8.0!
Ripplinger is offline   Reply With Quote
Old 08-28-2014, 11:02 AM   #4
kwiatek
Junior Member
kwiatek began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Device: Kindle Keyboard, Kindle Dxg, Kobo Mini
Maybe I'm doing something wrong but I can't get Custom header style patch working on my Mini. On the other hand Custom footer works like a charm.
kwiatek is offline   Reply With Quote
Old 08-28-2014, 06:43 PM   #5
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 kwiatek View Post
Maybe I'm doing something wrong but I can't get Custom header style patch working on my Mini. On the other hand Custom footer works like a charm.
It looks like the Mini (and I guess the Touch too) use a different header. Could you try this patch instead of the one in post #1 and see if it works on your Mini?

Spoiler:
Code:
<Patch>
# libnickel.so.1.0.0 in firmware 3.8.0 (048bb0b071)

patch_name = `Custom header style for Touch/Mini`
patch_enable = `yes`
replace_string = D36448, `* {\nfont-size: 16px;\nfont-family: Avenir;\nbackground-color: transparent;\npadding-top:3px;\n}\n\n[qApp_localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\nqproperty-leading: 0;\n}`, `* {\nfont-size: 16px;\nfont-family:  Avenir;\nbackground-color: transparent;\npadding-top:3px;\n}`
#
# BE CAREFUL NOT TO ALTER THE LENGTH OF THE FOLLOWING REPLACEMENT STRINGS!
# (Add or remove spaces if necessary to keep the total length the same.)
#
replace_string = D3644C, `font-size: 16px;`, `font-size: 16px;`
#
#replace_string = D3645D, `font-family:  Avenir;`, `font-family:  Amasis;`
replace_string = D3645D, `font-family:  Avenir;`, `font-family:  Avenir;`
#replace_string = D3645D, `font-family:  Avenir;`, `font-family: Georgia;`
#
</Patch>
GeoffR is offline   Reply With Quote
Advert
Old 08-28-2014, 07:56 PM   #6
kwiatek
Junior Member
kwiatek began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Device: Kindle Keyboard, Kindle Dxg, Kobo Mini
Thanks for Your help but unfortunately nothing has changed.
kwiatek is offline   Reply With Quote
Old 08-28-2014, 11:42 PM   #7
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 kwiatek View Post
Thanks for Your help but unfortunately nothing has changed.
What changes did you try to make to the header? The default is to do nothing, you need to select a different font style to see any change.

The patch won't change the size of the header itself, it can only change the font style used for the header text.
GeoffR is offline   Reply With Quote
Old 08-29-2014, 07:06 AM   #8
kwiatek
Junior Member
kwiatek began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Device: Kindle Keyboard, Kindle Dxg, Kobo Mini
Quote:
Originally Posted by GeoffR View Post
The patch won't change the size of the header itself, it can only change the font style used for the header text.
Yeah, I know it. I changed the font in the footer to Georgia because the default one had some problems with Polish diacritic signs and all I want to do with the header is to choose the corresponding font. Right now nothing has changed with it - or maybe there is something wrong with my eyes. It's not the most important patch so once again thanks for your help and don't bother.
kwiatek is offline   Reply With Quote
Old 08-29-2014, 07:56 AM   #9
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 have one more guess at a header patch for Touch/Mini if you want to try it:
Spoiler:
Code:
<Patch>
# libnickel.so.1.0.0 in firmware 3.8.0 (048bb0b071)
#
patch_name = `Custom header style for Touch/Mini`
patch_enable = `yes`
replace_string = D36F2C, `* {\nfont-size: 20px;\nfont-family: Avenir;\nbackground-color: transparent;\npadding-top:3px;\n}\n\n[qApp_deviceCodeName="pixie"] {\nfont-size: 18px;\n}\n\n[qApp_deviceCodeName="dragon"] {\nfont-family: Georgia;\nfont-size: 26px;\n}\n\n[qApp_localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\n}`, `* {\nfont-size: 20px;\nfont-family:  Avenir;\nbackground-color: transparent;\npadding-top:3px;\n}` 
#
# BE CAREFUL NOT TO ALTER THE LENGTH OF THE FOLLOWING REPLACEMENT STRINGS!
# (Add or remove spaces if necessary to keep the total length the same.)
#
# Touch font size:
#replace_string = D36F30, `font-size: 20px;`, `font-size: 20px;`
#
# Mini font size:
replace_string = D36F30, `font-size: 20px;`, `font-size: 18px;`
#
# Touch/Mini font family:
#replace_string = D36F41, `font-family:  Avenir;`, `font-family:  Amasis;`
replace_string = D36F41, `font-family:  Avenir;`, `font-family:  Avenir;`
#replace_string = D36F41, `font-family:  Avenir;`, `font-family: Georgia;`
#
</Patch>

Last edited by GeoffR; 08-29-2014 at 08:07 AM. Reason: Mini font size: 18px;
GeoffR is offline   Reply With Quote
Old 08-29-2014, 10:28 AM   #10
kwiatek
Junior Member
kwiatek began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Device: Kindle Keyboard, Kindle Dxg, Kobo Mini
Everything seems to work right know. Thanks a lot for Your time!
kwiatek is offline   Reply With Quote
Old 08-29-2014, 02:37 PM   #11
indyglow
Connoisseur
indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.indyglow is the One.
 
Posts: 77
Karma: 101837
Join Date: Oct 2012
Device: iPad Air, Kobo Forma, Kobo Aura HD (RIP)
Many thanks to you Geoff for quickly making available these patches, much appreciated.
indyglow is offline   Reply With Quote
Old 08-29-2014, 03:09 PM   #12
Anak
Fanatic
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 599
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Yes, many thanks for making the patches available so quickly after a firmware release. I can't live without it.
Anak is offline   Reply With Quote
Old 08-29-2014, 07:47 PM   #13
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 updated the files in post #1/#2 to include separate `Custom header style` patches for Touch, Mini, and other devices. I only have a Glo to test on, so if you try these patches then let me know if they work on other devices.

(The `Custom header style` patches are really only needed if you change the font-size or font-family in the `Custom reading footer` patch and want the kepub header to match.)
GeoffR is offline   Reply With Quote
Old 08-29-2014, 07:56 PM   #14
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,774
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
I can't help but wonder.... Why on EARTH call the thread "Instructions for patching firmware 3.8.x". Surely it would make far more sense to call it "Instructions for patching firmware 3.8.0", and then, if and when 3.8.1 comes out, a new thread is made called "Instructions for patching firmware 3.8.1".
PeterT is offline   Reply With Quote
Old 08-29-2014, 09:37 PM   #15
surquizu
Evangelist
surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.
 
surquizu's Avatar
 
Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
GeoffR, thanks for the patch.

I adapted the font size to auraHD:


Code:
<Patch>
patch_name = `Custom fonts sizes`
patch_enable = `yes`
# Values for replace
replace_int = CB4AD8, 12, 10
replace_int = CB4ADC, 14, 12
replace_int = CB4AE0, 16, 14
replace_int = CB4AE4, 17, 16
replace_int = CB4AE8, 18, 18
replace_int = CB4AEC, 19, 20
replace_int = CB4AF0, 20, 21
replace_int = CB4AF4, 21, 22
replace_int = CB4AF8, 22, 23
replace_int = CB4AFC, 24, 24
replace_int = CB4B00, 25, 25
replace_int = CB4B04, 26, 26
replace_int = CB4B08, 28, 27
replace_int = CB4B0C, 32, 28
replace_int = CB4B10, 36, 29
replace_int = CB4B14, 40, 30
replace_int = CB4B18, 44, 32
replace_int = CB4B1C, 46, 34
replace_int = CB4B20, 48, 36
replace_int = CB4B24, 50, 40
replace_int = CB4B28, 52, 44
replace_int = CB4B2C, 54, 52
replace_int = CB4B30, 56, 56
replace_int = CB4B34, 58, 60
</Patch>
A curiosity: With the font to 10, the text appears in two columns (in epub only):


Last edited by surquizu; 09-07-2014 at 07:36 PM.
surquizu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firmware Update Instructions and the latest Firmware Versions mitchwah Ectaco jetBook 113 10-24-2023 10:02 PM
Instructions for patching firmware 3.2.0 DNSB Kobo Developer's Corner 66 12-05-2014 08:28 AM
Instructions for patching firmware 3.3.x, 3.4.x, 3.5.x GeoffR Kobo Developer's Corner 285 08-27-2014 11:06 AM
Instructions for patching firmware 3.1.1 GeoffR Kobo Developer's Corner 64 04-18-2014 02:23 PM


All times are GMT -4. The time now is 04:40 PM.


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