Wednesday, October 16, 2013

Make Chromium fonts look like Iceweasel's in Debian XFCE

If you try out Chromium in Debian, you may notice that displayed fonts are not as nice as they are in Iceweasel.

Here's an example from Iceweasel:

And here's the same text in Chromium:

The first thing I noticed is that Chromium uses Bitstream Charter font whereas Iceweasel uses Serif. (I don't have Microsoft fonts installed.) This is what the text looks like with Chromium set to use Serif:

Next I noticed that Chromium does not seem to use the anti-alias settings in the XFCE GUI. The solution to this is to add a .fonts.conf file to the /home directory:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
    <edit name="autohint" mode="assign">
      <bool>true</bool>
    </edit>
    <edit name="hinting" mode="assign">
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
      <const>hintslight</const>
    </edit>
  </match>
  <match target="font">
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>
<match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>
Here are before and after screenshots:



Now fonts display very much the same in both browsers:

Source: Arch Linux Font Configuration.

No comments:

Post a Comment