Many of you have probably already heard of Infinality, but I've decided to write a post about it anyway, for those who aren't familiar with it yet, because it greatly improves the font rendering on Linux.
Infinality is a set of Freetype patches that try to provide an improved font rendering for Linux and also, to allow easy customization so the users can adjust the settings to their taste. Using it, you can easily set the font style to emulate OSX, OSX2, Windows 98, WIndows XP or Windows 7 or you can use the "Linux" or "Infinality" (default) styles.
While Infinality is very useful for most Linux distributions, the Ubuntu font rendering is pretty good already, but even so, there are quite a few Ubuntu users who install Infinality, like Miroslav Hadzhiev (Мирослав Хаджиев), the Ubuntu Bulgarian Translators admin, who says that: "[...] this [Infinality] project has brought me back to Linux. I work with documents all day long so the fonts are VERY important to me". He adds that using Infinality, the fonts are sharper and more vivid on large screens - here's a screenshot from Miroslav's Ubuntu computer (on the left: Ubuntu default; on the right: Infinality with "Linux" style).
Using Infinality in Ubuntu, the fonts are easier on the eyes and while you may not notice a major or even any difference at all in the screenshot below, you should see the difference after you've used Infinality for a while on your computer:
|On the left: Infinality (using the Linux style); on the right: the default Ubuntu font configuration|
The screenshot above uses the Linux Infinality style, but there are many other style you can choose from, as I was saying above.
The differences in the above screenshot are not very clear because like I was saying, the fonts in Ubuntu look good already, but you should notice a big difference between the default Debian font rendering and Infinality, in the screenshot below:
If you want to use or just try out Infinality, here's how to install it in Ubuntu and Debian (with links to installation instructions for other Linux distributions) and set it up.
Install and configure Infinality for better font rendering in Linux
Ubuntu: Freetype with the Infinality patches can be installed in Ubuntu by using a PPA. To add the PPA and install the required packages in Ubuntu 12.04, 13.04 or 13.10, use the following commands:
Once installed, log out and log back in.
sudo add-apt-repository ppa:no1wantdthisname/ppa sudo apt-get update sudo apt-get upgrade sudo apt-get install fontconfig-infinality
Debian: the PPA works on Debian 7 too (that's actually how I've installed Infinality in the screenshot above - I've used "raring" for the version), but because I've only tested it for a few minutes, I can't say how stable it is. If you want to use it in Debian, follow the instructions below on your own risk. An alternative way of installing Infinality on Debian can be found HERE.
To add an unofficial Infinality PPA and install all the required packages in Debian (32bit and 64bit), use the following commands:
echo "deb http://ppa.launchpad.net/no1wantdthisname/ppa/ubuntu raring main" | sudo tee /etc/apt/sources.list.d/infinality.list echo "deb-src http://ppa.launchpad.net/no1wantdthisname/ppa/ubuntu raring main" | sudo tee -a /etc/apt/sources.list.d/infinality.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E985B27B
For another way of getting better fonts in Debian, see THIS article (it's in Spanish but you only need the commands).
Installing Infinality in other Linux distributions:
- Fedora (official Infinality repository) and generic installation instructions
- Arch Linux: the easy way | the generic way (AUR)
- openSUSE repository
- Debian installation instructions (build instructions and pre-built binaries)
Once you install Infinality, it's time to configure it. To set the style you want to use, run the following command:
sudo bash /etc/fonts/infinality/infctl.sh setstyle
And select the style you want to use. Available options are: debug, infinality, linux, osx, osx2, win7, win98 and winxp (I recommend using the "linux" style, obviously, but you can try any style, then remember to log out and log back in - you can easily select a different style later on by using the same command). To use the Windows or OSX style you'll also need to use the Windows or OSX fonts.
Optional: next, open /etc/profile.d/infinality-settings.sh with a text editor as root - I'll use Gedit below:
And in this file, search for USE_STYLE (it should be USE_STYLE="DEFAULT" by default) and change it to one of the following styles (I recommend using "UBUNTU" here but you should also try the default to see which one you like better):
sudo -H gedit /etc/profile.d/infinality-settings.sh
- DEFAULT - A compromise that should please most people;
- OSX - Simulate OSX rendering;
- IPAD - Simulate iPad rendering;
- UBUNTU - Simulate Ubuntu rendering;
- LINUX - Generic "Linux" style - no snapping or certain other tweaks;
- WINDOWS - Simulate Windows rendering;
- WINDOWS7 - Simulate Windows rendering with normal glyphs;
- WINDOWS7LIGHT- Simulate Windows 7 rendering with lighter glyphs;
- WINDOWS - Simulate Windows rendering;
- VANILLA - Just subpixel hinting;
- CUSTOM - Your own choice;
- Infinality styles:
- CLASSIC - Infinality rendering circa 2010. No snapping;
- NUDGE - CLASSIC with lightly stem snapping and tweaks;
- PUSH - CLASSIC with medium stem snapping and tweaks;
- SHOVE - Full stem snapping and tweaks without sharpening;
- SHARPENED - Full stem snapping, tweaks, and Windows-style sharpening;
- INFINALITY - Settings used by the Infinality developer;
- DISABLED - Act as though running without the extra infinality enhancements (just subpixel hinting).
In this file you can change many other settings but if you don't know what they do, only change the style. Then, save the file, log out and log back in to see the changes.
For discussion, bug reports and so, visit the Infinality forums.
Update: for improved font rendering in Java / Swing applications (OpenJDK 7), see this article: Install OpenJDK Patched With Font Fixes [Ubuntu PPA]
Reverting the changes
For Ubuntu, to remove Infinality and revert all the changes made by using the instructions above, use the following commands:
Once the PPA is purge, log out and log back in.
sudo apt-get purge fontconfig-infinality sudo apt-get install ppa-purge sudo ppa-purge ppa:no1wantdthisname/ppa
For Debian, if you've added the PPA and want to revert the changes, use the following commands:
sudo apt-get purge fontconfig-infinality sudo rm /etc/apt/sources.list.d/infinality.list sudo apt-get update
Then (still for Debian), downgrade the Freetype package using the following command, presuming you're using Debian stable:
sudo apt-get install libfreetype6/stable
Note: you also need to downgrade libfreetype6-dev if it's installed and also, libfreetype6:i386 may not be installed. You may want to check if those packages are installed by using "apt-cache policy" (example: "apt-cache policy libfreetype6-dev").
sudo apt-get install libfreetype6/stable libfreetype6:i386/stable
Thanks to Miroslav Hadzhiev for the tip and info and to "slow" for maintaining the PPA!