Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-16-2022, 01:52 PM   #16
Phil_C
Addict
Phil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud of
 
Phil_C's Avatar
 
Posts: 234
Karma: 27924
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E
Quote:
Originally Posted by jackie_w View Post
More detail, please. Do you mean running kobopatch.bat failed, or something else? If the former please post the error message you got when you ran kobopatch.bat. It should show at the end of the log from the failed run.

Alternatively please post a copy of your customised nickel.yaml file, so I can try it myself. Please note, you may need to rename it to nickel.yaml.txt before MR will allow you to add it as an attachment to your reply.
Yes, kobopatch.bat fails.

Here is the end of the log file. Let me know if you need more.

Spoiler:
| could not apply patch "Custom header/footer captions": line 297: inst 4: ReplaceZlib: find string not found in stream (footerMargin:106
--> could not apply patch "Custom header/footer captions": line 297: inst 4: ReplaceZlib: find string not found in stream (footerMargin:106
Phil_C is online now   Reply With Quote
Old 04-16-2022, 02:17 PM   #17
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Phil_C View Post
Yes, kobopatch.bat fails.

Here is the end of the log file. Let me know if you need more.

Spoiler:
Code:
          |         could not apply patch "Custom header/footer captions": line 297: inst 4: ReplaceZlib: find string not found in stream (footerMargin:106;)
        --> could not apply patch "Custom header/footer captions": line 297: inst 4: ReplaceZlib: find string not found in stream (footerMargin:106;)
This is what's in Part 3 of an un-customised nickel.yaml file for fw 4.32.19501 Lines 352-362:
Code:
        # Customise one or more of the 3 Replace values below as required
          # Touch/Mini/Touch2/Glo/Aura/Aura2/Nia
          # N.B. Touch/Mini/Touch2 could be reduced to 57 with no ill effects
        - {Find: "footerMargin: 105;", Replace: "footerMargin:64;"}
        
          # AuraHD/AuraH2O/AuraH2O2/GloHD/ClaraHD/LibraH2O/Libra2
          # N.B. AuraH2O/AuraH2O2/GloHD/ClaraHD could be reduced to 102 with no ill effects
        - {Find: "footerMargin: 170;", Replace: "footerMargin:116;"}
        
          # AuraOne/Forma/Sage/Elipsa
        - {Find: "footerMargin: 221;", Replace: "footerMargin:133;"}
That error message suggests that your customised nickel.yaml file contains
Code:
Find: "footerMargin:106;"
somewhere (possibly Line 355 ???). You should only be changing "Replace" values, not "Find" values. Maybe an accidental edit during your customisation? If you correct the rogue "Find" it should work OK.
jackie_w is offline   Reply With Quote
Advert
Old 04-16-2022, 02:57 PM   #18
Phil_C
Addict
Phil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud ofPhil_C has much to be proud of
 
Phil_C's Avatar
 
Posts: 234
Karma: 27924
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E
Quote:
Originally Posted by jackie_w View Post
That error message suggests that your customised nickel.yaml file contains
Code:
Find: "footerMargin:106;"
somewhere (possibly Line 355 ???). You should only be changing "Replace" values, not "Find" values. Maybe an accidental edit during your customisation? If you correct the rogue "Find" it should work OK.
That line appeared to be correct in my nickel.yaml. So I started over with a clean extracted patch file, made my changes, and now it works perfectly. I must have accidentally hit something somewhere when editing the original file.

Ah, the ol' "problem lies between the chair and the keyboard" solution.

Thanks, Jackie -- for this and all your work on the patches.
Phil_C is online now   Reply With Quote
Old 04-16-2022, 03:01 PM   #19
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Phil_C View Post
Thanks, Jackie -- for this and all your work on the patches.
You're welcome
jackie_w is offline   Reply With Quote
Old 04-17-2022, 02:37 PM   #20
KaizaCorp
Member
KaizaCorp began at the beginning.
 
KaizaCorp's Avatar
 
Posts: 23
Karma: 10
Join Date: Oct 2020
Location: Saskatoon, SK, Canada
Device: Kobo Clara HD
Quote:
Originally Posted by KaizaCorp View Post
So excited for this patch along with the new firmware! Thank you.

It might be just me, but it seems like 'Reduce top/bottom page spacer' is leaving more space at the bottom than previously? Instead of text using the whole page, there appears to be a margin at the bottom still (similar to when the progress bar is enabled).

If I'm misremembering and this is working as intended, is there a way to completely remove that margin at the bottom? Perhaps by adjusting spacer height in the patch?

(I'm on Clara HD)

Thanks for your time.
Got it looking how I want by adjusting the patch from 22px to 11px
KaizaCorp is offline   Reply With Quote
Advert
Old 04-19-2022, 08:18 AM   #21
jesson345
Enthusiast
jesson345 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2021
Device: kobo glo hd
Help me! cant use "Un-Force user font-family in KePubs".

But in 4.31 its correct!
jesson345 is offline   Reply With Quote
Old 04-19-2022, 12:25 PM   #22
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,539
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jesson345 View Post
Help me! cant use "Un-Force user font-family in KePubs".

But in 4.31 its correct!
I checked the patch and it works for me. Perhaps you could post the log.txt when running the kobopatch batch file?
DNSB is online now   Reply With Quote
Old 04-19-2022, 09:22 PM   #23
jesson345
Enthusiast
jesson345 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2021
Device: kobo glo hd
Quote:
Originally Posted by DNSB View Post
I checked the patch and it works for me. Perhaps you could post the log.txt when running the kobopatch batch file?
Please see attachment.
log.txt

libnickel.so.1.0.0.rar


Here is my modification of Un-Force user font-family:

Un-Force user font-family in KePubs:
- Enabled: yes
- Description: |
The KePub reader uses a very heavy-handed method of setting the font selected
by the user, overriding all fonts set by the publisher in the book unless
"Publisher Default" is selected.
This patch lets the font-family set by the publisher in the KePub stylesheet
override the font-family selected by the reader from the device in some
cases, which allows a mix of user-selected and publisher-selected fonts.
Alternatives 1-3 give increasing preference to the publisher-selected fonts.
- FindBaseAddressString: "* { font-family: %1 !important; }\n"
#
# Alternative 1:
# * { font-family: %1 !important; }\n
# --> div,p{font-family:%1!important; }\n
# - ReplaceString:
# Find: "* { font-family: %1 !important; }\n"
# Replace: "div,p{font-family:%1!important; }\n"
# MustMatchLength: yes
#
# Alternative 2: (Similar to ePub default)
# * { font-family: %1 !important; }\n
# --> body,p{font-family:%1!important;}\n
# - ReplaceString:
# Offset: 0
# Find: "* { font-family: %1 !important; }\n"
# Replace: "body,p{font-family:%1!important;}\n"
# MustMatchLength: yes
#
# Alternative 3: (similar to ePub with `Un-force font-family override p tags`)
# * { font-family: %1 !important; }\n
# --> body{font-family:%1 !important; }\n
- ReplaceString:
Offset: 0
Find: "* { font-family: %1 !important; }\n"
Replace: "body{font-family:%1 !important; }\n"
MustMatchLength: yes

Now I am back to 4.31 firmware,same patch,it's correct。

THX for your help!

Last edited by jesson345; 04-19-2022 at 09:25 PM.
jesson345 is offline   Reply With Quote
Old 04-19-2022, 10:06 PM   #24
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,539
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jesson345 View Post
Please see attachment.
Attachment 193351

Attachment 193352


Here is my modification of Un-Force user font-family:

Spoiler:
Code:
Un-Force user font-family in KePubs:
  - Enabled: yes
  - Description: |
      The KePub reader uses a very heavy-handed method of setting the font selected
      by the user, overriding all fonts set by the publisher in the book unless
      "Publisher Default" is selected.
      This patch lets the font-family set by the publisher in the KePub stylesheet
      override the font-family selected by the reader from the device in some
      cases, which allows a mix of user-selected and publisher-selected fonts.
      Alternatives 1-3 give increasing preference to the publisher-selected fonts.
  - FindBaseAddressString: "* { font-family: %1 !important; }\n"
    #
    # Alternative 1:
    #     * { font-family: %1 !important; }\n
    # --> div,p{font-family:%1!important; }\n
# - ReplaceString:
#     Find: "* { font-family: %1 !important; }\n"
#     Replace: "div,p{font-family:%1!important; }\n"
#     MustMatchLength: yes
    #
    # Alternative 2: (Similar to ePub default)
    #     * { font-family: %1 !important; }\n
    # --> body,p{font-family:%1!important;}\n
# - ReplaceString:
#     Offset: 0
#     Find: "* { font-family: %1 !important; }\n"
#     Replace: "body,p{font-family:%1!important;}\n"
#     MustMatchLength: yes
    #
    # Alternative 3: (similar to ePub with `Un-force font-family override p tags`)
    #     * { font-family: %1 !important; }\n
    # --> body{font-family:%1 !important; }\n
  - ReplaceString:
      Offset: 0
      Find: "* { font-family: %1 !important; }\n"
      Replace: "body{font-family:%1 !important; }\n"
      MustMatchLength: yes

Now I am back to 4.31 firmware,same patch,it's correct。

THX for your help!
The problem for me is that log.txt says the patch was installed successfully and the KoboRoot.tgz file was created. What is telling you the patch failed?
DNSB is online now   Reply With Quote
Old 04-20-2022, 01:12 AM   #25
jesson345
Enthusiast
jesson345 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2021
Device: kobo glo hd
Quote:
Originally Posted by DNSB View Post
The problem for me is that log.txt says the patch was installed successfully and the KoboRoot.tgz file was created. What is telling you the patch failed?
The patching is succeeded。but multi-font cant achieve。

See below:

Click image for larger version

Name:	Multi-font-no.png
Views:	230
Size:	137.8 KB
ID:	193355

Click image for larger version

Name:	Multi-font-yes.png
Views:	215
Size:	207.6 KB
ID:	193356

Click image for larger version

Name:	Multi-font-no1.png
Views:	206
Size:	170.1 KB
ID:	193357

Click image for larger version

Name:	Multi-font-yes1.png
Views:	201
Size:	185.7 KB
ID:	193358
jesson345 is offline   Reply With Quote
Old 04-20-2022, 02:05 AM   #26
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,539
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jesson345 View Post
The patching is succeeded。but multi-font cant achieve。

See below:

Attachment 193355

Attachment 193356

Attachment 193357

Attachment 193358
Can you attach a copy of that ebook or if it is copyright, a scrambled version. However, considering that Kobo made some fairly massive changes in how fonts are handled, it's entirely possible the patch no long functions as it did in earlier firmware.
DNSB is online now   Reply With Quote
Old 04-20-2022, 03:10 AM   #27
jesson345
Enthusiast
jesson345 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2021
Device: kobo glo hd
Quote:
Originally Posted by DNSB View Post
Can you attach a copy of that ebook or if it is copyright, a scrambled version. However, considering that Kobo made some fairly massive changes in how fonts are handled, it's entirely possible the patch no long functions as it did in earlier firmware.
Ok,thanks.

I'll try to find Eng. ebook which support multi-font style sheet。

Chinese ebooks I already own need side-loaded chinese fonts,That's hard to achieve multi-font。
jesson345 is offline   Reply With Quote
Old 04-20-2022, 06:29 AM   #28
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jesson345 View Post
Now I am back to 4.31 firmware,same patch,it's correct。

THX for your help!
If you side load eBooks, you are best to get off of 4.31 or you risk corrupting the database on your Kobo. Go to 4.30 or 4.32 but not 4.31.
JSWolf is online now   Reply With Quote
Old 04-20-2022, 07:42 AM   #29
Acopdegarrotix
Junior Member
Acopdegarrotix began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2013
Device: Kobo Glo HD, Kobo Sage
Quote:
Originally Posted by jesson345 View Post
The patching is succeeded。but multi-font cant achieve。
Quote:
Originally Posted by DNSB View Post
Can you attach a copy of that ebook or if it is copyright, a scrambled version. However, considering that Kobo made some fairly massive changes in how fonts are handled, it's entirely possible the patch no long functions as it did in earlier firmware.
I can confirm jesson345's findings. But the issue affects only kepubs. Up until 4.31, both were OK even without applying the patch.
Attached Thumbnails
Click image for larger version

Name:	epub.png
Views:	168
Size:	103.6 KB
ID:	193371   Click image for larger version

Name:	kepub.png
Views:	157
Size:	193.1 KB
ID:	193372  
Attached Files
File Type: epub Test.epub (463.2 KB, 114 views)
File Type: epub Test_converted.kepub.epub (463.9 KB, 114 views)

Last edited by Acopdegarrotix; 04-20-2022 at 07:44 AM. Reason: Fonts set to Publisher Default
Acopdegarrotix is offline   Reply With Quote
Old 04-20-2022, 08:22 AM   #30
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by jesson345 View Post
Ok,thanks.

I'll try to find Eng. ebook which support multi-font style sheet。

Chinese ebooks I already own need side-loaded chinese fonts,That's hard to achieve multi-font。
Firstly, in fw 4.32.19501 patch Un-Force user font-family in KePubs, with the option 3 you've selected, is working the same as it always has done. I know this because I use it myself.

I believe the font problems you are seeing in your screenshots are due to the major changes Kobo have made to font handling. This has particularly affected certain kepubs where some convenient undocumented "font tricks", which used to work pre-4.32, no longer do. I know this because ~50% of the kepubs loaded on my own Kobos are affected by this change.

If you understand HTML/CSS the following info may be of interest.

-------------------------------------------

Some general background pre-4.32 ...
The official standard way to make your book display fonts referenced by name (e.g. font-family: "My Special Fontname") in the epub/kepub's internal CSS is to embed all those named fonts into the book and include matching @font-face statements in the CSS to link the font to the relevant embedded .ttf or .otf file. As long as you've done it correctly it will work in Kobo epubs and kepubs with a caveat for kepubs:
  • on an unpatched Kobo you must also select "Publisher Default" from the [Aa] font menu.
  • if you apply kobopatch Un-Force user font-family in KePubs you can select any font you like from the [Aa] font menu.
Publishers don't have a choice, they have to follow the standards. But for your own books ... no-one really wants to spend time embedding fonts if there's an easier way.

Fortunately, for kepub users, there *was* an easier way pre-4.32. I've never seen it documented as a supported feature, so maybe it was just a "happy accident". You didn't need to embed any font files or add any @font-face statements to CSS. If the kepub internal CSS contained any style
Code:
font-family: "My Special Fontname";
then the kepub reading app could "find" the font to display if it was present in your Kobo's sideloaded /fonts directory with the correct "My Special Fontname" internal name and external filename(s).

Fw 4.32 onwards ...
Unfortunately this kepub undocumented feature no longer works. I have no idea whether it is due to collateral damage from all the font-related changes in fw 4.32 or a deliberate removal of some old code.

Selecting a sideloaded font from the [Aa] font menu should still work in the same way it always has done for the main body text in kepubs.

-------------------------------------------

What can you do about it? I don't think there is a painless answer unless Kobo see the current situation as a bug (unlikely, but you never know) and "fix" it in a future fw. Special named fonts (e.g. for fancy headings, dropcaps, monospace, true small-caps, ...) will need to be embedded to be visible in kepubs.

Last edited by jackie_w; 04-20-2022 at 08:37 AM. Reason: typo
jackie_w is offline   Reply With Quote
Reply

Tags
kobopatch, patch, patch32lsb, patches, patching

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Instructions for patching firmware 3.18.0 GeoffR Kobo Developer's Corner 151 10-21-2016 06:15 AM
Instructions for patching firmware 3.17.3 GeoffR Kobo Developer's Corner 60 09-17-2015 05:35 PM
Instructions for patching firmware 3.16.10 GeoffR Kobo Developer's Corner 12 08-14-2015 03:40 AM
Instructions for patching firmware 3.12.0 GeoffR Kobo Developer's Corner 165 02-07-2015 09:22 AM
Instructions for patching firmware 3.3.x, 3.4.x, 3.5.x GeoffR Kobo Developer's Corner 285 08-27-2014 10:06 AM


All times are GMT -4. The time now is 06:14 PM.


MobileRead.com is a privately owned, operated and funded community.