View Single Post
Old 05-01-2018, 02:23 PM   #81
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by geek1011 View Post
Your first idea would add complexity, but I could do something like your second. Do you mean that I should ship the original binaries with kobopatch so users do not need to download them?
No.
User copy&paste all patches in the new format in the same archive (i.e. fwpatch.yaml) along with already existing patch. Of course, each patch must have a variable indicating the archive to patch (nickel, libnickel, etc)

Something like:
Spoiler:
# Multi-version patch: 4.6.9960 - 4.8.10956+
Disable reading footer:
- Enabled: no
- PatchFile: nickel
- PatchGroup: Reading footer alternatives
- Description: |
Removes the reading footer for both ePub and KePub books, leaving a 15px
bottom margin which matches the 15px built-in top margin of ePub books.
- FindBaseAddressString: "ReadingFooter {\n qproperty-footerMargin: 105;\n}\n"
- ReplaceString: {Offset: 0x0000, Find: "ReadingFooter {\n qproperty-footerMargin: 105;\n}\n", Replace: "ReadingFooter {min-height:15px;max-height:15px;}\n"}
- FindBaseAddressString: "#caption[qApp_deviceIsTrilogy=true] {\n font-size: 19px;"
- ReplaceString: {Offset: 0x0000, Find: "#caption[qApp_deviceIsTrilogy=true] {\n font-size: 19px;\n}\n", Replace: "#caption {font-size:1px;color:transparent;}\n\0"}


When someone use kobopath, the program first read the file fwpatch.yaml and write a temporary file for each archive to patch (nickel.yaml, libnickel.yaml, etc). Then read each new file and execute the patch like it do now.

Finally, all temporary files are deleted.

The idea behind it is that, when a new patch come to forum, the user should not worry where to put it. All must be copy in the same file without error possibility.
---------------------------
About multipart patch for two archive:

I suppose that the variable "PatchGroup" work checking if only one in the same group are enable. So if all patch are in the same file you can add a new variable "MultiPatch" checking that all patch in the same group are enable at first read.

Something like that:

Spoiler:
# Multi-version patch: 4.7.10413 - 4.8.10956+
Force user line spacing in ePubs (part 1 of 2):
- Enabled: yes
- PatchFile: libnickel.so.1.0.0
- MultiPatch: Line spacing in ePubs
- Description: |
This is part 1 of 2. Also enable part 2 in librmsdk.so.1.0.0.patch
This patch prevents any line-height style set in the book's stylesheet from
being recognised. It will spoil the formatting of some books, but will
ensure that the line spacing set with the adjustment slider takes effect.
- FindBaseAddressString: "\0\0\x20line-height: %1"
- ReplaceString: {Offset: 0x0003, Find: "l", Replace: "_"}


# Multi-version patch: 3.3.0 - 4.8.10956+
Force user line spacing in ePubs (Part 2 of 2):
- Enabled: yes
- PatchFile: librmsdk.so.1.0.0
- MultiPatch: Line spacing in ePubs
# This is part 2 of 2. Also enable part 1 in libnickel.so.1.0.0.patch
#
# This patch prevents any line-height style set in the book's stylesheet from
# being recognised. It will spoil the formatting of some books, but will ensure
# that the line spacing set with the adjustment slider takes effect. (Unless
# the publisher has used the font shorthand style; see option below.)
- FindBaseAddressString: "\0line-height\0"
- ReplaceString: {Offset: 0x0001, Find: "l", Replace: "_"}
#
# Uncomment the following two lines to also prevent the font shorthand style
# from being recognised. The font shorthand style is not very common in ePubs,
# but where used it can also prevent the line spacing from being adjusted.
# Beware that this option will likely have much bigger side-effects on the
# book's formatting, because the font shorthand style is used to set the
# font-size, font family, and other styles in addition to line-height.
#
# - FindBaseAddressString: "\0font\0"
# - ReplaceString: {Offset: 0x0001, Find: "f", Replace: "_"}

Last edited by boriar; 05-01-2018 at 02:28 PM.
boriar is offline   Reply With Quote