Font Configuration - Arial Font Rendering

Hi TekSyndicate Members!

I've got an annoying problem with Arch Linux, that doesn't seem to appear under Xubuntu, Ubuntu or Fedora.

According to the Arch Linux Wiki, font configuration is done via local.conf. Mine looks like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
        <family>Roboto Slab</family>
        <family>Tinos</family>
        <family>Times New Roman</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
    <family>Roboto Regular</family>
    <family>Arial</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Roboto</family></prefer>
  </alias>
  <!-- Replaces Arial with Roboto where possible, bad because of overiding the defaults-->
  <!-- 
  <match target="pattern">
    <test qual="any" name="family"><string>Arial</string></test>
    <edit name="family" mode="assign" binding="same"><string>Roboto</string></edit>
  </match>
  -->
</fontconfig>

I have an issue with the font rendering of Arial.

In Arch:

In Windows:

Sorry about the website choice, it was just easy to sample.

Why do they look so different? local.conf doesn't exist with Xubuntu, and I'm not too sure about Fedora other than that the font looks the same as Windows.

TL;DR:

Why doesn't Arial look right?

Thanks TekSyndicate Forum!

Well, I've managed to solve it. Hopefully it will be of use to someone else.

It turns out you have to have hinting turned on, as well as additional settings (I don't know too much about them as I haven't tweaked them).

This is my new local.conf, and it has fixed my rendering issues:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Roboto Slab</family>
      <family>Tinos</family>
      <family>Times New Roman</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Roboto Regular</family>
      <family>Arial</family>
    </prefer>
  </alias>
  <alias>
  <family>sans</family>
    <prefer>
      <family>Roboto</family>
    </prefer>
  </alias>
  <!-- Replaces Arial with Roboto where possible, bad because of overiding the defaults-->
  <!-- <match target="pattern">
  <test qual="any" name="family"><string>Arial</string></test>
  <edit name="family" mode="assign" binding="same"><string>Roboto</string></edit>
  </match>-->
  <match target="font">
        <edit mode="assign" name="antialias">
                <bool>true</bool>
        </edit>
        <edit mode="assign" name="embeddedbitmap">
                <bool>false</bool>
        </edit>
        <edit mode="assign" name="hinting">
                <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle">
                <const>hintslight</const>
        </edit>
        <edit mode="assign" name="lcdfilter">
                <const>lcddefault</const>
        </edit>
        <edit mode="assign" name="rgba">
                <const>rgb</const>
        </edit>
  </match>
</fontconfig>

Hopefully the markdown is better here than before.

So, there we have it. Thanks again to the Arch Wiki, which I wish I had consulted sooner. As they say, RTFM.

Anyway, thanks again TekSyndicate Forum! :D

1 Like