View Single Post
Old 12-07-2018, 11:11 AM   #88
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 jcn363 View Post
Sorry, can't see what the problem is.
You can create a folder into kobopatch src (kobopatch_4.11.12019/src/delete_files) and there put the files with the content you need.
Perhaps something like:
Spoiler:
Code:
#!/bin/sh

rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Amasis*
# rm /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Avenir*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Caecilia*
# rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/georgia*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/GillSans*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KBJ*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KoboNickel*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Malabar*
rm usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/OpenDyslexic*

rm /etc/udev/rules.d/delete_fonts.rules
rm /root/delete_fonts.sh

Note I've commented Avenir and Georgia because they are system fonts. Perhaps you want to replace them with yours.
Then add the correspondant lines into files section of kobopatch.yaml:
Spoiler:
Code:
files:
  src/delete_files/delete_fonts.rules: etc/udev/rules.d/delete_fonts.rules
  src/delete_files/delete_fonts.sh: root/delete_fonts.sh


Good luck.
Thanks for your advice. I tried your method, and successfully deleted several fonts in kobo system-wide fonts directory(/usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/), and they are no longer in the drop-list of changing-font in reading page.

But when I tried to add fonts into kobo system-wide fonts directory, the fonts I added are not in the drop-list(BTW, the fonts I added are working fine when sideloaded into fonts directory), so I did a little trick, add the following line to the end of the shell script which removes the fonts to list all fonts in /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/ and print the list into `nickel home` directory:

ls usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/* > /mnt/onboard/fonts-list

So I check the list in fonts-list when I connect my Kobo to PC. And the fonts I added are exactly all in the list(as expected, the fonts I deleted are not in the list). It means I did add them into usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/ but Kobo cannot recognize them when I want to change fonts when I'm reading. Why is that?

And I notice another thing, when I extract the kobo firmware zip file and try to open *ANY* font in the kobo-update-4.11.12019\KoboRoot\usr\local\Trolltech\QtEmbedded-4.6.2-arm\lib\fonts, it failed to open it.

Double left-clicking it in Windows10, it says

"The requested file xxx is not a valid font file."

And I tried to open it using FontForge, it failed to open it too, it says:

"xxx is not a known format (or uses features of that format fontforge does not support, or is so badly corrupted as to be unreadable)."

That is so weird.

Last edited by codychan; 12-07-2018 at 11:40 AM.
codychan is offline   Reply With Quote