Ubuntu – Unusual font on some sites (like Facebook)


Some of the fonts on popular web sites (like Facebook) have changed since I reinstalled 14.04 LTS. I'd only originally had it installed for about a week, and the fonts seemed normal. But since reinstalling some of the fonts have changed to something less easily readable.

Old (better) font:

New (worse) font:

How do I change the font back, or what might have changed it? I have the Unity Tweak Tool installed and the fonts on their default settings (as they were before reformat). Could it be ttf-mscorefonts-installer? Because I'm not sure if that was installed on my last go-around.

Edit: Sorry, completely forgot to mention, the web browser is Chromium in both cases.

Best Answer

Font substitutions for your case are described in the file /etc/fonts/conf.avail/30-metric-aliases.conf. It looks complex at the first glance, but it is pretty logical.
Your "better" font is Liberation Sans and it replaced Helvetica and Arial everywhere, until you installed ttf-mscorefonts-installer. Now Arial appeared in your system and it is more preferable than Liberation Sans, according to the substitution rules (they can be found in the "Map generics to specifics" section of the mentioned file).
You can override these rules with your personal rule file. Create the file with the name local.conf somewhere and put the next lines in it:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- Map generics to specifics (overrides 30-metric-aliases.conf) -->

    <alias binding="same">
      <family>Liberation Sans</family>


Now copy it to the folder with the font settings:

sudo cp local.conf /etc/fonts

Reboot and check whether your "better" font has replaced the "worse" one.
NB This trick replaced only sans-serif font, but it can be used to set the precedence of the serif and monospaced fonts at your desire.

Related Question