Reply
Thread Tools
Posts: 144 | Thanked: 242 times | Joined on Nov 2007 @ Finland
#1
I have tried to find out how a new font can be installed into SailfishOS so that Qt/Qml app can use it without need to reboot device after font installation.

In my desktop linux (Ubuntu) I only have to copy font files to ~/.fonts or to system font directories and it it automatically recognized. E.g. font substitution works automatically. Sailfish does not recognize fonts from users .fonts directory but only from under /usr/share/fonts and only after reboot I have been able to get new font into use. Removal is immediate and visible in application using the font without any delay.

Is there some command that needs to be executed before new fonts are recognized?
 
Posts: 1,298 | Thanked: 2,277 times | Joined on May 2011
#2
Will restarting the lipstick read those fonts? It's still pretty drastic, but at least should be faster than a full reboot.
 
Posts: 144 | Thanked: 242 times | Joined on Nov 2007 @ Finland
#3
It does the job, but I can't initiate that from RPM post install script. Until finding some more sophisticated way to do this I'll have to instruct manual reboot.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#4
The problem is most definitely NOT lipstick. Lipstick doesn't load any fonts. In Wayland programs are supposed to load fonts. Same as in modern X11, with Qt/Gtk+/fontconfig.

I suspect this is a problem with mapplauncherd, it is probably scanning for fonts before the fork() and not doing it afterwards. So every application gets the font set applauncherd got.

Maybe you can use something like
http://qt-project.org/doc/qt-5.0/qtg...pplicationFont
in order to manually add the font in your program.
 
Posts: 539 | Thanked: 518 times | Joined on May 2010 @ nanaurbusiness
#5
How about good old
Code:
fc-cache -f -v
This should refresh the font cache on the fly.
__________________

N900 ~ $ make me a sandwich
-bash: no, make it yourself
N900 ~ $ sudo make me a sandwich
-bash: ok then...
 

The Following User Says Thank You to J4ZZ For This Useful Post:
Posts: 144 | Thanked: 242 times | Joined on Nov 2007 @ Finland
#6
This need for updating fonts is related to emoji keyboard I have created for Jolla. As "the app" it is just QML files for keyboard I am not sure about this font loading.

I have tested with fc-cache and actually I found only "fc-cache -r" to be only reliable solution to get font updated even when I reboot device. More mild option "fc-cache -f" didn't to do its job in some very minor font updates. I do not know why.
 
Reply

Tags
sailfish fonts

Thread Tools

 
Forum Jump


All times are GMT. The time now is 23:06.