How to quickly configure superb subpixel hinted smooth fonts for openSUSE 12.3

Given the fact that many computer users spend many hours every day, if not the better portion of their waking hours staring at a computer screen, it’s surprising how few users seem to pay attention to the quality of font rendering. I frequently read Linux distro reviews, and rarely if ever do they mention font rendering quality. For me, a heavy computer user, top-notch font rendering is the most important feature after system stability.

The state of subpixel hinted smooth fonts on openSUSE

Ubuntu-based systems seem to have by far the best font rendering out of the box, and are the only systems that I could sit down and use without tweaking the fonts. OpenSUSE, on the other hand, has default font rendering that I personally find to be unbearable. Depending on the desktop environment and the font settings in its control panel, fonts are either jagged without subpixel hinting, or blurry and imprecise with it enabled. This is especially true under the KDE desktop. Worse still, after manually tweaking fonts under the desktop control panel and still achieving only sub par results, applications written in another toolkit will not obey the desktop’s font rendering settings.

Fortunately, I’m not alone in my quest for beautiful font rendering. Even in the GNU/Linux ecosystem, there are a few developers who concentrate their efforts on making font rendering on Linux every bit as beautiful as its Mac and Windows counterparts, and their efforts can reap stunningly beautiful font rendering on openSUSE. The most notable are the Infinality Freetype patches and configuration files. Without going into a lot of tedious detail about how they work, let’s jump right into how to set up Infinality font rendering for openSUSE 12.3.

Infinality font rendering easy configuration for openSUSE 12.3

  1. Add the official namtrac:subpixel Infinality repository for openSUSE 12.3. This is the one maintained by the actual Infinality developer(s).
  2. Switch system packages to the versions in the namtrac:subpixel repository, and mark for installation any other packages in namtrac:subpixel that aren’t yet installed.
  3. From the main openSUSE official repository, install the fontconfig-infinality
  4. Make sure your desktop environment’s font configuration for subpixel hinting is set to “Use system settings” or something similar. Only if that option does not exist, set it to RGB order with slight hinting.
  5. (Optional) Set all desktop fonts to “DejaVu Sans, Book”, my personal preference.
  6. Log out and log back in to your desktop.

Optional additional configuration

The above configuration should give beautiful subpixel hinting by default that looks virtually identical to that of Ubuntu, and most users will probably want to leave the defaults. But for those who desire a look more similar to that of Mac OSX or various versions of Windows, Infinality offers convenient presets to emulate the font rendering style of different operating systems. To change these presets, there are two configuration files that can be adjusted.

First of all, the /etc/profile.d/infinality-settings.sh script needs to be opened for editing as root. This file controls the subpixel hinting and final touchup of the font rendering, and is a key file in the Infinality font configuration. Somewhere around line 700 there are many preset configuration options listed in the comments. The default is USE_STYLE="UBUNTU". Change this to any available rendering style that suits your fancy.

The second configuration area that can be adjusted has to do with font substitution and use of specific font families by default. These settings are found in the /etc/fonts/infinality/ directory. Again, Infinality offers us convenient presets inside the /etc/fonts/infinality/styles.conf.avail directory. These are controlled by multiple init-style configuration scripts inside a directory that bears the name of the preset style. The preset configuration is specified at /etc/fonts/infinality/conf.d, which is a symlink to the desired preset directory under /etc/fonts/infinality/styles.conf.avail. The default configuration of /etc/fonts/infinality/conf.d links to /etc/fonts/infinality/styles.conf.avail/linux, which according to the Infinality forums is most similar to the Ubuntu configuration. To change the preset, simply change the symlink of /etc/fonts/infinality/conf.d to point to any of the other available preset directories. It should be noted that I personally had problems with the “win7” preset, which resulted in some characters rendering as ▯▯boxes▯▯. It could be that I don’t have the necessary fonts installed.

Configuration for Type-1 fonts like Bitstream Charter

I personally use the Bitstream Charter font extensively in many documents, which is a professional-grade open source Type-1 serif font. I was baffled when, after installing the font, it failed to appear as an available option in LibreOffice. I finally discovered that the /etc/fonts/infinality/infinality.conf file is banning all Type-1 fonts because they render poorly. While that may be the case with some Type-1 fonts, Bitstream Charter looks beautiful with Infinality rendering. So, I commented out that section of the config file:


<!-- Ban Type-1 fonts because they render poorly --> 
	<!-- Comment this out to allow all Type 1 fonts -->
<!--
	<selectfont> 
		<rejectfont> 
			<pattern> 
				<patelt name="fontformat" > 
					<string>Type 1</string> 
				</patelt> 
			</pattern> 
		</rejectfont> 
	</selectfont> 
-->

Conclusion

The results of following the six simple steps I outlined above are dramatic. The default font configuration under KDE in openSUSE 12.3 looks like this. LibreOffice looks like this by default in openSUSE’s default Gnome configuration.

Compare those with a few screenshots of my system after installing the default Infinality settings on my openSUSE 12.3 desktop and using DejaVu Sans fonts:

Many thanks to the openSUSE team for the fantastic OBS, which enables pioneers like Infinality to offer world class beautiful subpixel hinted font rendering for openSUSE 12.3.

Tagging: 

3 Comments

Can't recommend

I followed the instructions nearly a month ago, but today removed both the infinality package & report. Instead, I went with the other ‘muzlocker’ repo for improved fonts.

There were at least two problems with the infinality package on openSUSE:
1) After starting any X app, a page of error messages about an incompatible font configuration would be printed to the screen and/or placed in ~/.xsession-errors.
2) more significantly, the infinality repo included some QT libs. Within the last couple days these were updated, causing constant nepomukservicestub segfaults.

I hope this helps other users save some time.
rr01