Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synched KePub padding adjustment for vertical layout #83

Open
keikhcheung opened this issue Jan 22, 2021 · 1 comment
Open

Synched KePub padding adjustment for vertical layout #83

keikhcheung opened this issue Jan 22, 2021 · 1 comment
Labels
new patch Type: Requests for new patches or additions to patches. patches Category: Relates to the patches.

Comments

@keikhcheung
Copy link

keikhcheung commented Jan 22, 2021

Hello,

Is there a possible way to add/modify the latest patch release 4.25.15875 to increase padding-bottom for vertical layout for synchronised KePub?
I am having a problem when reading synched KePubs with some side-loaded fonts where the bottom Chinese/Japanese/Korean character would get cut off. I would like to add some padding-bottom of 0.3em to it.

When using original publisher default font, things are fine.
publisher-default

When using side-loaded fonts, you can see the last characters on each line in the red rectangle are cut off.
side-loaded-font-1

side-loaded-font-2

I crawled up a bit the old Kobo patches here and found these lines. I thought they may be helpful so I tried adding them to libnickel.so.1.0.0.yaml of the kobopatch_4.25.15875. However, that doesn't work and I could not really figure out how to otherwise either…

The code I added to libnickel.so.1.0.0.yaml is:

Fix three KePub fullScreenReading bugs:
  - Enabled: yes
  - Description: See https://www.mobileread.com/forums/showpost.php?p=3113460&postcount=16
  - FindReplaceString:
      Find:    "img { display: block; margin-left: auto !important; margin-right: auto !important; width: auto !important; height: auto !important; }"
      Replace: "body { margin: 0 !important; padding: 0 !important; }  body>div { padding-left: 0.2em !important; padding-right:  0.3em !important; }"
      # CUSTOM SETTING: Changing padding-right from 0.2em to 0.3em.
      #
      MustMatchLength: yes
    # Optional replacement values below (all relate to the second problem above):
    # set the amount of added padding: `1` = 0.1em, `2` = 0.2em, etc.
    # 0.1em is enough for many fonts, but some (such as Georgia) need 0.2em.
  - ReplaceString: {Offset: 0x52, Find: "2", Replace: "2"}
  - ReplaceString: {Offset: 0x74, Find: "2", Replace: "3"}
    # CUSTOM SETTING: Changing to 3 for 0.3em for padding-bottom.
    #
    # The default patch settings are suitable for horizontal languages only.
    # Uncomment the following two replace_string lines for vertical languages only:
  - ReplaceString: {Offset: 0x4A, Find: "left:", Replace: "top:\x20"}
  - ReplaceString: {Offset: 0x6A, Find: "right: ", Replace: "bottom:"}

Would very much appreciate any information that can help solve this. Thanks in advance.

@pgaskin pgaskin added new patch Type: Requests for new patches or additions to patches. patches Category: Relates to the patches. labels Jan 23, 2021
@jackiew1
Copy link
Collaborator

@keikhcheung
I think patch Fix three KePub fullScreenReading bugs was removed from the standard pack a long time ago. I don't remember whether it was because it no longer worked or because Kobo had fixed something so it was no longer needed. @pgaskin might have a better memory than me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new patch Type: Requests for new patches or additions to patches. patches Category: Relates to the patches.
Projects
None yet
Development

No branches or pull requests

3 participants