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 12-07-2018, 11:15 AM   #1
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: 159
Karma: 27950
Join Date: Nov 2018
Device: Kobo Aura One, Kobo Forma
Kobo system cannot recognize fonts added into system-wide fonts directory?

From Another thread:

https://www.mobileread.com/forums/sh...1&postcount=88

if you are really curious why I want to add fonts into system-wide directory why not just sideload those fonts, please check the context of that thread.

Using patch system, I 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), 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:44 AM.
codychan is offline   Reply With Quote
Old 12-07-2018, 01:45 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@codychan: That's perfectly normal: the system fonts are encrypted and/or obfuscated.
NiLuJe is offline   Reply With Quote
Advert
Old 12-07-2018, 03:33 PM   #3
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
Nickel probably uses a defined list of fonts at buildtime and register them with http://doc.qt.io/archives/qt-4.8/qfo...pplicationFont. For sideload content they scan a given directory with http://doc.qt.io/archives/qt-4.8/qdiriterator.html and try to load as many (valid) ttf/otf fonts as present in that folder.

So adding new fonts to the same folder won't work as expected.
pazos is offline   Reply With Quote
Old 12-08-2018, 02:04 AM   #4
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: 159
Karma: 27950
Join Date: Nov 2018
Device: Kobo Aura One, Kobo Forma
Quote:
Originally Posted by pazos View Post
Nickel probably uses a defined list of fonts at buildtime and register them with http://doc.qt.io/archives/qt-4.8/qfo...pplicationFont. For sideload content they scan a given directory with http://doc.qt.io/archives/qt-4.8/qdiriterator.html and try to load as many (valid) ttf/otf fonts as present in that folder.

So adding new fonts to the same folder won't work as expected.
I guess I couldn't do anything about it then.
codychan is offline   Reply With Quote
Old 12-08-2018, 02:54 AM   #5
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Sidenote: current FW have moved to Qt 5.2 (or so, the relevant part is Qt5 here ;p), but this should still hold true, even if in spirit only .
NiLuJe is offline   Reply With Quote
Advert
Old 12-08-2018, 03:33 AM   #6
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: 159
Karma: 27950
Join Date: Nov 2018
Device: Kobo Aura One, Kobo Forma
Quote:
Originally Posted by NiLuJe View Post
@codychan: That's perfectly normal: the system fonts are encrypted and/or obfuscated.
Hi, do you know what fonts in the system-wide fonts directory can be deleted safely, the whole fonts list is:

Code:
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Amasis*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Avenir*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Caecilia*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/georgia*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/GillSans*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KBJ*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KoboNickel*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Malabar*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/OpenDyslexic*
@jcn363 said in other thread that the georgia* and Avenir* are system fonts and do not remove them, but it seems kobo system are not using them as system fonts. Anyway, I just want to know what fonts can be deleted safely so the kobo system won't be affected.
codychan is offline   Reply With Quote
Old 12-08-2018, 06:59 AM   #7
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by pazos View Post
Nickel probably uses a defined list of fonts at buildtime and register them with http://doc.qt.io/archives/qt-4.8/qfo...pplicationFont. For sideload content they scan a given directory with http://doc.qt.io/archives/qt-4.8/qdiriterator.html and try to load as many (valid) ttf/otf fonts as present in that folder.

So adding new fonts to the same folder won't work as expected.
Quote:
Originally Posted by NiLuJe View Post
Sidenote: current FW have moved to Qt 5.2 (or so, the relevant part is Qt5 here ;p), but this should still hold true, even if in spirit only .
Then, the process should be: make a fake program with Qt5.2 and desired fonts inside, take the hard coded fonts, rename with kobo's one name and exchange.
Isn't it?
Good luck.
jcn363 is offline   Reply With Quote
Old 12-08-2018, 01:44 PM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@codychan: No idea, no.

@jcn363: Err, what?
NiLuJe is offline   Reply With Quote
Old 12-08-2018, 04:02 PM   #9
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by NiLuJe View Post
@jcn363: Err, what?

If i understood correctly, to be able to exchange a system font, first we must have a hardcoded one in the same way and this is made by Qt (5.2) at compile time.
Good luck.
jcn363 is offline   Reply With Quote
Old 12-08-2018, 04:32 PM   #10
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I think the obfuscation is Kobo-specific, not Qt-specific .
NiLuJe is offline   Reply With Quote
Old 12-08-2018, 04:47 PM   #11
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by codychan View Post
Hi, do you know what fonts in the system-wide fonts directory can be deleted safely, the whole fonts list is:

Code:
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Amasis*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Avenir*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Caecilia*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/georgia*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/GillSans*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KBJ*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/KoboNickel*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Malabar*
usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/OpenDyslexic*
@jcn363 said in other thread that the georgia* and Avenir* are system fonts and do not remove them, but it seems kobo system are not using them as system fonts. Anyway, I just want to know what fonts can be deleted safely so the kobo system won't be affected.
According to this post, it is sufficient when you keep KBJ-TsukuMinPr6N-RB.ttf. Be aware that this information is not necessarily valid for the more recent firmwares.
When you put your device to sleep, as most people seem to do, instead of powering it off, you only have to open a book once, and the GUI will use your custom fonts from that point onwards (until you power the device off).
tshering is offline   Reply With Quote
Old 12-08-2018, 05:35 PM   #12
jcn363
absolute beginner
jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.jcn363 ought to be getting tired of karma fortunes by now.
 
jcn363's Avatar
 
Posts: 323
Karma: 1750999
Join Date: May 2017
Location: Go with the wind (43°19'17.7"N 2°00'19.4"W)
Device: ka1
Quote:
Originally Posted by tshering View Post
According to this post, it is sufficient when you keep KBJ-TsukuMinPr6N-RB.ttf. Be aware that this information is not necessarily valid for the more recent firmwares.
When you put your device to sleep, as most people seem to do, instead of powering it off, you only have to open a book once, and the GUI will use your custom fonts from that point onwards (until you power the device off).
I can confirm that's true for last version (4.11.12019) too.

Good luck.
jcn363 is offline   Reply With Quote
Reply

Tags
font, kobo, patch


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW3 System fonts Ruskie_it Kindle Developer's Corner 14 11-05-2016 06:29 PM
PRS-T1 replacing system default fonts ousia Sony Reader Dev Corner 0 11-06-2012 04:10 PM
How to add alternate fonts without replacing system fonts.(this time this is a guide) techiemonkey Kindle Developer's Corner 17 09-12-2012 04:55 PM
PRS-T1 T1 original system can use customized fonts bigpizza Sony Reader 34 12-30-2011 05:58 PM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 03:54 PM


All times are GMT -4. The time now is 06:07 PM.


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