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 01-04-2025, 03:19 PM   #1
p0k3m0n
Member
p0k3m0n began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2019
Device: Kobo
Question ReplaceZlib: new compressed data is 9 bytes longer than old data

I'm going to slightly modify a certain string in src/nickel.yaml but something doesn't fit:

Original:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}"
My:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 15px;\n  font-family: Georgia;\n  text-transform: uppercase;\n}"
Is it possible to fix?
p0k3m0n is offline   Reply With Quote
Old 01-04-2025, 04:53 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,481
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Well... try

My:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {font-size: 15px;font-family: Georgia;text-transform: uppercase;\n}"
PeterT is offline   Reply With Quote
Advert
Old 01-04-2025, 05:10 PM   #3
Aleron Ives
Wizard
Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.
 
Posts: 1,685
Karma: 16307824
Join Date: Sep 2022
Device: Kobo Libra 2
You're adding way more text than was there originally. It isn't going to fit.
Aleron Ives is offline   Reply With Quote
Old 01-05-2025, 05:39 AM   #4
p0k3m0n
Member
p0k3m0n began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2019
Device: Kobo
Quote:
Originally Posted by PeterT View Post
Well... try

My:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {font-size: 15px;font-family: Georgia;text-transform: uppercase;\n}"
Compliation works only with values 8px and 28px. What the...

BTW: is it possible to change fonts in reading footer, I mean the box under the progress bar with the title of the book in reading mode?

Last edited by p0k3m0n; 01-05-2025 at 07:18 AM.
p0k3m0n is offline   Reply With Quote
Old 01-05-2025, 04:52 PM   #5
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,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by p0k3m0n View Post
I'm going to slightly modify a certain string in src/nickel.yaml but something doesn't fit:

Original:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 36px;\n}"
My:
Code:
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 15px;\n  font-family: Georgia;\n  text-transform: uppercase;\n}"
Is it possible to fix?

It's cleaner if you don't try to combine your font-family/text-transform CSS with the the font-size change. So edit your custom patch to split the changes by including these lines:
Code:
          # Glo/Aura/Aura2E/Nia
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 15px;\n}"
          
          # change font-family/case for all pre-2024 models  
        - Find:    "font-family: Avenir;"
          Replace: "font-family:Georgia;text-transform:uppercase;"
If the above still gives a "too long" error message for patch Increase headlines font you can use the following technique to fix it - "steal" some extra space from default code which your Kobo will never use.

I usually use some of the nearby code from the same patched resource (qss/N3TabWidget.qss in this case) targeting only devices set to Japanese and/or a Chinese locale. This doesn't cause a problem because my Kobo locale is always set to English.

You don't say which locale your Kobo is using but if it isn't any of the 3 Chinese locales then you can add one or more of the following localeName lines until kobopatch no longer gives an error for your custom patch.
Code:
          # make some space
        - {Find: "#tabContainer > N3TabItem[localeName=\"zh\"] {\n  font-family: Sans-SerifZH-Simplified, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
        - {Find: "#tabContainer > N3TabItem[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
        - {Find: "#tabContainer > N3TabItem[localeName=\"zh-TW\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
jackie_w is offline   Reply With Quote
Advert
Old 01-06-2025, 04:56 AM   #6
p0k3m0n
Member
p0k3m0n began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2019
Device: Kobo
Quote:
Originally Posted by jackie_w View Post
Code:
          # Glo/Aura/Aura2E/Nia
        - Find:    "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 20px;\n}"
          Replace: "#tabContainer > N3TabItem[qApp_deviceIsPhoenix=true] {\n  font-size: 15px;\n}"
          
          # change font-family/case for all pre-2024 models  
        - Find:    "font-family: Avenir;"
          Replace: "font-family:Georgia;text-transform:uppercase;"
Very smart solution. It works! GG!
p0k3m0n is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to Export Data - Invalid Argument Error When Exporting Data zakropotch Calibre 6 06-18-2022 06:09 PM
Bytes per page data for a sampling of books j.p.s General Discussions 3 12-07-2019 11:19 AM
Cannot modify selected data within Export Calibre data Pholipe Library Management 1 09-05-2019 11:34 AM
Testpoints etc. for USB Data+ & Data- ? Upprcalypse Kindle Developer's Corner 5 03-16-2013 12:47 PM


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


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