View Single Post
Old 10-11-2013, 08:34 AM   #4
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
Modification for Bad Eyes FW 2.8.1[a]

Since it is unclear when the next major FW will be released for devices other than the Aura, and I don't know if I will be able to make a bad eyes patch for it, I publish a patch for FW 2.8.1[a] (9a63806202) now, even though this FW is not any longer available for download.

As there have been some major changes since 2.6.1, I reworked the package completely. It is now easier to use, but still flexible, and compatible with Metazoa-style patch definitions.

Usage:
- double click on 281a.bat
- copy the newly created KoboRoot.tgz, which you will find in the folder 281a_target, to the .kobo folder on your device.

This is, if you have a Touch. If you want to use the patch for another model, you have to edit the configuration files (you can find them in the folder 281a_source).

Some notes on the configuration files:
Spoiler:
Example of a patch job
Code:
<patch>
name=gray to black
enabled=true
action=replace_zlib
position=11E34D4
olddata=background-color: #d8d8d8;
newdata=background-color: #000000;
</patch>
Since long data strings tend to be confusing, it is possible to split them up; for instance

Code:
<patch>
name=Library Books, Title
enabled=true
action=replace_zlib
position=11F7FFC

oldpart=* {\n\tfont-size: 20px;\n\tfont-family: Georgia;\n}\n\n
oldpart=[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}\n\n
oldpart=[deviceCodeName="pixie"] {\n\tfont-size: 21px;\n}\n\n
oldpart=[deviceCodeName="kraken"], \n[deviceCodeName="phoenix"] {\n\tfont-size: 26px;\n}

newpart=* {\n\tfont-size: 24px;\n\tfont-family: Georgia;\n}\n\n
newpart=[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}\n\n
newpart=[deviceCodeName="pixie"] {\n\tfont-size: 21px;\n}\n\n
newpart=[deviceCodeName="kraken"], \n[deviceCodeName="phoenix"] {\n\tfont-size: 26px;\n}

combineparts
</patch>
Be aware that the size of the newdata (or of the combined newparts) is not arbitrary.
If the action is replace_string, the length of the unescaped newdata has to be exactly the same as of the unescaped olddata.
If the action is replace_zlib, the unescaped and compressed newdata has to have the same size as or a smaller the size than the unescaped and compressed olddata.
If the action is replace_utf8chars, replace_float, replace_int, or replace_bytes the number of utf8 chars and so on has to be the same in olddata and newdata.

It is not always easy to guess whether the size of the compressed newdata is acceptable, but the patcher will tell you.

If the size of newdata was to big, I removed css definitions that refer to another model than the Touch by putting # in front of the newpart; e.g.

Code:
<patch>
name=annotation list, highlighted text
enabled=true
action=replace_zlib
position=11E85C4

oldpart=*{\nfont-size: 20px;\nfont-family: Avenir;\npadding-left: 10px;\npadding-top: 5px;\npadding-bottom: 3px;\nbackground-color: #CCCCCC;\nmin-height: 24px;\nmax-height: 24px;\nborder: 1px solid white;\n}\n\n
oldpart=*[deviceCodeName="kraken"], \n*[deviceCodeName="phoenix"]{\nfont-size: 25px;\npadding-left: 12px;\npadding-top: 6px;\npadding-bottom: 4px;\nmin-height: 30px;\nmax-height: 30px;\n}\n\n
oldpart=[localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\n}

newpart=*{\nfont-size: 30px;\nfont-family: Avenir;\npadding-left: 10px;\npadding-top: 5px;\npadding-bottom: 3px;\nbackground-color: #CCCCCC;\nmin-height: 34px;\nmax-height: 24px;\nborder: 1px solid white;\n}\n\n
#newpart=*[deviceCodeName="kraken"], \n*[deviceCodeName="phoenix"]{\nfont-size: 25px;\npadding-left: 12px;\npadding-top: 6px;\npadding-bottom: 4px;\nmin-height: 30px;\nmax-height: 30px;\n}\n\n
newpart=[localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\n}

combineparts
</patch>
If you don't read Japanese and want to use the same patch configuration for Touch, Glo (and Aura HD) you would move the # to the next line and make appropriate changes for Glo and Aura HD.

For an example of how to use MZ-style patch definitions, see the last patch in conf_libnickel.txt.


USE THIS PACKAGE AT YOUR OWN RISK! Make sure your reader is on FW 2.8.1[a] (9a63806202)!

I add some pictures so that you can see advantages and disadvantages (look at the long title in the Books list).
Attached Thumbnails
Click image for larger version

Name:	screen_003.png
Views:	1734
Size:	65.0 KB
ID:	113134   Click image for larger version

Name:	screen_005.png
Views:	1657
Size:	67.1 KB
ID:	113135   Click image for larger version

Name:	screen_008.png
Views:	1559
Size:	21.6 KB
ID:	113136   Click image for larger version

Name:	screen_011.png
Views:	1586
Size:	58.9 KB
ID:	113137   Click image for larger version

Name:	screen_012.png
Views:	1522
Size:	76.9 KB
ID:	113138   Click image for larger version

Name:	screen_014.png
Views:	1575
Size:	69.7 KB
ID:	113139  
Attached Files
File Type: zip Kobopatcher02.zip (11.81 MB, 759 views)

Last edited by tshering; 10-11-2013 at 08:40 AM.
tshering is offline   Reply With Quote