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?

edit retag close delete

It would be nice to get an answer. Cyrillic font looks wery ugly so far...

( 2014-02-04 20:36:41 +0300 )edit

Sort by » oldest newest most voted

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>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>


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.

more

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

( 2015-01-02 23:52:58 +0300 )edit
1

How do Android apps work then? What changes should you make for them?

( 2015-01-15 21:43:12 +0300 )edit

you 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

( 2015-02-25 18:44:14 +0300 )edit

I 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.

( 2015-04-06 11:56:03 +0300 )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.

( 2015-12-31 07:19:35 +0300 )edit

I don't see any effect, even after I removed the Roboto and WenQuanYi Zen Hei <family> tags, fc-cache -f -v and reboot?</family>

more

what effects are you trying to achieve?

( 2014-08-10 00:27:38 +0300 )edit

I mean, I don't see any changes even I change it to a different font by using the above method.

( 2014-08-10 08:53:05 +0300 )edit

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/

( 2014-08-10 10:01:29 +0300 )edit