Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2020, 07:10 PM   #1
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
Question Help with dictionary font size in latest patch

I recently upgraded to the latest firmware and need a little help with editing the patch. The extent of my knowledge/experience is "enabled: yes/no." I am attempting to change the font size in the dictionary patch (thank you, jackie_w) but am getting the following:

files: src/libnickel.so.1.0.0.yaml
reading entry contents
loading patch file 'src/libnickel.so.1.0.0.yaml' (detected format kobopatch)
| parsing patch file: unmarshaling to map[string]yaml.Node
--> could not parse patch file: yaml: line 1282: did not find expected '-' indicator


I'm not exactly sure what the "expected '-' indicator" is and where it should be placed. With the exception of my un-commenting, the line (1282) below is unedited:

# Un-comment and edit next line to change font-size
- ReplaceString: {Offset: 15, Find: "%1px", Replace: "32px", MustMatchLength: yes}

Any assistance would be greatly appreciated. Thank you.




Skydog is offline   Reply With Quote
Old 05-18-2020, 08:46 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,245
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
I'm not sure without seeing the whole patch, but the un-commented line 1283
Code:
  - ReplaceString: {Offset: 15, Find: "%1px", Replace: "32px", MustMatchLength: yes}
should be indented with 2 spaces before the first hyphen.

If that's what you already have and it's still not working then please post the whole contents of your version of patch Dictionary text font-family/font-size/line-height. Wrap it in CODE tags so that the forum monospace font will display spaces more easily. It's quite a long patch so you'd better wrap it in SPOILER tags, too.
jackie_w is offline   Reply With Quote
Advert
Old 05-18-2020, 09:17 PM   #3
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
@jackie_w-

I hope this is what you need:

Spoiler:
Code:
# The following patch(es) were made by jackie_w

Dictionary text font-family/font-size/line-height:
  - Enabled: yes
  - Description: |
      This patch allows you to to customise the appearance of the text 
      in the pop-up and full-screen dictionary widgets.
      4.17.13651: improved to also reduce the blank lines displayed in many 
                  sideloaded custom dictionaries which contain <blockquote>.
      .
      See https://www.mobileread.com/forums/showpost.php?p=3521137&postcount=48
      for screenshots
      .
      You can change one or more of the following properties:
      - font-family
      - font-size
      - line-height
      .
      These are the Kobo defaults
                Glo - Georgia  23px  1.4em
                H2O - Georgia  29px  1.4em
              GloHD - Georgia  32px  1.4em
            AuraONE - Georgia  42px  1.4em
  #
  # Stage 1: Change DictionaryView to remove %variables
  # from:
  #    * { font: %1px %2; line-height: 1.4em; }
  #    div.descriptionFont { font-family: %3; }
  #    ol { font-size: %1px; font-weight: bold; margin-left: %4em; margin-top: 0px; }
  #    ol p { font-size: %1px; font-weight:normal; }
  # to:
  #    * { font-size: %1px; line-height: 1.40em;font-family: Georgia                       ;}
  #    ol {margin-left:1em; margin-top:0}
  #    blockquote {margin:0.3em 0 0.3em 1em} blockquote>blockquote {margin:-0.3em 0 0 2em}
  #
  # ##### N.B. Do not change the next 4 lines #####
  - FindReplaceString:
      Find:    "* { font: %1px %2; line-height: 1.4em; }\ndiv.descriptionFont { font-family: %3; }\nol { font-size: %1px; font-weight: bold; margin-left: %4em; margin-top: 0px; }\nol p { font-size: %1px; font-weight:normal; }\n"
      Replace: "* { font-size: %1px; line-height: 1.40em;font-family: Georgia                       ;}\n\nol {margin-left:1em; margin-top:0}\nblockquote {margin:0.3em 0 0.3em 1em} blockquote>blockquote {margin:-0.3em 0 0 2em}\n"
      MustMatchLength: yes
  # ##### N.B. Do not change anything above this line #####
  #
  # Stage 2: N.B. You MUST keep old and new strings EXACTLY the same length
  #
  # Notes for changing font-family:
  #   1.  Pad the shorter of the old/new strings with spaces to 
  #       keep same length for both strings (see examples below)
  #
  #   2.  If the new font-family name (max. 29 chars) contains any spaces it 
  #       should be wrapped in 'single quotes' (see examples 2, 3)
  #
  #   3.  To change from Georgia to the Kobo default sans-serif font, Avenir, 
  #       use either one of the following to achieve the same result:
  #       - sans-serif
  #       - 'Avenir Next Medium'
  # 
  # Un-comment ONE ONLY of the following ReplaceString examples 
  #   to change dictionary font-family from default Georgia:
  #     - to a different built-in font
  #     - to one of your sideloaded custom fonts
  #
  #- ReplaceString: {Offset: 54, Find: "Georgia   ", Replace: "sans-serif", MustMatchLength: yes}
  #- ReplaceString: {Offset: 54, Find: "Georgia    ", Replace: "'Gill Sans'", MustMatchLength: yes}
  #- ReplaceString: {Offset: 54, Find: "Georgia      ", Replace: "'Kobo Nickel'", MustMatchLength: yes}
  #- ReplaceString: {Offset: 54, Find: "Georgia ", Replace: "Bookerly", MustMatchLength: yes}
  #
  # Un-comment and edit next line to change font-size
   - ReplaceString: {Offset: 15, Find: "%1px", Replace: "32px", MustMatchLength: yes}
  #
  # Un-comment and edit next line to change line spacing
  #- ReplaceString: {Offset: 34, Find: "1.40em", Replace: "1.30em", MustMatchLength: yes}

Custom navigation menu page number text:
  - Enabled: no
  - Description: Changes the page number text format in the reading navigation menu
  - FindReplaceString: {Find: "Page %1 of %2", Replace: "%1 / %2"}


Note: I have not altered anything other than "enabled:yes"

Thank you,
Patricia
Skydog is offline   Reply With Quote
Old 05-18-2020, 10:15 PM   #4
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,245
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Skydog View Post
@jackie_w-

I hope this is what you need:

Note: I have not altered anything other than "enabled:yes"
Yes, as suspected, it's an indentation error. You've got one too many leading spaces. The first character hyphen (before ReplaceString) should be directly under the # of the commented line above it.
jackie_w is offline   Reply With Quote
Old 05-18-2020, 10:31 PM   #5
Skydog
Wizard
Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.Skydog ought to be getting tired of karma fortunes by now.
 
Skydog's Avatar
 
Posts: 2,286
Karma: 7409537
Join Date: Mar 2009
Location: Circling Earth @ Mach .83
Device: Elipsa 2E, Sage, Libra Colour, Libra 2, Clara 2E, Oasis3, Voyage
Quote:
Originally Posted by jackie_w View Post
Yes, as suspected, it's an indentation error. You've got one too many leading spaces. The first character hyphen (before ReplaceString) should be directly under the # of the commented line above it.
I never would have figured that out! Now, the desired font size is to be entered in "Replace: "XXpx"??

Update: Success!

Many thanks for your assistance,

Patricia

Last edited by Skydog; 05-18-2020 at 10:42 PM.
Skydog is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch STR dictionary font size Gardenman Barnes & Noble NOOK 3 10-11-2011 10:07 AM
360 Plus Coolreader Dictionary font size Notrite PocketBook 0 08-13-2011 07:59 PM
PRS-350 Dictionary and font size issue? amujee Sony Reader 13 02-19-2011 10:48 PM
Font size of dictionary dilepton PocketBook 1 12-27-2009 03:13 AM
Small font size with epub in latest software. timt1961 HanLin eBook 7 09-21-2009 06:55 AM


All times are GMT -4. The time now is 01:59 PM.


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