Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2020, 01:14 PM   #1
fer1803
Enthusiast
fer1803 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Feb 2012
Device: none
Patch Un-Force user font-family in KePubs

Three alternatives appear in this patch. As it appears in the file, "Alternatives 1-3 give increasing preference to the publisher-selected fonts." Well, what should I do to apply each of these alternatives? do I have to change something in the file? thank you in advance
fer1803 is offline   Reply With Quote
Old 02-25-2020, 12:43 PM   #2
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,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by fer1803 View Post
Three alternatives appear in this patch. As it appears in the file, "Alternatives 1-3 give increasing preference to the publisher-selected fonts." Well, what should I do to apply each of these alternatives? do I have to change something in the file? thank you in advance
Option 1 is enabled as the default. If you wanted to enable option 2 instead you would need to:
  • un-comment each line in option 2's ReplaceString, by removing the hash (#) character at the beginning of each line.
  • comment out each line of option 1's ReplaceString by adding a hash at the beginning of each line.
  • Also make sure you keep the correct indentation of each of option 2's lines.
i.e.
Code:
    # 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
ETA: I don't think the red line is necessary.

Last edited by jackie_w; 02-25-2020 at 12:47 PM. Reason: ETA
jackie_w is offline   Reply With Quote
Advert
Old 02-25-2020, 01:16 PM   #3
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,804
Karma: 7025947
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by jackie_w View Post
ETA: I don't think the red line is necessary.
That's correct. The default values for optional parameters are "", 0, null, and false depending on the type.
geek1011 is offline   Reply With Quote
Old 02-25-2020, 03:59 PM   #4
fer1803
Enthusiast
fer1803 began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Feb 2012
Device: none
Thank you
fer1803 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forma how can I force Calibre to use geek1011's kepubify to convert books to kepubs? droopy Kobo Developer's Corner 32 09-19-2019 11:13 PM
Is there a patch to display epub covers the same as kepubs on the home screen/shelf? dibster Kobo Reader 3 06-21-2019 10:30 PM
Side-loaded Font Weight Patch dzhmartin Kobo Developer's Corner 3 03-02-2019 02:01 AM
Different font sizes in KePubs Derf Kobo Reader 12 08-15-2018 11:55 AM
[Kobo Glo] kepubs and series (or: some kepubs invisible for Calibre) beedaddy Devices 3 01-14-2013 02:05 AM


All times are GMT -4. The time now is 04:25 PM.


MobileRead.com is a privately owned, operated and funded community.