From 415345bba4d53152cf22acc4ae0935b804f478b9 Mon Sep 17 00:00:00 2001 From: Willy Hsiao Date: Thu, 29 Dec 2022 15:35:07 +0800 Subject: [PATCH 1/4] Added KePub constant font sharpness patch --- .../libnickel.so.1.0.0.yaml/superjeng1.yaml | 19 +++++++++++++++++++ .../libnickel.so.1.0.0.yaml/superjeng1.yaml | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml create mode 100644 src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml diff --git a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml new file mode 100644 index 0000000..1ce60e9 --- /dev/null +++ b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -0,0 +1,19 @@ +# The following patch(es) were made by superjeng1 + +KePub constant font sharpness: + - Enabled: no + - Description: | + With this patch the KePub reader will use a constant sharpness value of 0.2, + instead of the value set by the advanced font sharpness/weight slider. The + slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + # body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n + # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n + - FindReplaceString: + Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" + Replace: "body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n" + MustMatchLength: yes + - ReplaceString: + Offset: 5 + Find: "-kobo-font-sharpness:0.0" + Replace: "-kobo-font-sharpness:0.2" # Replacement sharpness value + MustMatchLength: yes diff --git a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml new file mode 100644 index 0000000..1ce60e9 --- /dev/null +++ b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -0,0 +1,19 @@ +# The following patch(es) were made by superjeng1 + +KePub constant font sharpness: + - Enabled: no + - Description: | + With this patch the KePub reader will use a constant sharpness value of 0.2, + instead of the value set by the advanced font sharpness/weight slider. The + slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + # body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n + # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n + - FindReplaceString: + Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" + Replace: "body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n" + MustMatchLength: yes + - ReplaceString: + Offset: 5 + Find: "-kobo-font-sharpness:0.0" + Replace: "-kobo-font-sharpness:0.2" # Replacement sharpness value + MustMatchLength: yes From 149c6e9b8e9b1da960d48f575bf13667acfc4652 Mon Sep 17 00:00:00 2001 From: Willy Hsiao Date: Thu, 29 Dec 2022 15:41:47 +0800 Subject: [PATCH 2/4] Removed patch is missing comment --- src/versions/4.34.20097/libnickel.so.1.0.0.yaml/geoffr.yaml | 2 +- src/versions/4.35.20400/libnickel.so.1.0.0.yaml/geoffr.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/geoffr.yaml b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/geoffr.yaml index d997055..155d056 100644 --- a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/geoffr.yaml +++ b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/geoffr.yaml @@ -407,7 +407,7 @@ ePub constant font sharpness: - FindBaseAddressString: "\0\0 -kobo-font-sharpness: %1;" - ReplaceString: {Offset: 3, Find: "-kobo-font-sharpness: %1", Replace: "-kobo-font-sharpness:0.2", MustMatchLength: yes} -# MISSING: KePub constant font sharpness (not enough room for neutralizing the QString arg; we will probably need to patch that one out) +# For KePub constant font sharpness, see another patch below. Un-Force user text-align in div,p tags in KePubs: - Enabled: no diff --git a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/geoffr.yaml b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/geoffr.yaml index d997055..155d056 100644 --- a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/geoffr.yaml +++ b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/geoffr.yaml @@ -407,7 +407,7 @@ ePub constant font sharpness: - FindBaseAddressString: "\0\0 -kobo-font-sharpness: %1;" - ReplaceString: {Offset: 3, Find: "-kobo-font-sharpness: %1", Replace: "-kobo-font-sharpness:0.2", MustMatchLength: yes} -# MISSING: KePub constant font sharpness (not enough room for neutralizing the QString arg; we will probably need to patch that one out) +# For KePub constant font sharpness, see another patch below. Un-Force user text-align in div,p tags in KePubs: - Enabled: no From 6d69ea3287542f16dcda6d66621930b97e65e478 Mon Sep 17 00:00:00 2001 From: Willy Hsiao Date: Thu, 29 Dec 2022 17:05:04 +0800 Subject: [PATCH 3/4] Moved a space over to allow negative value --- .../4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml | 6 +++--- .../4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml index 1ce60e9..6eed3fe 100644 --- a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml +++ b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -10,10 +10,10 @@ KePub constant font sharpness: # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n - FindReplaceString: Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" - Replace: "body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n" + Replace: "body{-kobo-font-sharpness: 0.0/*%1*/;-kobo-font-thickness:%2;text-rendering:%3;}\n" MustMatchLength: yes - ReplaceString: Offset: 5 - Find: "-kobo-font-sharpness:0.0" - Replace: "-kobo-font-sharpness:0.2" # Replacement sharpness value + Find: "-kobo-font-sharpness: 0.0" + Replace: "-kobo-font-sharpness: 0.2" # Replacement sharpness value MustMatchLength: yes diff --git a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml index 1ce60e9..6eed3fe 100644 --- a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml +++ b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -10,10 +10,10 @@ KePub constant font sharpness: # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n - FindReplaceString: Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" - Replace: "body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n" + Replace: "body{-kobo-font-sharpness: 0.0/*%1*/;-kobo-font-thickness:%2;text-rendering:%3;}\n" MustMatchLength: yes - ReplaceString: Offset: 5 - Find: "-kobo-font-sharpness:0.0" - Replace: "-kobo-font-sharpness:0.2" # Replacement sharpness value + Find: "-kobo-font-sharpness: 0.0" + Replace: "-kobo-font-sharpness: 0.2" # Replacement sharpness value MustMatchLength: yes From 5740e19255fa594c05a199206bba647d4aef2629 Mon Sep 17 00:00:00 2001 From: Willy Hsiao Date: Sat, 31 Dec 2022 23:31:33 +0800 Subject: [PATCH 4/4] Update description and allow more precise value --- .../libnickel.so.1.0.0.yaml/superjeng1.yaml | 19 ++++++++++++++----- .../libnickel.so.1.0.0.yaml/superjeng1.yaml | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml index 6eed3fe..ae48bec 100644 --- a/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml +++ b/src/versions/4.34.20097/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -1,19 +1,28 @@ # The following patch(es) were made by superjeng1 -KePub constant font sharpness: +KePub constant font sharpness (Font anti-aliasing): - Enabled: no - Description: | With this patch the KePub reader will use a constant sharpness value of 0.2, instead of the value set by the advanced font sharpness/weight slider. The slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + Despite the slider range, the value set by this patch could go past the range, + however large values may start to break the font apart, feel free to fine tune + this value. The sharpness actually refers to how much anti-aliasing Kobo would + use, less anti-aliasing would make the font appear sharper, but the curvatures + of the font would appear jagged. So tuning this value *down* (Use *more* anti- + aliasing) makes sense, but this doesn't work indefinitely as the system would + start to just add blur instead of doing anything. # body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n - # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n + # --> body{-kobo-font-sharpness: 0.00/*%1*/;-kobo-font-thickness:%2;text-rendering:%3}\n - FindReplaceString: Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" - Replace: "body{-kobo-font-sharpness: 0.0/*%1*/;-kobo-font-thickness:%2;text-rendering:%3;}\n" + Replace: "body{-kobo-font-sharpness: 0.00/*%1*/;-kobo-font-thickness:%2;text-rendering:%3}\n" MustMatchLength: yes - ReplaceString: Offset: 5 - Find: "-kobo-font-sharpness: 0.0" - Replace: "-kobo-font-sharpness: 0.2" # Replacement sharpness value + Find: "-kobo-font-sharpness: 0.00" + Replace: "-kobo-font-sharpness: 0.20" # Replace 0.20 with desired value + # Example of a negative value + # Replace: "-kobo-font-sharpness:-0.20" MustMatchLength: yes diff --git a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml index 6eed3fe..ae48bec 100644 --- a/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml +++ b/src/versions/4.35.20400/libnickel.so.1.0.0.yaml/superjeng1.yaml @@ -1,19 +1,28 @@ # The following patch(es) were made by superjeng1 -KePub constant font sharpness: +KePub constant font sharpness (Font anti-aliasing): - Enabled: no - Description: | With this patch the KePub reader will use a constant sharpness value of 0.2, instead of the value set by the advanced font sharpness/weight slider. The slider sharpness values range from -0.4(min.) to 0.2(max.), default -0.0666. + Despite the slider range, the value set by this patch could go past the range, + however large values may start to break the font apart, feel free to fine tune + this value. The sharpness actually refers to how much anti-aliasing Kobo would + use, less anti-aliasing would make the font appear sharper, but the curvatures + of the font would appear jagged. So tuning this value *down* (Use *more* anti- + aliasing) makes sense, but this doesn't work indefinitely as the system would + start to just add blur instead of doing anything. # body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n - # --> body{-kobo-font-sharpness:0.0/*%1*/;-kobo-font-thickness:%2;text-rendering: %3;}\n + # --> body{-kobo-font-sharpness: 0.00/*%1*/;-kobo-font-thickness:%2;text-rendering:%3}\n - FindReplaceString: Find: "body { -kobo-font-sharpness: %1; -kobo-font-thickness: %2; text-rendering: %3; }\n" - Replace: "body{-kobo-font-sharpness: 0.0/*%1*/;-kobo-font-thickness:%2;text-rendering:%3;}\n" + Replace: "body{-kobo-font-sharpness: 0.00/*%1*/;-kobo-font-thickness:%2;text-rendering:%3}\n" MustMatchLength: yes - ReplaceString: Offset: 5 - Find: "-kobo-font-sharpness: 0.0" - Replace: "-kobo-font-sharpness: 0.2" # Replacement sharpness value + Find: "-kobo-font-sharpness: 0.00" + Replace: "-kobo-font-sharpness: 0.20" # Replace 0.20 with desired value + # Example of a negative value + # Replace: "-kobo-font-sharpness:-0.20" MustMatchLength: yes