Beautiful Fonts on RHEL 7

Achewood Comic Sans

Achewood Comic SansOK, the font situation on Linux is atrocious. Let’s take that as read. If you’re on a Fedora, CentOS, or RHEL-based system, here’s how you can improve it. It took me hours of Googling to get something that worked, hopefully this will save you some time. For the first time, I don’t want to stab myself in the face when I log into a RHEL box.

It should go without saying that if anyone has any better ideas, I’m all ears. This was excruciating.

Get the right software

Do what Pritesh says. I ignored the business about a new kernel and the .fonts.conf. We’ll take care of the .fonts.conf stuff later.

# set up EL repo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

# install Nux desktop
rpm -Uvh
http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

# install the infinality patches
yum --enablerepo=nux-dextop install fontconfig-infinality
yum --enablerepo=nux-dextop install cairo
yum --enablerepo=nux-dextop install libXft
yum --enablerepo=nux-dextop install freetype-infinality

Get the right fonts

Because scaled fonts are mostly under restricted licenses, you’ll have to do this yourself. This is all a matter of preference, but Googling for “msttfonts” and “Helvetica Neue ttf” is a great start. Double-click on them after they download, and hit the “Install” button. Super easy.

Fixing Gnome

Now to actually use those fonts in Gnome.

Run “Tweak Tool”. Navigate to fonts and play with the scaling factor. On my X1 Carbon, 1.1 did it for me. Again, this is a matter of preference.

Now, make Hinting “Slight”, and Antialiasing “Rgba”.

Next, choose your favorite options for Document, Window Title, and Fixed Width fonts. For me: “HelveticaNeue 12”, “HelveticaNeue-Medium 12”, and “Inconsolata 13”. But play around. When you’re done, hit Alt-F2, enter “r”, and hit return. When Gnome restarts, everything should look much better.

Make sure you’re testing it on something that’s not Firefox, Thunderbird, or Chrome — they do fonts their own way, we’ll deal with that in a second.

Fixing Gnome Shell

Because why would we put all our configuration items in one place when they could be in two? Here, you’re supported to be able to create your own user
theme with fonts that you like
.

On my machine, user fonts were disabled, so I’ll need root access to edit /usr/share/gnome-shell/theme/gnome-shell.css and change all the “font-family” entries in the CSS to my liking. You’ll also want to add a “font-family” line to the #panel stanza, otherwise you’ll get the bottom panel rendered in the dreaded Cantarell.

Fixing Thunderbird

Download “Theme Font & Size Changer” extension, and play with the scaling. For me, 1.25 did the trick. Why it’s 1.25 here and 1.1 in Gnome, I don’t know. Whatever.

It’s extra-nasty in Thunderbird, because you need to make your font choices for each codepage. It’s insane.

Fixing Firefox

Preferences > Content and play with the font choices. They will not behave the way you expect, with different fonts falling back to “safe” defaults at different sizes. I have no idea what’s going on.

Fixing Chrome

Settings > Advanced and play with the combination of font choices and scaling. Again, fonts will randomly fall back to some super-ugly defaults. Who knows.

Once you’ve been through all that, everything will look much, much better.