View Single Post
Old 04-30-2022, 03:09 PM   #31
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,324
Karma: 16800000
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by MGlitch View Post
I’d really appreciate it if it became a patch. Easier to manage from a user perspective, and no need to reimport books.
It should be possible with the caveat that it will be in the libnickel.so.1.0.0.yaml file within PatchGroup: KePub stylesheet additions alternatives. This means that in fw 4.32.19501 you would only be able to enable one of these:
  1. KePub stylesheet additions - text justify
  2. KePub stylesheet additions - optimizeSpeed
  3. KePub stylesheet additions - optimizeLegibility
  4. KePub stylesheet additions - word-spacing

Since I'm currently planning to retire patches 2 & 3 at the next fw upgrade you'd be choosing between 1 & 4 in future.

P.S. In case you haven't already noticed, I added a couple of screenshots to my earlier post to show the effect of setting word-spacing: -0.05em in a kepub.

Here's a beta for the proposed new patch. It should work in fw 4.32.19501 (with the above caveat). Just copy it into your existing libnickel.so.1.0.0.yaml file and enable it in the normal way.
Spoiler:
Code:
KePub stylesheet additions - word-spacing:
  - Enabled: no
  - PatchGroup: KePub stylesheet additions alternatives
  - Description: Reduces the space between words in KePubs.
  - FindBaseAddressString: ".KBSearchResult, .KBAnnotation, .KBHighlighting {"
  # *** Don't change anything in the 4 ReplaceString lines below ***
  - ReplaceString: {Find: ".KBSearchResult, .KBAnnotation, .KBHighlighting { font-size: 100% !important; -webkit-text-combine: inherit !important; }\n", Replace: ".KBSearchResult,.KBAnnotation,.KBHighlighting{font-size:100%!important;-webkit-text-combine:inherit!important}.KBAnnotatio", MustMatchLength: yes}
  - ReplaceString: {Offset: 122, Find: ".KBAnnotation[writingMode=\"horizontal-tb\"] { border-bottom: 2px solid black !important; }\n", Replace: "n[writingMode=\"horizontal-tb\"]{border-bottom:2px solid #000!important}.KBAnnotation[writin", MustMatchLength: yes}
  - ReplaceString: {Offset: 212, Find: ".KBAnnotation[writingMode=\"vertical-rl\"] { border-right: 2px solid black !important; }\n", Replace: "gMode=\"vertical-rl\"]{border-right:2px solid #000!important}.KBAnnotation[writingMode=\"v", MustMatchLength: yes}
  - ReplaceString: {Offset: 299, Find: ".KBAnnotation[writingMode=\"vertical-lr\"] { border-left: 2px solid black !important; }", Replace: "ertical-lr\"]{border-left:2px solid #000!important}/*********************************/", MustMatchLength: yes}
  # *** Don't change anything in the 4 ReplaceString lines above ***
  #
  # Customise the -0.05 value if you prefer.
  # N.B. Be careful, if it's too big some words may get joined together.
  - FindReplaceString: {Find: "/*********************************/", Replace: "body{word-spacing:-0.05em         }", MustMatchLength: yes}

Do let me know if you spot any unpleasant side-effects!

Last edited by jackie_w; 04-30-2022 at 03:42 PM. Reason: Added beta kobopatch for kepub word-spacing
jackie_w is offline   Reply With Quote