Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2022, 06:00 PM   #31
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: 76,470
Karma: 136564766
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 413Michele View Post
Yeah that would be helpful, thank you. This way I can confirm whether I've made a mistake or this is a bug
PM sent.
JSWolf is offline   Reply With Quote
Old 08-03-2022, 02:46 AM   #32
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
Quote:
Originally Posted by JSWolf View Post
PM sent.
Sorry for the delay in the answer, I left for a trip on the 30th and things have been a bit hectic. I flashed your file and the results were the same, so it seems the problem is a device one.

I'll be away for a bit without a PC to make tests, but when I get back I intend to try and downgrade my Libra 2 (if it's possible) to see if the patching works with older versions. In the meantime, thanks for the help!
413Michele is offline   Reply With Quote
Advert
Old 08-03-2022, 04:50 AM   #33
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: 76,470
Karma: 136564766
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 413Michele View Post
Sorry for the delay in the answer, I left for a trip on the 30th and things have been a bit hectic. I flashed your file and the results were the same, so it seems the problem is a device one.

I'll be away for a bit without a PC to make tests, but when I get back I intend to try and downgrade my Libra 2 (if it's possible) to see if the patching works with older versions. In the meantime, thanks for the help!
I don't see how my set of patches can be installed and not work. Did you run the KoboRoot.tpz in the .kobo directory? Did it go through the update process and reboot? If so, did you try reading an eBook? You should at least see a change in the header/footer.
JSWolf is offline   Reply With Quote
Old 08-05-2022, 09:58 PM   #34
tinza123
Junior Member
tinza123 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2022
Device: Kobo Libra 2
I tried the "Un-Force user text-align in div,p tags in KePubs" patch, but after enabling that I can't seem to change the alignment anymore in any of the books I own, they just remain the default publisher alignment and won't change. Is that a known issue?
tinza123 is offline   Reply With Quote
Old 08-06-2022, 09:10 AM   #35
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,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by tinza123 View Post
I tried the "Un-Force user text-align in div,p tags in KePubs" patch, but after enabling that I can't seem to change the alignment anymore in any of the books I own, they just remain the default publisher alignment and won't change. Is that a known issue?
Perhaps this is not a suitable patch for you. It's aimed at users who wish to specifically *avoid* Kobo's very aggressive overriding of publisher text alignment in kepubs when they select one of the Justification buttons (left or full) from the Kobo [Aa] menu. The patch simply makes a kepub behave more like an epub would, from a text alignment point-of-view.

Users who *don't* enable this patch shouldn't be surprised when kepub text which the publisher intended to be centre/right-justified no longer is when Kobo Justification is set to anything other than 'Off'.

Users who *do* enable it shouldn't be surprised when the Kobo Justification selection has no effect, because, now, the publisher alignment is no longer being overridden as aggressively as it was without the patch.
jackie_w is offline   Reply With Quote
Advert
Old 08-07-2022, 12:26 PM   #36
CyberPaul
Groupie
CyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheese
 
CyberPaul's Avatar
 
Posts: 159
Karma: 1000
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

Code:
Change Wikipedia search language:
  - Enabled: yes
  - Description: |
      The patch set the search language in Wikipedia.
      Replace the "en" (in both the replace_string lines) to language code you want.
      For example English is "en" (set as default), for German is "de", for Russian is "ru".
  - FindReplaceString:
      Find:    "\0https://%1.m.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.m.wikipedia.org/wiki/Special:Search\0"
  - FindReplaceString:
      Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 12:30 PM   #37
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: 76,470
Karma: 136564766
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 CyberPaul View Post
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

Code:
Change Wikipedia search language:
  - Enabled: yes
  - Description: |
      The patch set the search language in Wikipedia.
      Replace the "en" (in both the replace_string lines) to language code you want.
      For example English is "en" (set as default), for German is "de", for Russian is "ru".
  - FindReplaceString:
      Find:    "\0https://%1.m.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.m.wikipedia.org/wiki/Special:Search\0"
  - FindReplaceString:
      Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
      Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
You cannot do it in the kobopatch.yaml file. You have to do the changes in the yaml file that contains the patches you want to modify.
JSWolf is offline   Reply With Quote
Old 08-07-2022, 12:37 PM   #38
CyberPaul
Groupie
CyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheese
 
CyberPaul's Avatar
 
Posts: 159
Karma: 1000
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Well, that would make kobopatch file totally unhelpful. If I still need to change one of the files, there is no value in using this mechanism.
However I tried the below format and I didn't get any error from the patching process. Are you sure it is not accepted?

Code:
src/libnickel.so.1.0.0.yaml:
    My 24 line spacing values: yes
    Custom font sizes: yes
    Set KePub hyphenation: yes
    Change Wikipedia search language: yes
      - FindReplaceString:
          Find:    "\0https://%1.m.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.m.wikipedia.org/wiki/Special:Search\0"
      - FindReplaceString:
          Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
    Always show confirmation dialog before upgrading: yes
    Unify font sizes: yes
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 12:52 PM   #39
CyberPaul
Groupie
CyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheese
 
CyberPaul's Avatar
 
Posts: 159
Karma: 1000
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
My fault, I was in the wrong folder. I got this error:
Error: could not load config file: error reading kobopatch.yaml: yaml: line 38: mapping values are not allowed in this context
CyberPaul is offline   Reply With Quote
Old 08-07-2022, 03:26 PM   #40
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: 76,470
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I do is put in a comment that I've customized a patch. So I know to go look at the previous version and the new version to put in the customization in the new patches.

The problem is that even if you were able to put the customized patches in the kobopatch.yaml file, you could still have to redo it if the patch needs to be changed for the latest firmware.
JSWolf is offline   Reply With Quote
Old 08-07-2022, 06:30 PM   #41
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,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by CyberPaul View Post
Hi,
I'm trying to create a kobopatch.yaml file but I don't understand how to replace customizable strings like in this example:

I need to specify Italian wikipedia url, how can I do it within the kobopatch.yaml file? It looks like overrides works only for enabling/disabling...
Let me try to explain the usefulness of kobopatch.yaml using your custom Wikipedia patch as an example.
  1. Create a new empty file libnickel_custom.yaml (filename can be anything you like) in the src subdirectory.
  2. Copy your custom libnickel Wikipedia patch into this file with a new name e.g.
    Code:
    Change Wikipedia search language - CyberPaul:
      - Enabled: no
      - Description: |
          The patch set the search language in Wikipedia.
          Replace the "en" (in both the replace_string lines) to language code you want.
          For example English is "en" (set as default), for German is "de", for Russian is "ru".
      - FindReplaceString:
          Find:    "\0https://%1.m.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.m.wikipedia.org/wiki/Special:Search\0"
      - FindReplaceString:
          Find:    "\0https://%1.wikipedia.org/wiki/Special:Search\0"
          Replace: "\0https://it.wikipedia.org/wiki/Special:Search\0"
  3. Now change your kobopatch.yaml file - see the red bits:
    Code:
    ... blah blah ...
    
    patches:
      src/libnickel.so.1.0.0.yaml:  usr/local/Kobo/libnickel.so.1.0.0
      src/libnickel_custom.yaml:    usr/local/Kobo/libnickel.so.1.0.0
    
    ... blah blah ...
    
    overrides:
      src/libnickel.so.1.0.0.yaml:
        My 24 line spacing values: yes
        Custom font sizes: yes
        Set KePub hyphenation: yes
        Always show confirmation dialog before upgrading: yes
        Unify font sizes: yes
      src/libnickel_custom.yaml:
        Change Wikipedia search language - CyberPaul: yes
    
    ... blah blah ...
The benefit of moving your custom patches into a separate libnickel_custom.yaml is that you can keep it from firmware to firmware. It's most useful for custom patches which rarely need to be changed, i.e. those which do not contain hex offsets.

When a new fw is released you can then update the main libnickel.so.1.0.0.yaml file with the new version without worrying about your custom values being overwritten. The only change you'll need to make to kobopatch.yaml is the 2 lines at the top containing fw version number.

... and, just in case you were wondering, you can also use the same approach for custom nickel.yaml patches. Very few nickel patches contain hex offsets, so can often survive, unchanged, for many firmware releases. Some of mine haven't changed for years.

Last edited by jackie_w; 08-07-2022 at 06:33 PM.
jackie_w is offline   Reply With Quote
Old 08-08-2022, 06:42 AM   #42
CyberPaul
Groupie
CyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheeseCyberPaul can extract oil from cheese
 
CyberPaul's Avatar
 
Posts: 159
Karma: 1000
Join Date: Aug 2016
Device: Kindle Voyage - Tolino Vision 4 HD - Kobo Sage
Great solution! Thanks!
CyberPaul is offline   Reply With Quote
Old 08-20-2022, 05:30 AM   #43
SusanReads
Addict
SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.
 
SusanReads's Avatar
 
Posts: 214
Karma: 1228988
Join Date: Sep 2019
Location: The Netherlands
Device: Kindle Paperwhite 4, Kobo Libra 2
Just wondering if I'm doing something wrong or if this patch is no longer working because of Kobo.

I would like my footer font to change to a sideloaded font (Exo 2). Is that at all possible?


Custom header/footer captions:
# Un-comment and customise ONLY ONE of the following to change header/footer font-family
#- {Find: font-family: Avenir;, Replace: font-family:'Exo 2';}
#- {Find: "font-family: Avenir;", Replace: "font-family:Avenir; background:transparent;"}
SusanReads is offline   Reply With Quote
Old 08-20-2022, 08:21 AM   #44
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,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by SusanReads View Post
Just wondering if I'm doing something wrong or if this patch is no longer working because of Kobo.
Unfortunately, the latter. Kobo made major changes to font handling in fw 4.32.19501. Since then accessing your sideloaded fonts from kobopatch seems to be no longer possible.

You can probably switch between Georgia and Avenir in some patches, and possibly some of the CJK fonts, but that's about the limit of what still works.

For your specific question, the only working method I currently know of to change the Avenir font in the GUI, is to completely replace the built-in Avenir system font with a font of your choice. You can easily use the 'files:' section of kobopatch.yaml to assist with this. However, before you do this you do need to be able to use a font editor (e.g. FontForge or ttfedit) to change the *internal* filename of your chosen font to Avenir Next. The Kobo is then fooled into thinking it's using Avenir when it's actually using your custom font.

Needing to use a font editor is possibly what deters many users from trying this. If you did want to try it please be aware that it will affect the whole GUI, not just headers/footers in a book, so you need to choose the replacement font wisely.
jackie_w is offline   Reply With Quote
Old 08-20-2022, 10:48 AM   #45
SusanReads
Addict
SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.SusanReads ought to be getting tired of karma fortunes by now.
 
SusanReads's Avatar
 
Posts: 214
Karma: 1228988
Join Date: Sep 2019
Location: The Netherlands
Device: Kindle Paperwhite 4, Kobo Libra 2
Thank you for explaining, Jackie!

I'm not sure I want to go this far to only change the font of the footer. But I will keep it in mind.
SusanReads is offline   Reply With Quote
Reply

Tags
kobopatch, patch, patch32lsb, patches, patching


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 07:15 AM
Instructions for patching firmware 3.17.3 GeoffR Kobo Developer's Corner 60 09-17-2015 06:35 PM
Instructions for patching firmware 3.17.0 GeoffR Kobo Developer's Corner 49 08-16-2015 06:20 AM
Instructions for patching firmware 3.16.10 GeoffR Kobo Developer's Corner 12 08-14-2015 04:40 AM
Instructions for patching firmware 3.16.0 GeoffR Kobo Developer's Corner 74 08-12-2015 03:12 PM


All times are GMT -4. The time now is 11:31 AM.


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