View Single Post
Old 09-03-2022, 06:57 PM   #44
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,998
Karma: 147448039
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 Tex2002ans View Post
Could you point me to those patches?

I was trying to find those a few weeks ago, but couldn't. And there was just so much info to dig through... heh.
The patch you want is in libnickel.so.1.0.0.yaml. Given that I check the CSS, I decided to use method 3 so I can let the CSS make more font decisions as needed.

Code:
Un-Force user font-family in KePubs:
  - Enabled: no
  - 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
JSWolf is offline   Reply With Quote