How to activate subpixel font hinting for the text inside Firefox, Chrome and evince?
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>
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
.