User Tools

Site Tools


tips:how-to-fix-blurry-font-rendering-in-ubuntu

This is an old revision of the document!


How to fix blurry font rendering in Ubuntu

By default, at least XUbuntu 10.04 comes with font rendering settings that enable antialiasing and hinting in such way that everything looks blurry and soft. With some fonts, the edge of the font also looks like it has a shadow that isn't gray in color but more like a shade of blue or green.

/etc/fonts/conf.d/99-fix-fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcdnone</const></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
  </match>
</fontconfig>

Starting the file name with 99 will force the content to be sourced last when the configuration is read and as a result any settings in the file will override those set elsewhere. The lcdfilter setting seems to have the most effect and setting rgba to none will make the antialiasing to be grayscale instead of seamingly random colors. The documentation for this file is available here.

Xfce 4 Settings Manager -> Appearance -> Fonts

These setting will still affect those programs that don't use fontconfig for selecting font rendering settings. Note that the subpixel order is screen specific when using a TFT display. However, usually it's best to just try every option and see which one provides the most pleasable result. Selecting 'None' guarantees that the rendering doesn't cause colored edges. The purpose of the subpixel order is the same as lcdfilter in the /etc/fonts/conf.d example.

Before and after comparison

These images shows the difference between the default (left) and modified (right) settings.

Default (300% zoom) Modified (300% zoom)
tips/how-to-fix-blurry-font-rendering-in-ubuntu.1534619678.txt.gz · Last modified: 18.08.2018 22:14 by vergo