View Single Post
Old 04-06-2019, 01:04 AM   #22
codychan
Groupie
codychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud ofcodychan has much to be proud of
 
codychan's Avatar
 
Posts: 153
Karma: 27950
Join Date: Nov 2018
Device: Kobo Aura One, Kobo Forma
Quote:
Originally Posted by GeoffR View Post
I don't know if this will work, and even if it does then there might be side-effects for Japanese or Chinese language books, but if someone wants to try it and find out ...

Freedom to advanced fonts control, paste into libnickel.so.1.0.0.yaml:
Spoiler:
Code:
Freedom to advanced fonts control:
  - Enabled: no
  - Description: |
      This patch allows the advanced font options (weight/sharpness adjustments)
      to work with sideloaded fonts too. (KEPUB: OTF and TTF. EPUB: TTF only.)
      Beware unknown side-effects for Japanese or Chinese language books.
    #
    # The following passes a junk pointer to N3FontTypeUtil::setupDropdown, but it
    # seems the pointer is only passed on to ReadingSettings::getDefaultFontFamily
    # where the code is patched to avoid dereferencing it, so it should be safe.
    # BEWARE: What are the side-effects for Japanese / Chinese language books?
    #
    # N3FontTypeUtil.setupMonotypeDropdown(b,c)
    # --> N3FontTypeUtil.setupDropdown(UNDEFINED,b,c)
  - ReplaceBytes: {Offset: 0x8432E4, FindH: 59 46 50 46, ReplaceH: 5A 46 51 46}
  - ReplaceBLX: {Offset: 0x8432E8, Find: 0x4073B8, Replace: 0x41F440}
    # N3FontTypeController.setupAdvancedOption(...) --> NOP
  - ReplaceBytesNOP: {Offset: 0x9FB23A, FindBLX: 0x422810}
  - ReplaceBytesNOP: {Offset: 0x9FC1D0, FindBLX: 0x422810}
    # Ignore volume language (affects language number 25; ja? zh?)
  - ReplaceBytesNOP: {Offset: 0x65F7EA, FindBLX: 0x415B74}
  - ReplaceBytesNOP: {Offset: 0x65F7F0, FindBLX: 0x41D354}
  - ReplaceBytes: {Offset: 0x65F7F4, FindH: 06 46, ReplaceH: 00 26}
  - ReplaceBytesNOP: {Offset: 0x65F7F8, FindBLX: 0x40E5B4}
Installed v44 patches, and tried "Freedom to advanced fonts control" for a few Chinese books, so far so good.
codychan is offline   Reply With Quote