View Single Post
Old 04-30-2022, 11:20 AM   #67
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,257
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by toancv View Post
Can I replace the Library dictionary display fonts (George/Anenir fonts) with Kobo Nickel font? If yes, how to?
As far as I can tell 'Kobo Nickel' is one of the built-in fonts which is no longer accessible via kobopatches.

In addition, built-in fonts are encrypted (or obfuscated???) so none of the existing "font tricks" will work because you can't use a font editor with them in their locked state.

Quote:
Originally Posted by toancv View Post
Kobo nickel font is the only built-in font can display the language I need.
You haven't said which language. Did you try any/all of the suggestions I made to @codychan earlier in this thread for patch Dictionary text font-family/font-size/line-height:
Code:
  - ReplaceString: {Offset: 54, Find: "Georgia   ", Replace: "sans-serif",             MustMatchLength: yes}
  - ReplaceString: {Offset: 54, Find: "Georgia               ", Replace: "'KBJ-TsukuMin Pr6N RB'", MustMatchLength: yes}
  - ReplaceString: {Offset: 54, Find: "Georgia              ", Replace: "'KBJ-UDKakugo Pr6N M'",  MustMatchLength: yes}
  - ReplaceString: {Offset: 54, Find: "Georgia         ", Replace: "'AR UDJingxihei'",       MustMatchLength: yes}
@codychan said the last one worked for his/her sideloaded CJK dictionaries (but it didn't help with any of my English custom dictionaries).

If none of the above work for your language, the only solution I can think of is to use the files: feature of kobopatch to replace one of the built-in fonts with a font of your choosing. This is not particularly difficult but to "fool" the Kobo into thinking your new font is its old built-in font you need to be able to use a font editor (e.g. FontCreator, FontForge, TTFEdit).

The outline of the process is as follows. Step 2 is essential so if you don't feel you can do this the rest becomes irrelevant.:
  1. Choose the font you want to use for the dictionary.
  2. Use your font editor to edit the *internal* fontname of your chosen font files (could be 1 or 4 ttf files) to match exactly the built-in fontname you're planning to replace.
  3. Decide which built-in font your chosen font is going to overwrite. Probably requires more explanation but I'll leave it for now.
  4. Edit your patch Dictionary text font-family/font-size/line-height (in libnickel.so.1.0.0.yaml) to customise font-family. Depends on what you chose in the previous step.
  5. Copy your renamed font files (from step 2) to a subdirectory somewhere under kobopatch's /src subdirectory on your PC.
  6. Edit the files: section at the bottom of your kobopatch.yaml file to copy your chosen font files to kobopatch's output KoboRoot.tgz in the correct place so that they will overwrite the default font files.
  7. Run kobopatch as you normally would and install the output KoboRoot.tgz file.
jackie_w is offline   Reply With Quote