View Single Post
Old 03-14-2020, 02:23 PM   #13
droopy
Evangelist
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 439
Karma: 800008
Join Date: Apr 2009
Device: Kobo Forma
On the "Dictionary text font-family/font-size/line-height" patch by jackie_w

I like patching the firmware. But my ability is just changing 'no' to 'yes.
I want to use jackie_w's dictiionary patch. I want to decrease line height and font size. (I'm okay for now with font family). What exactly do i change?

For example, i see
Code:
  # Un-comment and edit next line to change font-size
  #- ReplaceString: {Offset: 15, Find: "%1px", Replace: "32px", MustMatchLength: yes}
I know how to "uncomment" (remove the # symbol). But what edits must i make? Do i change the number 15? or just 32px to, say "20px"?

Also, for
Code:
  # Un-comment and edit next line to change line spacing
  #- ReplaceString: {Offset: 34, Find: "1.40em", Replace: "1.30em", MustMatchLength: yes}
What must i change? Do I keep the 34 offset as is? Or should I change the number 34 to some other number? Should I change 1.30em to some smaller number, or is 1.30em already a smaller number relative to the 1.40em?

Thanks.


Code:
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}
droopy is offline   Reply With Quote