Thread: Kobo Patcher
View Single Post
Old 12-08-2013, 02:50 AM   #581
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
Ok I have a test case for fw 3.1.0 (d1b2f00933) that demonstrates the problem with the way kpg.exe is applying the footer patch:
Spoiler:
Code:
<Patch>
patch_name = `Custom reading footer style`
patch_enable = `yes`
#
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: 15;\n}\n\n`
</Patch>


When I apply the above patch with kpg.exe, the new footer is ignored on my Glo. However if I apply the patch using my own program which terminates the replacement string with a null character, then the new footer works as expected on my Glo.

The reason the kpg.exe applied patch is being ignored is that the end of the original string is still being read after the replacement, and so the clause in the original with the [deviceCodeName="kraken"] overrides the new footer, and I just get the original footer.

Edit: I should note for anyone trying this out that my program uses a slightly different syntax in the patch: instead of "replace_xor_58 = ...", write "encode_xor8 = 58" followed by "replace_string = ...".

Last edited by GeoffR; 12-08-2013 at 03:00 AM. Reason: fw 3.1.0
GeoffR is offline   Reply With Quote