6

I used the answers to this question to tune the subpixel font hinting in the Unity interface. However, the text rendered inside Firefox , Chrome or evince doesn't use subpixel anti-aliasing. Sadly these three applications are the one which need it the most.

Subpixel font hinting is enabled almost everywhere else.

How to activate it for these applications ?

2 Answers 2

8
+50

Firefox seems not to read the GTK configuration, but it does will honor your ~/.fonts.conf which basically contains the font configuration, including the sub-pixel order.

This is an example .fonts.conf which comes from a 2005 blog post which may help out, what you most likely want to change is the rgba value (sub-pixel order) to match your LCD and maybe the antialias value.

<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig>
<match target="font">
    <edit mode="assign" name="autohint">
        <bool>false</bool>
    </edit>
</match>
<match target="font">
    <edit mode="assign" name="rgba">
        <const>rgb</const>
    </edit>
</match>
<match target="font">
    <edit mode="assign" name="hinting">
        <bool>true</bool>
    </edit>
</match>
<match target="font">
    <edit mode="assign" name="hintstyle">
        <const>hintfull</const>
    </edit>
</match>
<match target="font">
    <edit mode="assign" name="antialias">
        <bool>true</bool>
    </edit>
</match> </fontconfig>
3
  • There was already a .fonts.config with some minor differences, especially on the autohint key which was not set. It's now working with autohint=false. Not sure why.. but it's working.
    – alecail
    Oct 20, 2013 at 19:49
  • This does the job for FF et Chrome, but evince is still using a grayscale anti-aliasing.
    – alecail
    Oct 20, 2013 at 19:56
  • Fixed my 14.04 install which somehow had it turned off when I switched to using kde-desktop. Sep 18, 2014 at 2:03
1

There are two places where you can alter the fonts appearance:

1. Run dconf and find org.gnome.settings-daemon.plugins.xsettings schema. Hinting, antialiasing and RGBA order can be set there. These settings affect GTK and Unity applications.
2. Take a look at /etc/fonts/conf.d folder. It actually contains symlinks from /etc/fonts/conf.avail. For example, if you want to change your hinting style from slight to full, remove one symlink and add another.

sudo rm /etc/fonts/conf.d/10-hinting-slight.conf
sudo ln -s /etc/fonts/conf.avail/10-hinting-full.conf /etc/fonts/conf.d/

In your case check whether 10-no-sub-pixel.conf symlink exists in /etc/fonts/conf.d folder. If yes, remove it and add 10-sub-pixel-rgb.conf symlink as described earlier.
These settings affect non-GTK applications like Firefox and some other.

If you need some proven resources about fonts configuration you can look at https://wiki.ubuntu.com/Fonts (mostly consists of custom ~/.fonts.conf and quite old). Another great resource is https://wiki.archlinux.org/index.php/Font_Configuration (contains multiple hints and up to date).

BTW Direct editing of /etc/fonts/fonts.conf is not recommended. You'd better add /etc/fonts/local.conf or ~/.fonts.conf with your custom settings which will prevail over the settings in /etc/fonts/fonts.conf.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .