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 12-08-2013, 11:39 AM   #586
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: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
GeoffR, it worked as far as creating the KoboRoot.tgz file with no errors, but the font-size and margin for the Page Number footer didn't change. So I think I will just use the code that is working for me, which is much better than Kobo's defaults. It might be because the font-size property for the Aura HD looks like it is in a separate section from the other properties, but I don't have time today to play with it. I thank you for your help, and when I get more time, I will try to figure it out. Thanks again.
icallaci is offline   Reply With Quote
Old 12-08-2013, 11:45 AM   #587
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 tshering View Post
I guess another way to achieve this (without counting) is adding \x58 to the replacement string.
Ah, I didn't know it accepted that way of specifying characters. But the terminating character needs to be zero in the plain string, the replace_xor_58 will encode it. So if it is allowed to include a null in the string (this would cause problems in C, maybe Python allows it?) then the solution would be to add \x00 as the last character in the string, e.g. icallaci's example would become:
Code:
`ReadingFooter {\n\tmin-height: 40px;\n\tmax-height: 70px;\n\tfont-size: 26px;\n\tqproperty-footerMargin: 15;\n}\n\n\x00`
GeoffR is offline   Reply With Quote
Advert
Old 12-08-2013, 11:46 AM   #588
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
duplicate post deleted

Last edited by GeoffR; 12-08-2013 at 12:46 PM.
GeoffR is offline   Reply With Quote
Old 12-08-2013, 12:22 PM   #589
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by GeoffR View Post
Ah, I didn't know it accepted that way of specifying characters.
I didn't know it myself with certainty (that is why I said "I guess"). I did a test now, and it works.

Quote:
Originally Posted by GeoffR View Post
But the terminating character needs to be zero in the plain string, the replace_xor_58 will encode it.
You are completely right, this was a stupid error of mine. I correct it in the original post in order to prevent harm.
tshering is offline   Reply With Quote
Old 12-08-2013, 12:57 PM   #590
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 icallaci View Post
GeoffR, it worked as far as creating the KoboRoot.tgz file with no errors, but the font-size and margin for the Page Number footer didn't change. So I think I will just use the code that is working for me, which is much better than Kobo's defaults. It might be because the font-size property for the Aura HD looks like it is in a separate section from the other properties, but I don't have time today to play with it. I thank you for your help, and when I get more time, I will try to figure it out. Thanks again.
OK perhaps this will work as your replacement string (using tshering's idea for \x00 as the terminating null instead of a separate replace_bytes line):
Code:
`ReadingFooter {\n\tmin-height: 40px;\n\tmax-height: 70px;\n\tqproperty-footerMargin: 15;\n}\n\n* {\n\tfont-size: 26px;\n}\n\n\x00`
GeoffR is offline   Reply With Quote
Advert
Old 12-08-2013, 01:31 PM   #591
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by GeoffR View Post
I mean the replacement string is not terminated by a null character. Would the two LF's be enough to tell the CSS interpreter to stop processing the rest of the string? I don't think so, as the original footer string is structured like

ReadingFooter { ... }\n\n ReadingFooter[deviceCodeName="dragon"] { ... }\n\n

which I think means that the first clause is applied to all devices, then the second is read but only applied for AuraHD devices. So if the replacement string was the right length to overwrite the first clause but leave the second intact, and there was no terminating null to end the string, then the second clause from the original string would still be applied to AuraHD devices, possibly overriding the first clause.

Edit: I added code to my own program to test, if I terminate the replacement string with a null then I get binary output that differs from what kpg.exe produces, but if I don't terminate the string then I get output identical to kpg.exe.
When I looked at the original Kobo code, it is terminated with a } followed by a null character. I tried adding \x00 to the end of the replacement string I'm using to add a null terminator and it didn't make any difference in what I saw on my Aura HD with the original MZ replacement string. One member sent me a couple of attempted changes which didn't work despite looking okay. I fiddled with changing what was in the replacement string to change it's length and found some odd things happening which did not happen when the null was added. It appears that if the replacement string has the right length to leave a valid looking css style after it, the rest of the original string will be processed.

As an example, here's a setup I was sent that didn't work until a \x00 was added:
Code:
Original string:
ReadingFooter {\n\tmin-height: 70px;\n\tmax-height: 70px;\n\tqproperty-footerMargin: 40;\n}\n\n
Replacement string:
* {\n\tmin-height: 50px;\n\tmax-height: 50px;\n\tfont-size: 34px;\n\tfont-family: Amasis\n}\n\n
Regards,
David

Last edited by DNSB; 12-08-2013 at 01:43 PM.
DNSB is offline   Reply With Quote
Old 12-08-2013, 02:00 PM   #592
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Thank you, guys, for your insights on the rather awkward Footer patch. It kind of explains why the code I posted in #565 works for me - purely by accident, my 'new value' was pretty much the same string-length as the 'old value' - so no nasty surprises.

Using your new info about the terminating \x00 character, the following works for me on my Glo and AuraHD, plus I think it allows customisation of:
  • footer height (using min-height and max-height values)
  • font-size of 'Page x of y' (using font-size value)
  • amount of space between 'Page x of y' text and bottom of screen (using padding-bottom value)
  • I still don't know what qproperty-footerMargin actually does (if anything) so I've kept the new value the same as the old value.

Replacement string for Glo (and hopefully Aura6" but I can't test):
Code:
`ReadingFooter {\n\tmin-height: 40px;\n\tmax-height: 40px;\n\tqproperty-footerMargin: 15;\n}\n\n* {\n\tfont-size: 20px;\n\tpadding-bottom: 5px;\n}\n\n\x00`
Replacement string for AuraHD:
Code:
`ReadingFooter {\n\tmin-height: 50px;\n\tmax-height: 50px;\n\tqproperty-footerMargin: 20;\n}\n\n* {\n\tfont-size: 26px;\n\tpadding-bottom: 8px;\n}\n\n\x00`
jackie_w is offline   Reply With Quote
Old 12-08-2013, 05:31 PM   #593
neil74
Connoisseur
neil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to beholdneil74 is a splendid one to behold
 
Posts: 89
Karma: 19838
Join Date: Sep 2013
Location: UK
Device: Kobo aura
So I'm successfully patched and happy on 2.10. If I connect to wifi will it auto update?
neil74 is offline   Reply With Quote
Old 12-08-2013, 06:44 PM   #594
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.
 
Posts: 13,511
Karma: 78910202
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by neil74 View Post
So I'm successfully patched and happy on 2.10. If I connect to wifi will it auto update?
Maybe... All depends on whether updates have been enabled by Kobo for your device.
PeterT is offline   Reply With Quote
Old 12-08-2013, 07:33 PM   #595
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: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Yes, that's it! Thank you, GeoffR and Jackie_w! The patch finally works perfectly. This is what I ended up with:

Code:
{\n\tmin-height: 40px;\n\tmax-height: 60px;\n\tqproperty-footerMargin: 10;\n}\n\n* {\n\tfont-size: 26px;\n\tpadding-bottom: 10px;\n}\n\n\x00`
Everything is exactly the way I wanted it, and my Aura HD is the perfect ereader now. Karma to both of you.
icallaci is offline   Reply With Quote
Old 12-08-2013, 07:41 PM   #596
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: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quick question: is there a reason all the numeric properties are expressed in pixels (px) except qproperty-footerMargin, which is just a plain number?
icallaci is offline   Reply With Quote
Old 12-08-2013, 07:47 PM   #597
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by icallaci View Post
Quick question: is there a reason all the numeric properties are expressed in pixels (px) except qproperty-footerMargin, which is just a plain number?
If anyone knew what qproperty-footerMargin was supposed to do at all, that might be an easier question to answer

Glad you finally found your 'perfect settings'. Incidentally. I see you have made min-height and max-height two different values. For my own interest, did your testing show that doing this had some advantage?
jackie_w is offline   Reply With Quote
Old 12-08-2013, 08:05 PM   #598
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: 817
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quote:
Originally Posted by jackie_w View Post
Glad you finally found your 'perfect settings'. Incidentally. I see you have made min-height and max-height two different values. For my own interest, did your testing show that doing this had some advantage?
Giving min-height and max-height two different values seems to reduce the space between the text and the Page Number footer on most pages, but if min-height is set too low (30px, for example), then on some pages the descenders of letters would be cut off. 40px for min-height seems to work for now, at least with my current font-size settings.
icallaci is offline   Reply With Quote
Old 12-09-2013, 12:11 AM   #599
norbusan
Zealot
norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.norbusan can do the Funky Gibbon.
 
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
Quote:
Originally Posted by GeoffR View Post
Here is the Wifi insomnia patch for 3.1.0 (d1b2f00933), I haven't tested it because I don't know exactly what it is supposed to do, so post here with the result if you try it.
Thanks, will try in a minute. Normally the Kobo WiFi turns itself off after some time (when not downloading or browsing the shop or so). This patch disables the turn off behaviour. For most people the auto-turn-off is a good property, since it saves battery. But when you ssh into the kobo to play around there it is a pain ;-)

Thanks
norbusan is offline   Reply With Quote
Old 12-09-2013, 07:51 AM   #600
aceflor
Wizard
aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.aceflor ought to be getting tired of karma fortunes by now.
 
aceflor's Avatar
 
Posts: 3,472
Karma: 48036360
Join Date: Aug 2009
Location: where the sun lives, or so they say
Device: Pocketbook Era, Pocketbook Inkpad 4, Kobo Libra 2, Kindle Scribe
For anyone interested : with Jackie's help I modified the Footer patch for the Mini under 3.1.0. It's working for me.

Here goes:


Code:
<Patch>
patch_name = `Custom reading footer style`
patch_enable = `yes`
# CSS. Then CSS over zlib. Then CSS over XOR "crypto". Then CSS over XOR+NOT "crypto". Kobo managers, are you wacky ???
#
# Disable footer example
#replace_xor_58 = 13FA550, `ReadingFooter {\n\tmin-height: 70px;\n\tmax-height: 70px;\n\tqproperty-footerMargin: 40;\n}\n\nReadingFooter[deviceCodeName="kraken"], \nReadingFooter[deviceCodeName="phoenix"] {\n\tmin-height: 82px;\n\tmax-height: 82px;\n\tqproperty-footerMargin: 15;\n}\n\nReadingFooter[deviceCodeName="dragon"] {\n\tmin-height: 120px;\n\tmax-height: 120px;\n\tqproperty-footerMargin: 20;\n}\n\n* {\n\tfont-size: 16px;\n}\n\n[deviceCodeName="kraken"], \n[deviceCodeName="phoenix"] {\n\tfont-size: 20px;\n}\n\n[deviceCodeName="dragon"] {\n\tfont-size: 26px;\n}\n\n[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}`, `* {\n\theight: 5px;\n\tfont-size: 1px;\n\tcolor: transparent;\n}\n\n`
# Decrease footer example
replace_xor_58 = 13FA550, `ReadingFooter {\n\tmin-height: 70px;\n\tmax-height: 70px;\n\tqproperty-footerMargin: 40;\n}\n\nReadingFooter[deviceCodeName="kraken"], \nReadingFooter[deviceCodeName="phoenix"] {\n\tmin-height: 82px;\n\tmax-height: 82px;\n\tqproperty-footerMargin: 15;\n}\n\nReadingFooter[deviceCodeName="dragon"] {\n\tmin-height: 120px;\n\tmax-height: 120px;\n\tqproperty-footerMargin: 20;\n}\n\n* {\n\tfont-size: 16px;\n}\n\n[deviceCodeName="kraken"], \n[deviceCodeName="phoenix"] {\n\tfont-size: 20px;\n}\n\n[deviceCodeName="dragon"] {\n\tfont-size: 26px;\n}\n\n[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}`, `ReadingFooter {\n\tmin-height: 30px;\n\tmax-height: 30px;\n\tqproperty-footerMargin: 10;\n}\n\n* {\n\tfont-size: 16px;\n}\n\n[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}`
</Patch>
aceflor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Glo How to import reading Life Statistics from Kobo Touch to Kobo Glo? the_m Kobo Reader 5 12-13-2012 03:40 PM
$25 gift card w. purchase of Kobo Touch or Kobo Vox at Frys sufue Deals and Resources (No Self-Promotion or Affiliate Links) 0 07-15-2012 10:39 AM
Touch Kobo Touch defective after 3 months and Kobo Customer Support useless shaf Kobo Reader 5 12-04-2011 05:10 PM
Touch Kobo Touch not ejecting cleanly with Calibre OR Kobo Desktop - Windows 7 JBlyth Kobo Reader 11 08-03-2011 05:38 PM
Kobo Touch not disconnecting properly from Calibre OR Kobo Desktop - Windows 7 JBlyth Devices 1 08-03-2011 06:50 AM


All times are GMT -4. The time now is 12:46 PM.


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