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 03-17-2014, 06:29 PM   #1
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
Question Fonts "update" on boot

Hi all,

Apologies in advance if this has been raised before, I couldn't find anything on google.

I'm currently running 3.2.0 with this patch. My intention is to modify the font face used in the dictionary so it can display Vietnamese correctly. I'm partially successful but the solution is not as "clean" as I would like.

I was able to change the dictionary font to a Vietnamese-compatible Unicode font (Kobo Nickel for example). The problem is upon reboot, if I go straight to the dictionary (Extras > Dictionary) or look-up a word from a book, the font used in the dictionary appears to be Georgia still.

The only way for the dictionary to display Kobo Nickel correctly is to open a book, go to font-properties menu/popup [Aa] first. After that, Kobo Nickel would be used in the dictionary. This opening of the font-properties menu appears to "load" the font cache to make the fonts available to nickel. From my tests, this is true to both built-in fonts as well as external ones.

I'm investigating ways to automate this loading/refreshing of the font cache upon boot but don't know where to start. Any input is much appreciated.

zecoj is offline   Reply With Quote
Old 03-18-2014, 08:16 AM   #2
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 zecoj View Post
The problem is upon reboot, if I go straight to the dictionary (Extras > Dictionary) or look-up a word from a book, the font used in the dictionary appears to be Georgia still.

The only way for the dict
I could not try the first way. Do you go there from the home screen? I cannot see the option Extras > Dictionary. As for the second way, if I power on, open a book and select a word, the dictionary entry is shown in Gothic (that is the option I use in my patched version).
I had once a similar experience with having to open the font menu or a book which had a certain font already assigned to it, in order to get this font working. I had two fonts with the same name installed, one was Gothic for Japanese, and the other Gothic for Chinese; one was located on the system partition, the other on the user partition. After booting (user language was Japanese) all the menus were displayed in one Gothic font, after opening a book with assigned Gothic font, the menus changed to the other Gothic font. I know it is not directly related to the dictionaries, but maybe it triggers some ideas.
tshering is offline   Reply With Quote
Advert
Old 03-18-2014, 05:12 PM   #3
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
tshering,

Thanks for your reply.

Quote:
Originally Posted by tshering View Post
I could not try the first way. Do you go there from the home screen? I cannot see the option Extras > Dictionary.
Which firmware version are you running? My 3.2.0 shows "Library | Bookstore | Extras" on the bottom of the home screen. Perhaps it's a bit different with JP locale.

Quote:
As for the second way, if I power on, open a book and select a word, the dictionary entry is shown in Gothic (that is the option I use in my patched version).
Is this with the interface already using Gothic? You mentioned your locale is JP so I'm guessing the interface won't be using Georgia?
zecoj is offline   Reply With Quote
Old 03-18-2014, 06:04 PM   #4
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 zecoj View Post
tshering,

Thanks for your reply.


Which firmware version are you running? My 3.2.0 shows "Library | Bookstore | Extras" on the bottom of the home screen. Perhaps it's a bit different with JP locale.


Is this with the interface already using Gothic? You mentioned your locale is JP so I'm guessing the interface won't be using Georgia?
I am running 3.2.0. Under Extras, I see only "Reading Stats" and "Awards." Maybe this is because I have a Kobo Touch. Or are there some settings in the configuration file?
I switched to JP only for test purposes at that time. Usually (and now) I use EN_GB. As for the font used by the interface, I am not sure. Some screens, for instance, "Settings" use a font with serifs, others, for instance "Accounts", use a font without serifs. I think it is Avenir and Giorgia.

Last edited by tshering; 03-18-2014 at 06:16 PM.
tshering is offline   Reply With Quote
Old 03-18-2014, 08:41 PM   #5
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
That's interesting, must be a difference between the Glo and the Touch. On my Glo, the interface uses Georgia consistently throughout the menus.
zecoj is offline   Reply With Quote
Advert
Old 03-19-2014, 05:08 AM   #6
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
Another idea would be to use strace. You can find instructions and a link to the executable in this thread. The strace log will show you at which point nickel opens (and tries to open) a certain font file. However, I don't know exactly whether and how these information can help you solve your problem.
In this case I would not follow the instructions, but start strace from the rcS, in order to see also the start up process.
I would be something like
Code:
logfile=/mnt/onboard/.kobo/log_nickel_strace.txt
/mnt/onboard/.kobo/strace -o $logfile /usr/local/Kobo/nickel -qws -skipFontLoad
Modify the paths accordingly.
Generally, I would recommend using the Kobo Start Menu for this kind of job, but it is having problems with FW 3.2.0.

Last edited by tshering; 03-19-2014 at 05:23 AM.
tshering is offline   Reply With Quote
Old 03-19-2014, 08:47 AM   #7
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
tshering,

Thanks for the instructions. I was able to produce the strace log and found out that there are only 3 fonts got loaded from boot: Avenir, Georgia, and Gothic. All other fonts are loaded when the [Aa] menu is activated. This must be why you can see Gothic used in the dictionary straight away, without intervening.

If only the stock fonts are not obfuscated, I can simply rename and replace one of them.

Thanks for the help so far. Will continue to investigate.
zecoj is offline   Reply With Quote
Old 03-19-2014, 10:35 AM   #8
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
I just tested this with some funny font, and see the same result as you. Apart from renaming a font, I see two other easy workarounds.
1) Don't power off. I think a lot of users almost never power off.
2) Use kepub.epub instead of epub. Once you assign your font to a kepub.epub, the font is loaded as soon as you open this book (and available to the dictionary). This should be sufficient for in-book-dictionary-look-ups.
tshering is offline   Reply With Quote
Old 03-20-2014, 04:29 AM   #9
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
tshering,

Apparently if the USB port is connected, mounted, and then ejected, the fonts will be updated as well. When these things happen, libnickel call "ACTION=add /usr/local/Kobo/udev/usb" and "ACTION=remove /usr/local/Kobo/udev/usb".
I'm looking into calling "/usr/local/Kobo/udev/usb" after boot somehow to simulate these events, however am unsure of whether libnickel will respond to this.
zecoj is offline   Reply With Quote
Old 03-20-2014, 04:41 AM   #10
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
There were some attempts to simulate an usb connection. This one is working

Code:
echo usb plug add >> /tmp/nickel-hardware-status
sleep 5
echo usb plug remove >> /tmp/nickel-hardware-status
Unfortunately, it needs user interaction. One has to answer the "do you want to connect" popup.
tshering is offline   Reply With Quote
Old 03-20-2014, 05:32 PM   #11
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
Thanks tshering, it looks as though a clean solution is unachievable at this stage...
zecoj is offline   Reply With Quote
Old 03-20-2014, 05:54 PM   #12
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
What about your idea of renaming your font to Giorgia and replacing the original? Does it really matter that your font is not obfuscated?
tshering is offline   Reply With Quote
Old 03-20-2014, 08:33 PM   #13
zecoj
Member
zecoj began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2014
Device: Kobo Aura HD
I think it does, I've tried renaming Gentium Book Basic (and a few others) to Georgia but that didn't work. The internal fonts has to be obfuscated I believe.
zecoj is offline   Reply With Quote
Old 03-21-2014, 08:00 AM   #14
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 zecoj View Post
I think it does, ... The internal fonts has to be obfuscated I believe.
You are right!
tshering is offline   Reply With Quote
Old 03-16-2015, 02:57 AM   #15
tatung2112
Junior Member
tatung2112 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Mar 2015
Device: Kobo Glo
@zecoj: not sure if you are reading this thread but could you please tell me how to change the font of dictionary in Kobo Glo? My firmware is 3.3.0. Thank you!
tatung2112 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Odyssey Stuck as "Connected..." on boot after update noteventime Bookeen 3 12-27-2012 10:34 PM
PRS-T1 Help!T1 can't boot.Stop in"opening book"screen. networm Sony Reader Dev Corner 3 05-09-2012 03:58 PM
Slow boot time "solution" nbfsinger enTourage Archive 3 03-06-2011 09:25 AM
Firmware Update No "Update your Kindle" option in "Settings" shimoncellos Amazon Kindle 4 05-26-2010 05:37 PM
Custom boot logo, "freezing" the screen guylhem Sony Reader Dev Corner 1 11-09-2008 11:45 AM


All times are GMT -4. The time now is 03:26 AM.


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