View Single Post
Old 11-17-2024, 05:34 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,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Kobopatch updates for fw 4.41.23145

Quote:
Originally Posted by hatuluang View Post
As mentioned in the title, some patches from firmware 4.40.23081 don't work in firmware 4.41.23145
I made some nickel.yaml & librmsdk.so.1.0.0.yaml GitHub commits back in April for fw 4.39.22801. @geek1011 hasn't made a full patch release since so I'm posting the patch updates here.

Patch updates for src/nickel.yaml These 4 patch updates should work OK in all of fw 4.41.xxxxx, 4.40.xxxxx, 4.39.xxxxx
  1. Custom header/footer captions:
    Spoiler:
    Code:
    Custom header/footer captions:
      - Enabled: no
      - Description: |
            This patch allows you to change various header/footer caption attributes:
            - font-family (Part 1)
            - font-size & vertical position fine-tuning (Part 2)
            - width (Part 3)
            Header & footer will automatically be a matched pair. 
            Parts 1 & 2: Full details & screenshots at 
            https://www.mobileread.com/forums/showpost.php?p=3897175&postcount=4
            Part 3: Before/after screenshots at
            https://www.mobileread.com/forums/showpost.php?p=4069495&postcount=18
            #
            N.B: This patch is not suitable for Japanese/Chinese locale users
            fw 4.23.15505 No longer possible to customise font-size for GloHD/ClaraHD
                separately from AuraHD/H2O.
            fw 4.29.18730 No longer possible to style header/footer separately.
            fw 4.32.19501 Kobo's major changes to font handling mean that ability to customise
                font-family in a kobopatch is now very limited.
    
      - FindZlib: "ReadingFooter" # qss/ReadingFooter.qss
      - ReplaceZlibGroup:
          Replacements:
            # Part 1: Customise font-family
            # #caption
            # The only custom font-family values now likely to have any effect are Georgia, Avenir
            #   and possibly(?) some of the built-in CJK fonts
            # Un-comment and customise ONLY ONE of the following to change header/footer font-family
            #- {Find: "font-family: DefaultSansSerif;", Replace: "font-family:DefaultSansSerif;"}
            #- {Find: "font-family: DefaultSansSerif;", Replace: "font-family:DefaultSansSerif; background:transparent;"}
            #
            # Hint: 
            #   Even if you don't need to change font-family you might want to un-comment the 2nd Find/Replace above.
            #   Setting the caption's background to transparent instead of the default, opaque white,
            #   should avoid the potential "dogear bookmark problem" outlined below in Part 3 of this patch. 
    
            # Part 2:
            #   2a. Change font-size (header & footer simultaneously)
            #       Separate values for GloHD & ClaraHD (Alyssum & Nova) removed in 4.23.15505
            #
            #   2b.(optional): Fine-tune footer position by adjusting value of margin-top.
            #                  A negative margin-top (e.g. -10px) moves the footer text 
            #                  slightly upwards, further away from the bottom bezel/progressbar,
            #                  closer to the page content.
            #                  N.B. A non-zero margin-top also automatically shifts the header text
            #                       vertically by the same amount and in the same direction
            #                       as the footer text.
            # #caption
              # Touch/Mini
            - Find:    "[qApp_deviceIsTrilogy=true] {\n  font-size: 14px;\n}"
              Replace: "[qApp_deviceIsTrilogy=true] {\n  font-size: 14px; margin-top: 0px;\n}"
              # Glo/Aura/Aura2/Nia
            - Find:    "[qApp_deviceIsPhoenix=true] {\n  font-size: 17px;\n}"
              Replace: "[qApp_deviceIsPhoenix=true] {\n  font-size: 17px; margin-top: 0px;\n}"
              # AuraHD/AuraH2O/AuraH202/GloHD/ClaraHD/Clara2E
            - Find:    "[qApp_deviceIsDragon=true] {\n  font-size: 25px;\n}"
              Replace: "[qApp_deviceIsDragon=true] {\n  font-size: 25px; margin-top: 0px;\n}"
              # LibraH2O/Libra2
            - Find:    "[qApp_deviceIsStorm=true] {\n  font-size: 29px;\n}"
              Replace: "[qApp_deviceIsStorm=true] {\n  font-size: 29px; margin-top: 0px;\n}"
              # AuraOne/Forma/Sage/Elipsa/Elipsa2E
            - Find:    "[qApp_deviceIsDaylight=true] {\n  font-size: 32px;\n}"
              Replace: "[qApp_deviceIsDaylight=true] {\n  font-size: 32px; margin-top: 0px;\n}"
    
            # Part 3: Increase the width of header/footer captions by reducing the width
            #         of the pageturn tap zones in the footer's left/right corners
            # N.B: 
            #   The default Replace values below have been set larger than you might prefer.
            #     This is to avoid the possibility of the "dogear" bookmark icon
            #     in the top right corner being partially obscured by the header caption's white background.
            #   See screenshot at following link for an example of what can happen 
            #     if the new Replace value is too small.
            #     https://www.mobileread.com/forums/showpost.php?p=4069755&postcount=34
            #   Feel free to reduce your custom Replace values if a wider caption area
            #     is more important to you than "dogear" aesthetics. 
            #     Alternatively, look at the Hint in Part 1 of this patch for a way to avoid
            #     the "dogear" problem.
            #
            # 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/Clara2E/LibraH2O/Libra2
              # N.B. AuraH2O/AuraH2O2/GloHD/ClaraHD/Clara2E could be reduced to 102 with no ill effects
            - {Find: "footerMargin: 170;", Replace: "footerMargin:116;"}
            
              # AuraOne/Forma/Sage/Elipsa/Elipsa2E
            - {Find: "footerMargin: 221;", Replace: "footerMargin:133;"}
    
            # Don't change anything below. It exists to free up some space for
            # your changes above by removing Japanese/Chinese-specific CSS code blocks
            # so that kobopatch will run without giving some kind of 'too long' error message.
            - {Find: "#caption[localeName=\"ja\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
            - {Find: "#caption[localeName=\"zh\"] {\n  font-family: Sans-SerifZH-Simplified, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
            - {Find: "#caption[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"}
            - {Find: "#caption[localeName=\"zh-TW\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}\n", Replace: "\n"

  2. Customise Header back button:
    Spoiler:
    Code:
    Customise Header back button:
      - Enabled: no
      - Description: |
            Customise in-book button (top left corner) for 'Back to Home', 'Back to My Books' etc
            fw 4.32.19501 Kobo's major changes to font handling mean that ability to customise
                font-family in a kobopatch is now very limited.
      - FindZlib: "#ReadingMenuView" # qss/ReadingMenuView.qss
      - ReplaceZlibGroup:
          Replacements:
            # 'Back to Home' button un-bolded
            - Find:    "#backLabel #label {\n  font-family: DefaultSansSerif;\n  font-style: normal;\n  font-weight: bold;"
              Replace: "#backLabel #label {\n  font-family:DefaultSansSerif;\n  font-style:normal;\n  font-weight:normal;"

  3. Custom page navigation scrubber:
    Spoiler:
    Code:
    Custom page navigation scrubber:
      - Enabled: no
      - Description: |
            This patch allows you to customise various parts of the new 'scrubber'. Full details & screenshots at:
            https://www.mobileread.com/forums/showpost.php?p=3897174&postcount=3
            N.B: This patch is not suitable for Japanese/Chinese locale users
            fw 4.32.19501 Kobo's major changes to font handling mean that ability to customise
                font-family in a kobopatch is now very limited.
      - FindZlib: "#scrubberContainer" # qss/ReadingMenuScrubberView.qss
      - ReplaceZlibGroup:
          Replacements:
            # Part 1. Customise all 3 of these buttons
            #    - Left & Right 'Back to page nnn' (#revertLeft, #revertRight)
            #    - Current chapter name (#chapter)
    
            # 1a. Customise font-size for desired model(s):
              # Touch/Mini (Trilogy)
            - Find:    "[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;"
              Replace: "[qApp_deviceIsTrilogy=true] {\n  font-size: 19px;"
              # Glo/Aura/Aura2/Nia (Phoenix)
            - Find:    "[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;"
              Replace: "[qApp_deviceIsPhoenix=true] {\n  font-size: 23px;"
              # AuraHD/AuraH2O/AuraH202 (Dragon)
            - Find:    "[qApp_deviceIsDragon=true] {\n  font-size: 29px;"
              Replace: "[qApp_deviceIsDragon=true] {\n  font-size: 29px;"
              # GloHD (Alyssum)
            - Find:    "[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;"
              Replace: "[qApp_deviceIsAlyssum=true] {\n  font-size: 32px;"
              # ClaraHD/Clara2E (Nova)
            - Find:    "[qApp_deviceIsNova=true] {\n  font-size: 32px;"
              Replace: "[qApp_deviceIsNova=true] {\n  font-size: 32px;"
              # LibraH2O/Libra2 (Storm)
            - Find:    "[qApp_deviceIsStorm=true] {\n  font-size: 34px;"
              Replace: "[qApp_deviceIsStorm=true] {\n  font-size: 34px;"
              # AuraOne/Forma/Sage/Elipsa/Elipsa2E (Daylight)
            - Find:    "[qApp_deviceIsDaylight=true] {\n  font-size: 37px;"
              Replace: "[qApp_deviceIsDaylight=true] {\n  font-size: 37px;"
    
            # 1b. Customise other font properties of these 3 buttons (all models):
            #     - font-family. The only custom font-family values now likely to have any effect
            #       are Georgia, Avenir and possibly(?) some of the built-in CJK fonts
            #     - font-weight (bold or normal)
            #     - font-style  (italic or normal)
            - Find:    "{\n  font-family: DefaultSansSerif;\n  font-weight: bold;\n  font-style: normal;\n}"
              Replace: "{font-family:DefaultSansSerif; font-weight:bold; font-style:normal;}"
            # Users with CSS knowledge can add extra style properties as desired,
            # e.g. to make them look more like buttons and less like labels,
            #      use this Replace instead. If it can be done with CSS you can do it here.
              #Replace: "{font-family:DefaultSansSerif; font-weight:normal; font-style:normal; background-color:#ddd;}"
    
            # Part 2. Customise the central 'Page x of y' label (#page)
            #         Provided for those who want to create a uniform look & feel
            # 2a. Customise font-size for desired model(s):
              # Touch/Mini (Trilogy)
            - Find:    "#page[qApp_deviceIsTrilogy=true] {\n  font-size: 17px;"
              Replace: "#page[qApp_deviceIsTrilogy=true] {\n  font-size: 17px;"
              # Glo/Aura/Aura2/Nia (Phoenix)
            - Find:    "#page[qApp_deviceIsPhoenix=true] {\n  font-size: 22px;"
              Replace: "#page[qApp_deviceIsPhoenix=true] {\n  font-size: 22px;"
              # AuraHD/AuraH2O/AuraH202 (Dragon)
            - Find:    "#page[qApp_deviceIsDragon=true] {\n  font-size: 26px;"
              Replace: "#page[qApp_deviceIsDragon=true] {\n  font-size: 26px;"
              # GloHD (Alyssum)
            - Find:    "#page[qApp_deviceIsAlyssum=true] {\n  font-size: 30px;"
              Replace: "#page[qApp_deviceIsAlyssum=true] {\n  font-size: 30px;"
              # ClaraHD/Clara2E (Nova)
            - Find:    "#page[qApp_deviceIsNova=true] {\n  font-size: 30px;"
              Replace: "#page[qApp_deviceIsNova=true] {\n  font-size: 30px;"
              # LibraH2O/Libra2 (Storm)
            - Find:    "#page[qApp_deviceIsStorm=true] {\n  font-size: 30px;"
              Replace: "#page[qApp_deviceIsStorm=true] {\n  font-size: 30px;"
              # AuraOne/Forma/Sage/Elipsa/Elipsa2E (Daylight)
            - Find:    "#page[qApp_deviceIsDaylight=true] {\n  font-size: 34px;"
              Replace: "#page[qApp_deviceIsDaylight=true] {\n  font-size: 34px;"
    
            # 2b. Customise other font properties of 'Page x of y' label (all models)
            #     e.g. text-transform (uppercase or none)
            #          font-family, font-weight, font-style, etc.
            # Un-comment next 2 lines and change Replace CSS as desired
            #- Find:    "#page {\n  padding-left: 0px;\n}"
            #  Replace: "#page {padding-left:0px; font-family:DefaultSerif; text-transform:none;}"

  4. Custom collection/author header title font:
    Spoiler:
    Code:
    Custom collection/author header title font:
      - Enabled: no
      - Description: |
          Change font appearance in Collection and Author list header
          See https://www.mobileread.com/forums/showpost.php?p=3520879&postcount=42
          fw 4.17.13694 rewritten by jackie_w to replace 
          oren64's patch "Custom font to collection and author titles"
          fw 4.23.15505 Author/Series/Collection list headers no longer forced to uppercase
          fw 4.32.19501 Kobo's major changes to font handling mean that ability to customise
             font-family in a kobopatch is now very limited.
      - FindZlib: "#scrollContainer[containerSpacing=true]" # qss/DragonLibraryView.qss
      - ReplaceZlibGroup:
          Replacements:
            # #header #headerTitle Change font-family, font-size
            #
            # Change font-family. The only custom font-family values now likely to have any effect
            #   are Georgia, Avenir and possibly(?) some of the built-in CJK fonts
            # Un-comment & edit next line to change font-family
            #- {Find: "font-family: DefaultSansSerif;", Replace: "font-family: DefaultSerif;"}
            #
            # Increase font-size.
              # Touch/Mini (Trilogy)
            - {Find: "font-size: 16px;", Replace: "font-size: 28px;"}
              # Glo/Aura/Aura2/Nia (Phoenix)
            - {Find: "font-size: 20px;", Replace: "font-size: 36px;"}
              # AuraHD/AuraH2O/AuraH202/GloHD/ClaraHD/Clara2E (Dragon)
            - {Find: "font-size: 28px;", Replace: "font-size: 42px;"}
              # LibraH2O/Libra2 (Storm)
            - {Find: "font-size: 32px;", Replace: "font-size: 46px;"}
              # AuraOne/Forma/Sage/Elipsa/Elipsa2E (Daylight)
            - {Find: "font-size: 36px;", Replace: "font-size: 50px;"}

These 2 patch updates are for fw 4.41.23145 only.
  1. Increase size of kepub chapter progress chart:
    Change the BaseAddress offset line to
    Code:
      - BaseAddress: 0x1C7A18C # qss/ReadingMenuStatsView.qss
  2. Remove forgot pin button from lock screen:
    The BaseAddress offset line needs to be changed to one of the following. I'm sorry I can't be more specific. Someone needs to test which one is correct and report back. There's no need to worry if you pick the wrong one, it will have removed the unwanted "forgot PIN" message from the Parental Control PIN screen instead.
    Code:
      - BaseAddress: 0x1C70CE6 # qss/PinCodeInputDialog.qss
    or
    Code:
      - BaseAddress: 0x1C64C69 # qss/PinCodeInputDialog.qss

Patch updates for src/librmsdk.so.1.0.0.yaml These 2 updates should work OK in all of fw 4.41.xxxxx, 4.40.xxxxx, 4.39.xxxxx
  1. Default ePub serif font (Amasis): renamed to Default ePub serif font:
    Spoiler:
    Code:
    Default ePub serif font:
      - Enabled: no
      - Description: |
            This patch changes the default ePub serif font to Bitter.
            If the book's stylesheet specifies the generic 'font-family:serif;' then
                the ePub reader will try to use the built-in GUI system serif font
                    (Georgia or 'Rakuten Serif').
                This is also the font you see if you select 'Publisher Default' from
                the Kobo [Aa] menu and your epub has not specified any particular font.
            This patch allows you to change the default to a different serif font 
                (built-in or sideloaded).
            N.B. This patch does not affect kepubs.
    
        # fw 4.32.19501: The font-family name in Replace: must now be the WHOLE name
        #                not just the first few characters of the name.
        #
        # To use a different font, change "Bitter" in each replacement string
        # to another font name (15 characters max).
        # For example, change "Rakuten%20Serif" to "Noto%20Serif" to use 
        #   a sideloaded 'Noto Serif' font.
        # The 3-char string, %20, represents a single space in the font-family name.
        #
        # If your new font name is longer than 15 chars you would need to:
        #   - Use a font editor to shorten the internal font-family name to <= 15 chars
        #   - Rename the 4 font filenames to match the new shortened name
        #   - Copy the 4 renamed font files into the Kobo sideloaded fonts folder
      - FindReplaceString: {Find: "/normal/Rakuten%20Serif", Replace: "/normal/Bitter"}
      - FindReplaceString: {Find: "/bold/Rakuten%20Serif", Replace: "/bold/Bitter"}
      - FindReplaceString: {Find: "/italic/Rakuten%20Serif", Replace: "/italic/Bitter"}
      - FindReplaceString: {Find: "/bolditalic/Rakuten%20Serif", Replace: "/bolditalic/Bitter"}

  2. Default ePub sans-serif font (Gill Sans): renamed to Default ePub sans-serif font:
    Spoiler:
    Code:
    Default ePub sans-serif font:
      - Enabled: no
      - Description: |
          This patch changes the default ePub sans-serif font to 'Noto Sans'.
          If the book's stylesheet specifies the generic 'font-family:sans-serif;' then
            the ePub reader will try to use the built-in GUI system sans-serif font 
            ('Avenir Next' or 'Rakuten Sans').
          This patch allows you to change the default to a different sans-serif font
            (built-in or sideloaded).
          N.B. This patch does not affect kepubs.
    
        # fw 4.32.19501: The font-family name in Replace: must now be the WHOLE name
        #                not just the first few characters of the name.
        # fw 4.34.20097: Kobo removed the 'Gill Sans' font files from the firmware. There is
        #       no longer a built-in sans-serif font with a name short enough to use in this patch.
        #       You can still use the patch with one of your sideloaded sans-serif fonts.
        # fw 4.34+: Kobo continue to revise the list of built-in fonts included in the firmware.
        #
        # To use a different font, change "Noto%20Sans" in each Replace: string
        #   to another font name (14 characters max).
        # For example, change "Noto%20Sans" to "Trebuchet" to use a sideloaded Trebuchet font.
        # The 3-char string, %20, represents a single space in the font-family name.
        #
        # If your new font name is longer than 14 chars you would need to:
        #   - Use a font editor to shorten the internal font-family name to <= 14 chars
        #   - Rename the 4 font filenames to match the new shortened name
        #   - Copy the 4 renamed font files into the Kobo sideloaded fonts folder
      - FindReplaceString: {Find: "/normal/Rakuten%20Sans", Replace: "/normal/Noto%20Sans"}
      - FindReplaceString: {Find: "/bold/Rakuten%20Sans", Replace: "/bold/Noto%20Sans"}
      - FindReplaceString: {Find: "/italic/Rakuten%20Sans", Replace: "/italic/Noto%20Sans"}
      - FindReplaceString: {Find: "/bolditalic/Rakuten%20Sans", Replace: "/bolditalic/Noto%20Sans"}
jackie_w is offline   Reply With Quote