How do I install additional fonts?
There's free (as in freedom) fonts available for Linux which govern most languages etc. How do I install some of these on my Jolla?
We have moved to a new Sailfish OS Forum. Please start new discussions there.
There's free (as in freedom) fonts available for Linux which govern most languages etc. How do I install some of these on my Jolla?
Create a subdirectory for your font files under /usr/share/fonts and copy your ttf files into there (as root). You also can directly copy your font files at /usr/share/fonts too. Reboot to confirm whether fonts are working.
Using the font as UI default one seems tricky: default native UI font is Sail Sans Pro, Roboto Light and WenQuanYi Zen Hei is used for missing characters. There is a file /etc/fonts/local.conf for this setting:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Sail Sans Pro Light</family>
<prefer>
<family>Roboto Light</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
<default><family>Sail Sans Pro Light</family></default>
</alias>
<alias>
<family>Sail Sans Pro ExtraLight</family>
<prefer>
<family>Roboto Thin</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
<default><family>Sail Sans Pro ExtraLight</family></default>
</alias>
</fontconfig>
So, after installing a new font you can edit this file to include your installed font. For example like this:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Sail Sans Pro Light</family>
<prefer>
<family>YourNewFont</family> <!-- added -->
<family>Roboto Light</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
<default><family>Sail Sans Pro Light</family></default>
</alias>
<alias>
<family>Sail Sans Pro ExtraLight</family>
<prefer>
<family>YourNewFont</family> <!-- added -->
<family>Roboto Thin</family>
<family>WenQuanYi Zen Hei</family>
</prefer>
<default><family>Sail Sans Pro ExtraLight</family></default>
</alias>
</fontconfig>
The order of each family will be used to looking up missing characters. In this case, missing characters of Sail Sans Pro will be looked up in order of YourNewFont, Roboto Thin, WenQuanYi Zen Hei. I liked default latin alphabet font Sail Sans Pro so I didn't tried to change fonts for latin alphabets.
FYI, Sail Sans Pro only contains latin alphabets and some extra characters, Cyrillic characters are probably coming from the Roboto fonts. Android apps seems to use Droid and Roboto series fonts independently from native apps, though. Default web browser seems to have independent font settings for content too. I didn't tried to change them yet.
This really helped me a lot, I even figured out how to change my whole system font: after adding my new font I just had to delete the default Sail Sans folder. Now the only thing left is theming the android fonts, and I have no idea how to do that. EDIT: I got the android fonts themed as well, I had to rename my fonts and replace the roboto fonts in /opt/alien/system/fonts
JakeTheChangeling ( 2015-01-02 23:52:58 +0200 )edityou need a font like raleway that has many diffrent thickness options, then you rename them to Roboto-BoldItalic and all other Roboto fonts, I suggest making a backup of the android font folder before. here's a screenshot to proof it works fine: i.imgur.com/qtkD70t.jpg
JakeTheChangeling ( 2015-02-25 18:44:14 +0200 )editI found out how to change the browser fonts as well if anyone is interested: Simply add the font you want in all 5 font sections of /etc/fonts/conf.avail/45-latin.conf and 60-latin.conf and then reboot. Maybe it'd work with only some of the sections and I have no idea what the section "Fantasy faces" is for but I themed my Jolla in Fallout style and applied Monofonto simply everywhere, looks really nice.
JakeTheChangeling ( 2015-04-06 11:56:03 +0200 )edit@JakeTheChangeling - can fonts me made bigger by this process?, or is that a setting somewhere else?, a small growing number of people would benetit from slightly larger text in many areas of the phone.
Any thoughts on the size aspect of fonts?, any info appreciated.
Spam Hunter ( 2015-12-31 07:19:35 +0200 )editI don't see any effect, even after I removed the Roboto and WenQuanYi Zen Hei <family> tags, fc-cache -f -v and reboot?</family>
You may replace the Sail Sans Pro font, like:
<match target="pattern">
<test name="family">
<string>Sail Sans Pro</string>
</test>
<edit binding="strong" name="family" mode="assign">
<string>Source Han Sans CN</string>
</edit>
</match>
However another issue is introduced by this: https://together.jolla.com/question/52459/wrong-position-of-underline-with-custom-fonts/
gexc ( 2014-08-10 10:01:29 +0200 )editThis thread is public, all members of Together.Jolla.Com can read this page.
Asked: 2014-02-04 19:32:37 +0200
Seen: 2,335 times
Last updated: Aug 09 '14
Enhance launcher appearance [released]
Font changes in deployed applications
Add support for emoji in google talk
Enhance the font in Launcher screen [duplicate]
Better readability in sent sms messages.
Font size adjustment [duplicate]
support emoji (iphone) smilies etc. [released]
It would be nice to get an answer. Cyrillic font looks wery ugly so far...
Wickedsten ( 2014-02-04 20:36:41 +0200 )edit