Font rendering on Ubuntu. Infinality!

[Click and view in original size]

This is the follow-up article to my earlier article on font rendering on Ubuntu. While the previous one explains tweaks on default Ubuntu, this article will add to that using infinality patches.

Infinality adds many improvements to font rendering by patching fontconfig and freetype libraries:

  • Emboldening Enhancement: Disables Y emboldening, producing a much nicer result on fonts without bold versions. Works on native TT hinter and autohinter.
  • Auto-Autohint: Automatically forces autohint on fonts that contain no TT instructions.
  • Autohint Enhancement: Makes autohint snap horizontal stems to pixels. Gives a result that appears like a well-hinted truetype font, but is 100% patent-free (as per the dev).
  • Customized FIR Filter: Select your own filter values at run-time. Works on native TT hinter and autohinter.
  • Stem Alignment: Aligns bitmap glyphs to optimized pixel boundaries. Works on native TT hinter and autohinter.
  • Pseudo Gamma Correction: Lighten and darken glyphs at a given value, below a given size. Works on native TT hinter and autohinter.
  • Embolden Thin Fonts: Embolden thin or light fonts so that they are more visible. Works on autohinter.
  • Force Slight Hinting: Force slight hinting even when programs want full hinting. The local.conf provided (included in infinality-settings fedora package) adds nice improvements on @font-face fonts.
  • ChromeOS Style Sharpening: ChromeOS uses a patch to sharpen the look of fonts. Included in the infinality patchset.

[Click and view in original size]

Infinality comes with various configuration options:

  • DEFAULT – Default settings. 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
  • VANILLA – Just subpixel hinting
  • CUSTOM – Your own preferences. Tweak stuff if you know what you are doing
  • 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)

However, regular users don’t really need to understand the details of the improvements. Applying and testing the different font settings are easy. Follow the steps below:

  1. To install on Ubuntu:
    $ sudo add-apt-repository ppa:no1wantdthisname/ppa
    $ sudo apt-get update
    $ sudo apt-get install  fontconfig-infinality freetype
  2. Run the following commands to choose and apply a font configuration:
    $ sudo /etc/fonts/infinality/ setstyle

    However, the command doesn’t show all configuration options.

  3. To take full control, open /etc/profile.d/ and search for the string USE_STYLE. You can set it to any of the configuration options listed above. For example, I use “WINDOWS7LIGHT” with my own customization for extra sharpness. Get it here.
  4. Remember that you need to logout and login back for the settings to take effect correctly.

At this point, I also set my dots per inch to 128:

$ xrandr --dpi 128

and added the command to a startup script.

bohoomil’s patch

To push things further, you can try out the infinality-ultimate patches from bohoomil. However, I faced issues with my Firefox fonts with this patch (this might not happen on all hardware) though the system fonts looked great. In addition, there might be issues downgrading all the packages again. If you still want to go for it:

$ sudo add-apt-repository ppa:rjvbertin/infinaltimate
$ sudo apt-get update
$ sudo apt-get upgrade

Webpage: Infinality

12 thoughts on “Font rendering on Ubuntu. Infinality!”

  1. Finally I found another distro than Arch with the bohoomil patches, thanks! Going to install these patches on my Ubuntu partition.

  2. I don’t find freetype – libfreetype6 was already installed, and the closest I see to freetype is freetype2-demos. I’m testing it without that; we’ll see what happens.

Leave a Reply to Arun Cancel reply

Your email address will not be published. Required fields are marked *