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 09-23-2019, 06:15 PM   #316
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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by mathil View Post
One thing I was wondering is if it is possible to alter/reduce the font size of the text in the footnotes popup. I used to install a patch compiled by jcn363 called 'footnotes and alike' (link here), which worked without being updated up until the latest 4.15.* firmware version, but (as I suspected) it doesn't work anymore. I don't know if it would still be feasible in the newest firmware version?
Quote:
Originally Posted by jackie_w View Post
Yes, this is still possible. So far not enough people have expressed interest for it to be added to the standard kobopatch pack but I have my own custom patch I can share with you. I only use mine to reduce font-size for KA1 & Forma but I can add the necessary for all the other models.
@mathil,

Please try the attached patch to change font-size of the main text in kepub pop-up footnotes. Put it in nickel.yaml, or wherever you stored the old, non-working patch by jcn363. Hopefully I've re-written it in a way which ought to survive better across firmwares (but you never can predict what Kobo might change next )

You will need to store this as a personal custom patch, i.e. it's not currently part of the standard kobopatch .zip pack (nor has it ever been). That may change if enough other users make it known they are using it without problems.

Pop-up footnote main text font-size (beta)
Spoiler:
Code:
Pop-up footnote main text font-size:
  - Enabled: no
  - Description: |
        Change font-size of pop-up footnote main text (KePub only).
        (based on the original by jcn363)
        Note: Be aware that making this change will probably also change font-size
              in various other parts of the Kobo GUI
  - FindZlib: "RegularTouchLabel {\n  font-family"
  - ReplaceZlibGroup:
      Replacements:
        # RegularTouchLabel Popup footnote main text
        # Change Replace font-size as required for your Kobo model
          #Touch/Mini
        - Find:    "RegularTouchLabel[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;\n}"
          #Glo/Aura/Aura2
        - Find:    "RegularTouchLabel[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;\n}"
          #AuraHD/H2O/H2O2
        - Find:    "RegularTouchLabel[qApp_deviceIsDragon=true] {\n  font-size: 29px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsDragon=true] {\n  font-size: 29px;\n}"
          #GloHD
        - Find:    "RegularTouchLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;\n}"
          #ClaraHD
        - Find:    "RegularTouchLabel[qApp_deviceIsNova=true] {\n  font-size: 32px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsNova=true] {\n  font-size: 32px;\n}"
          #LibraH2O
        - Find:    "RegularTouchLabel[qApp_deviceIsStorm=true] {\n  font-size: 34px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsStorm=true] {\n  font-size: 34px;\n}"
          #AuraOne/Forma
        - Find:    "RegularTouchLabel[qApp_deviceIsDaylight=true] {\n  font-size: 37px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsDaylight=true] {\n  font-size: 37px;\n}"
jackie_w is offline   Reply With Quote
Old 09-24-2019, 10:13 AM   #317
mathil
Evangelist
mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.mathil ought to be getting tired of karma fortunes by now.
 
Posts: 445
Karma: 287725
Join Date: Sep 2014
Location: Europe
Device: Kobo Aura H2O/Glo HD/Libra 2, Kindle PW3/PW5/PW11, Boox Palma
Quote:
Originally Posted by jackie_w View Post
@mathil,

Please try the attached patch to change font-size of the main text in kepub pop-up footnotes. Put it in nickel.yaml, or wherever you stored the old, non-working patch by jcn363. Hopefully I've re-written it in a way which ought to survive better across firmwares (but you never can predict what Kobo might change next )

You will need to store this as a personal custom patch, i.e. it's not currently part of the standard kobopatch .zip pack (nor has it ever been). That may change if enough other users make it known they are using it without problems.

Pop-up footnote main text font-size (beta)
Spoiler:
Code:
Pop-up footnote main text font-size:
  - Enabled: no
  - Description: |
        Change font-size of pop-up footnote main text (KePub only).
        (based on the original by jcn363)
        Note: Be aware that making this change will probably also change font-size
              in various other parts of the Kobo GUI
  - FindZlib: "RegularTouchLabel {\n  font-family"
  - ReplaceZlibGroup:
      Replacements:
        # RegularTouchLabel Popup footnote main text
        # Change Replace font-size as required for your Kobo model
          #Touch/Mini
        - Find:    "RegularTouchLabel[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;\n}"
          #Glo/Aura/Aura2
        - Find:    "RegularTouchLabel[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;\n}"
          #AuraHD/H2O/H2O2
        - Find:    "RegularTouchLabel[qApp_deviceIsDragon=true] {\n  font-size: 29px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsDragon=true] {\n  font-size: 29px;\n}"
          #GloHD
        - Find:    "RegularTouchLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;\n}"
          #ClaraHD
        - Find:    "RegularTouchLabel[qApp_deviceIsNova=true] {\n  font-size: 32px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsNova=true] {\n  font-size: 32px;\n}"
          #LibraH2O
        - Find:    "RegularTouchLabel[qApp_deviceIsStorm=true] {\n  font-size: 34px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsStorm=true] {\n  font-size: 34px;\n}"
          #AuraOne/Forma
        - Find:    "RegularTouchLabel[qApp_deviceIsDaylight=true] {\n  font-size: 37px;\n}"
          Replace: "RegularTouchLabel[qApp_deviceIsDaylight=true] {\n  font-size: 37px;\n}"
Jackie, thank you so much for taking the time to share and edit your patch I just installed it and it's working perfectly well! I will store this aside and hopefully it will hold up for the following firmware releases as well.
I guess the reason that people haven't asked for this as much as other patches is that it tends to affect mostly people who read a lot of non-fiction. In my case, managing to fit more text in the popup instead of going back and forth to the notes page is really useful, but I can definitely see why most people wouldn't care much about it. I'm feeling very lucky right now thanks again!
mathil is offline   Reply With Quote
Old 09-24-2019, 10:35 AM   #318
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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by mathil View Post
I'm feeling very lucky right now thanks again!
You're welcome. I'm glad it works for you.
jackie_w is offline   Reply With Quote
Old 09-25-2019, 02:59 AM   #319
Vetchy
Connoisseur
Vetchy began at the beginning.
 
Posts: 52
Karma: 10
Join Date: Dec 2017
Device: Kobo Aura One
Does it possible to create patch, allow set fonts for all menu on Kobo. After last update we got new header and footer where supported only Latin font. With Cyrillic its looks ugly.
Maybe it exist?
Click image for larger version

Name:	photo_2019-09-25 09.50.56.jpeg
Views:	383
Size:	164.2 KB
ID:	173692

In next photo I'm marked different font family in header and footer.
Click image for larger version

Name:	doc00377920190925101912.jpg
Views:	391
Size:	136.4 KB
ID:	173693

Last edited by Vetchy; 09-25-2019 at 03:27 AM.
Vetchy is offline   Reply With Quote
Old 09-25-2019, 03:41 AM   #320
Chaplan
Member
Chaplan began at the beginning.
 
Chaplan's Avatar
 
Posts: 15
Karma: 10
Join Date: Aug 2019
Device: Kobo Clara HD
Night all the things...

Quote:
Originally Posted by geek1011 View Post
That's a good idea, and might be doable depending on how the LEDS are controlled. The only issue is it may cause flickering if I make the PWM rate too slow.
Thanks a lot for the time and knowledge you put into this patches.
It makes the UX a lot better for the end user.

I have 2 questions, has this lower brightness possibility ever been tested and if so did flickering actually got noticeable by lowering the PWM rate?

The second question, I'm a night reader and always invert text mode late at night.
Would a quick setting to change between light/dark modes be possible to have on the status bar as we do with portrait/landscape rotation modes?
I know it's possible in devmode, it's just not as accessible as it should IMHO.
I leave it as an idea for a patch.
Chaplan is offline   Reply With Quote
Old 09-25-2019, 07:42 AM   #321
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,804
Karma: 7025947
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by Chaplan View Post
Thanks a lot for the time and knowledge you put into this patches.
It makes the UX a lot better for the end user.

I have 2 questions, has this lower brightness possibility ever been tested and if so did flickering actually got noticeable by lowering the PWM rate?

The second question, I'm a night reader and always invert text mode late at night.
Would a quick setting to change between light/dark modes be possible to have on the status bar as we do with portrait/landscape rotation modes?
I know it's possible in devmode, it's just not as accessible as it should IMHO.
I leave it as an idea for a patch.
I have tried making it as low as the driver will allow without kernel modifications, and it is a bit dimmer, but not by much. There wasn't any noticable flickering.

About a quick setting for invert screen, there is the replace adobe page numbers patch to put it in the reading settings. It's not possible to add a toolbar button because of how it's implemented.
geek1011 is offline   Reply With Quote
Old 09-25-2019, 08:04 AM   #322
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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Vetchy View Post
Does it possible to create patch, allow set fonts for all menu on Kobo. After last update we got new header and footer where supported only Latin font. With Cyrillic its looks ugly.
Maybe it exist?

In next photo I'm marked different font family in header and footer.
It's not possible to do a global patch to change font-family for the whole GUI. At least I can't think of a way to do it. Perhaps geek1011 can correct me if I'm wrong.

In both your images I believe all those highlighted fields are default coded as Avenir sans-serif. There is probably special code to cater to other Kobo-supported languages (e.g. Japanese/Chinese) It looks like Avenir is unsuitable for Cyrillic and, no doubt, many other not-officially-supported languages. It also looks like some of your highlights are using a fallback to Georgia - yes, it's ugly but better than displaying blanks. I think the previous firmware used whatever font-family was selected for the book to display header/footer. This would probably work better for everyone but I've no idea how to do that.

As it stands, I think your 7 highlighted area styles may require at least 6 different patches. Before patching it you have to find the relevant code. It can be like looking for a needle in a haystack. Sometimes you're looking in the wrong haystack. It's tedious, time-consuming and requires a lot of trial and error as, not surprisingly, there's no documentation.

More eyes looking would help but volunteers seem to be few and far between at the moment. There are a lot more patch requesters than patch creators (i.e. 2) and even patch creators deserve some leisure time to read books.

On a slightly more positive note, I have found some of the code which styles the header's chapter name and the footer's book title (see your 2nd image). However, it doesn't seem to control the progress text (right-half of the header/footer). Nor can it be used to un-force the UPPERCASE. A new patch may become available for this, but not yet.

In the meantime, if the current appearance is too ugly, you could take the sweep-it-under-the-rug options in libnickel.so.1.0.0.yaml:
  • enable 'Remove title from reading header/footer' leaving only the progress text visible in header/footer
  • enable both 'Custom header/footer page number text' and 'Custom navigation menu page number text' to show '10 / 20' instead of '10 OF 20'
jackie_w is offline   Reply With Quote
Old 09-25-2019, 09:09 AM   #323
Chaplan
Member
Chaplan began at the beginning.
 
Chaplan's Avatar
 
Posts: 15
Karma: 10
Join Date: Aug 2019
Device: Kobo Clara HD
Quote:
Originally Posted by geek1011 View Post
I have tried making it as low as the driver will allow without kernel modifications, and it is a bit dimmer, but not by much. There wasn't any noticable flickering.

About a quick setting for invert screen, there is the replace adobe page numbers patch to put it in the reading settings. It's not possible to add a toolbar button because of how it's implemented.
Thanks for the input.
I will check that adobe page numbers replace patch and use that to invert the screen. it's one page away, same number of steps once you are already reading. Well done.
As for the lower brightness, must I enable a patch or is the config default?

Sorry to be asking but I am very new to kobo and the scene (bought my Clara HD one month ago), I am overwhelmed with such level of moding the official FW.
I kinda like KoReader to, but nickel tailored with the patches is even better for my personal usage TBH.
Chaplan is offline   Reply With Quote
Old 09-25-2019, 10:20 AM   #324
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,804
Karma: 7025947
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by Chaplan View Post
Thanks for the input.
I will check that adobe page numbers replace patch and use that to invert the screen. it's one page away, same number of steps once you are already reading. Well done.
As for the lower brightness, must I enable a patch or is the config default?

Sorry to be asking but I am very new to kobo and the scene (bought my Clara HD one month ago), I am overwhelmed with such level of moding the official FW.
I kinda like KoReader to, but nickel tailored with the patches is even better for my personal usage TBH.
I haven't written a patch for it yet
geek1011 is offline   Reply With Quote
Old 09-25-2019, 10:48 AM   #325
Chaplan
Member
Chaplan began at the beginning.
 
Chaplan's Avatar
 
Posts: 15
Karma: 10
Join Date: Aug 2019
Device: Kobo Clara HD
Quote:
Originally Posted by geek1011 View Post
I haven't written a patch for it yet
Oh, I'll keep this thread under the radar, if it drops i'll be here to check it out for sure.
Chaplan is offline   Reply With Quote
Old 09-26-2019, 02:45 AM   #326
Vetchy
Connoisseur
Vetchy began at the beginning.
 
Posts: 52
Karma: 10
Join Date: Dec 2017
Device: Kobo Aura One
Quote:
Originally Posted by jackie_w View Post
In both your images I believe all those highlighted fields are default coded as Avenir sans-serif. There is probably special code to cater to other Kobo-supported languages (e.g. Japanese/Chinese) It looks like Avenir is unsuitable for Cyrillic and, no doubt, many other not-officially-supported languages.[/LIST]
Thank of this detail response.

But I have one hypothesis. Can we got some font, like Georgia and rename it to Avenir, after it create patch wich replace Avenir by new font in firmware?
Vetchy is offline   Reply With Quote
Old 09-26-2019, 11:03 AM   #327
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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Vetchy View Post
But I have one hypothesis. Can we got some font, like Georgia and rename it to Avenir, after it create patch wich replace Avenir by new font in firmware?
If I've understood you correctly, the problem with this theory is
  • the Kobo looks inside the font files for the font's name not just at the filenames
  • Kobo's built-in fonts are either encrypted, obfuscated or some other locking method
so, unless someone knows otherwise, simply trying to "fool" it isn't going to work.

When I tried to replicate your images from post #319 I got a different result. I still saw a problem with the Avenir fallback font used for the Cyrillic characters, but I didn't get Georgia as the fallback. My result was even uglier than yours because the fallback font (probably one of the CJK fonts) did show the Cyrillic characters but they were double-spaced.

This leads me to ask whether you have any other font hacks installed? I have a vague memory that a long time ago some Cyrillic users had a hack to physically remove these problematic built-in fallback font(s) so that Georgia would be used instead.

This is just an idea, but if you are using that hack without problems, then maybe extending it to also physically remove the Avenir fonts would automatically default to using Georgia as fallback whenever one was required. I must stress that I haven't (and won't be) testing this myself. I've no idea whether it could cause chaos.

In the meantime, if you want to try a more benign, but only partial, solution you could try the attached simple patch. In your image 2, it should force to Georgia, the chapter name/book title parts of the new header/footer respectively. It's not what you wanted but it's the best I can come up with right now. It won't be added to the kobopatch standard pack in it's current form but it's generic enough that it may survive across firmware updates.

Put it in nickel.yaml or wherever you store any other custom patches for nickel.

New header/footer font-family - beta
Spoiler:
Code:
New header/footer font-family:
  - Enabled: yes
  - Description: Force new header/footer font-family
  - FindZlib: "ReadingFooter"
  - ReplaceZlibGroup:
      Replacements:
      - {Find: "font-family: Avenir;", Replace: "font-family:Georgia;"}

Last edited by jackie_w; 09-26-2019 at 11:07 AM.
jackie_w is offline   Reply With Quote
Old 09-26-2019, 11:25 AM   #328
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: 79,792
Karma: 146391129
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 jackie_w View Post
If I've understood you correctly, the problem with this theory is
  • the Kobo looks inside the font files for the font's name not just at the filenames
  • Kobo's built-in fonts are either encrypted, obfuscated or some other locking method
so, unless someone knows otherwise, simply trying to "fool" it isn't going to work.

When I tried to replicate your images from post #319 I got a different result. I still saw a problem with the Avenir fallback font used for the Cyrillic characters, but I didn't get Georgia as the fallback. My result was even uglier than yours because the fallback font (probably one of the CJK fonts) did show the Cyrillic characters but they were double-spaced.

This leads me to ask whether you have any other font hacks installed? I have a vague memory that a long time ago some Cyrillic users had a hack to physically remove these problematic built-in fallback font(s) so that Georgia would be used instead.

This is just an idea, but if you are using that hack without problems, then maybe extending it to also physically remove the Avenir fonts would automatically default to using Georgia as fallback whenever one was required. I must stress that I haven't (and won't be) testing this myself. I've no idea whether it could cause chaos.

In the meantime, if you want to try a more benign, but only partial, solution you could try the attached simple patch. In your image 2, it should force to Georgia, the chapter name/book title parts of the new header/footer respectively. It's not what you wanted but it's the best I can come up with right now. It won't be added to the kobopatch standard pack in it's current form but it's generic enough that it may survive across firmware updates.

Put it in nickel.yaml or wherever you store any other custom patches for nickel.

New header/footer font-family - beta
Spoiler:
Code:
New header/footer font-family:
  - Enabled: yes
  - Description: Force new header/footer font-family
  - FindZlib: "ReadingFooter"
  - ReplaceZlibGroup:
      Replacements:
      - {Find: "font-family: Avenir;", Replace: "font-family:Georgia;"}
Can I use a font with a longer name that I have in fonts? I would give it a try using ChareInk if I could.
JSWolf is offline   Reply With Quote
Old 09-26-2019, 12:04 PM   #329
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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by JSWolf View Post
Can I use a font with a longer name that I have in fonts? I would give it a try using ChareInk if I could.
Just try replacing Georgia with ChareInk in the Replace string. If kobopatch.bat doesn't fail with some kind of 'too long' error message, it will be fine.

One of the great things about kobopatch/nickel patches is that we don't have to do the exact length string matching anymore. It has some tricks to reclaim cosmetic visual whitespace from the CSS without affecting the Kobo's ability to action the CSS.

If you do get a 'too long' error you can add an extra bit to the patch to delete some of the CSS which won't be used on your Kobo, e.g. the Japanese-locale-specific stuff. For example, adding this line would free up some space for this patch if the new font-family name is too long.
Code:
# free some space
- {Find: "#caption[localeName=\"ja\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}", Replace: "\n"}
It should be indented with the same number of spaces as in the font-family Find/Replace line.

ETA:
I should add this important general info about customising font-family in the Kobo GUI. It will be particularly relevant to you because you read mainly standard epubs.

After a full reboot the Kobo only has immediate access to a limited number of its built-in fonts, Georgia, Avenir and possibly one or more of the CJK fonts. The rest of its built-in fonts and all your custom fonts are only loaded "as necessary". I don't know the exact rules, only what I've observed.

After a full reboot I've always found that the following will force the Kobo to access all fonts. You won't have these problems if you only put the Kobo to sleep.
  1. Open any kepub. It's as easy as that for users who only read kepubs.
  2. If you open a standard epub and you don't see the custom font you were expecting (in the GUI not the book's text)
    • Press the [Aa] font menu button. You don't need to do anything else, just close it again.
    • If you still don't see the font, force the Kobo to re-render by paging across a chapter file boundary, then page back again. Or, closing the book and opening a different one might work, too.

Last edited by jackie_w; 09-26-2019 at 12:23 PM. Reason: ETA
jackie_w is offline   Reply With Quote
Old 09-26-2019, 12:08 PM   #330
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: 79,792
Karma: 146391129
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 jackie_w View Post
Just try replacing Georgia with ChareInk in the Replace string. If kobopatch.bat doesn't fail with some kind of 'too long' error message, it will be fine.

One of the great things about kobopatch/nickel patches is that we don't have to do the exact length string matching anymore. It has some tricks to reclaim cosmetic visual whitespace from the CSS without affecting the Kobo's ability to action the CSS.

If you do get a 'too long' error you can add an extra bit to the patch to delete some of the CSS which won't be used on your Kobo, e.g. the Japanese-locale-specific stuff. For example, adding this line would free up some space for this patch if the new font-family name is too long.
Code:
# free some space
- {Find: "#caption[localeName=\"ja\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}", Replace: "\n"}
It should be indented with the same number of spaces as in the font-family Find/Replace line
Thank you. Once Geek1011 rewrites the shutdown time patch, I'll give yours as go. But for now, I'll copy your patch and place it in the yaml file for use when it's time.
JSWolf is offline   Reply With Quote
Reply

Tags
kobopatch, patches, patching, request, requests


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Request for PW3 kernel [posted in another thread] mustdie Kindle Developer's Corner 5 10-21-2015 04:28 PM
Kobobooks.com future feature request thread Mrs_Often Kobo Reader 47 11-08-2012 11:59 AM
[Old Thread] Calibre 'feature request' thread Waba Calibre 2 02-10-2010 07:52 PM
Feature request thread? Dahak Calibre 1 08-02-2009 12:51 AM
3rd party software request thread Adam B. iRex 23 11-28-2008 01:08 PM


All times are GMT -4. The time now is 01:20 PM.


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