Quote:
Originally Posted by jupiter276
Hi everyone. I am using kobo glo HD.
I am trying to see the structure differences between .Patch files from GeoffR and the .txt files from others (like tshering) and don't know how they are structured. I am new to both the kobo firmware and the forum.
What I am trying to do is to fix the Vietnamese font appreance in book titles, Pocket article titles like huuduc1kk2 did here. Though I managed to add more Vietnamese fonts and read books in those fonts (Arial, Times New Roman)
Because the firmwares are different (I am using 3.16.0), so my effort to copy Patch content from huuduc1kk2 to GeoffR's was failed.
Any help is highly appreciated.
Thanks.
P/S: I follow the guidelines from tshering for the patch 3.15.0 and I could now see Book titles, Pocket article titles in Vietnamese, though the Sleeping mode, Pocket title is not in Vietnamese yet. If I could understand the structures of the patch, I would have figure it out.
|
To update from one firmware version to another you will need to find the addresses of the strings you want to change in the new firmware. The addresses change with each new firmware version.
You can find the addresses using a hex editor or the 'strings' command which comes with the GNU binutils package.
Alternatively, if the strings are unique, you can let the patch locate them automatically by using find_base_address and then using adresses relative to the base address. for example if you want to change the string abcdef to abcxyz then this patch would do it automatically for any firmware version where the string was unique:
Code:
<Patch>
patch_name = `Example`
patch_enable = `yes`
find_base_address = `abcdef`
replace_string = 0003, `def`, `xyz`
</Patch>
The adress 0000 is the start of the base string, so 0003 is the address of the d character. The addresses are in hexdecimal.
However if the strings are compressed then you need to use tsherings tools, because I haven't added that feature to the patch32lsb program yet.
Here is an example of one of the patches you linked to (firmware 3.12.1):
Code:
<patch>
name=Header (Touch)
enabled=true
action=replace_string
position=E163FC
oldpart=* {\nfont-size: 16px;\nfont-family: Avenir;\nbackground-color: transparent;\npadding-top:3px;\n}\n\n
oldpart=[qApp_localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\nqproperty-leading: 0;\n}
newpart=* {\nfont-size: 28px;\nfont-family: Arial;\nbackground-color: transparent;\npadding-top:3px;\n}\n\n
newpart=[qApp_localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\nqproperty-leading: 0;\n}
combineparts
</patch>
converted to work with the tools in this thread (but still for firmware 3.12.1):
Code:
<patch>
patch_name = `Header (Touch)`
patch_enable = `yes`
replace_string = E163FC, `* {\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: 28px;\nfont-family: Arial;\nbackground-color: transparent;\npadding-top:3px;\n}\n\n[qApp_localeName="ja_JP"] {\nfont-family: A-OTF Gothic MB101 Pr6N;\nqproperty-leading: 0;\n}`
</patch>
To update to another firmware version you would need to find the new address to replace E163FC, or if the string is unique then use find_base_address. However often the string itself has changed, as it has in firmware 3.16.0, in which case you need to find the equivilent string in the new firmware which can be much more difficult and not something that is easy to explain (there is not really an exact procedure to follow, it is a matter of guessing and testing.)