View Single Post
Old 10-03-2019, 07:41 AM   #43
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,808
Karma: 7423683
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by JSWolf View Post
To fix the two patches for adjust the font scale so ePub and kepub are the same heres what to do...

1. Set ePub uniform font scale: to yes
2. Set Set font scale factor: to yes
3. In Set font scale factor: set the two replace values to 4.
Code:
Set font scale factor:
  - Enabled: yes
  - Description: |
      This patch sets the font scale factor for ePub and KePub readers.
      See also `ePub uniform font scale` and `Custom font sizes` patches.
  # Font scale factor is calculated as (font size slider) / (X+32)
  # Original value X=14, so original scale factor is (font size slider) / 46.
  # Allowed replacement values for X: 0-15 (smaller X --> larger scale factor)
  - ReplaceInt: {Offset: 0x52767A, Find: 14, Replace: 4} # ePub
  - ReplaceInt: {Offset: 0xAE037C, Find: 14, Replace: 4} # KePub
A value of 4 keeps the scale matching what's used with ePub. So that will improve kepub as well and it will allow kepub to have some larger font sizes should that be needed.

@Geek1011, can you please change the scale values from 8 to 4? Thanks.
Thanks for testing! Can you send me the kepub and epub books used for testing so I can ensure they are proper? If so, I'll update the values. The thing is, some epubs modify the base font size, which messes up the whole font scaling thing.

P.S. I was just thinking about the long feedback loop when testing libnickel patches, so I've decided to look at options for speeding the process up. I might try (after I take a break) something with live-patching the binary using ptrace (something like https://github.com/darx0r/poke), but I haven't ever tried this sort of thing before, so I don't know how feasible it'll be. It partly depends on how much funny stuff Qt does and how new the kernel is. Note that this won't work for CSS patches, although I've been doing some experiments with that recently. No guarantees this will work, though. This paper looks interesting: https://www.kernel.org/doc/ols/2008/...es-245-254.pdf.

Last edited by geek1011; 10-03-2019 at 07:55 AM.
geek1011 is offline   Reply With Quote