Skip to content

Instantly share code, notes, and snippets.

@halfwit
Forked from Earnestly/fonts.adoc
Created November 25, 2015 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfwit/f7ce55cd884ca2ef2c14 to your computer and use it in GitHub Desktop.
Save halfwit/f7ce55cd884ca2ef2c14 to your computer and use it in GitHub Desktop.
Better Defaults for Freetype
FONTS Earnestly
Better Defaults for Freetype
Contents
Introduction ....................................................... 16
Better Defaults .................................................... 43
Configuration ...................................................... 68
The Infinality Ultimate Bundle ..................................... 85
Additional Resources ............................................... 96
Introduction
Historically on Linux in order to get nicely rendered fonts one would
need to resort to patches like Infinality, however this only applied to
TrueType[1] fonts.
In 2013 Adobe donated their CFF (Compact Font Format)[2] rasterizer to
the freetype project[3] which greatly boosted quality of OpenType
rendering. It was donated primarily for Adobe and Google's epic Noto
typeface[4].
Freetype has since made the CFF hinting engine default in version
2.4.12[5].
In contrast, while Infinality's ClearType implementation has been part
of freetype since mid 2012[6], it is not enabled by default due to
patent concerns[7].
1. https://en.wikipedia.org/wiki/TrueType
2. https://en.wikipedia.org/wiki/PostScript_fonts#Compact_Font_Format
3. http://blog.typekit.com/2013/05/01/adobe-contributes-cff-rasterizer-to-freetype/
4. http://lwn.net/Articles/613284/
5. http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=06474c3e5bef
6. http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=79e36baebba4
7. http://david.freetype.org/cleartype-patents.html
Better Defaults
The simplest method to seeing an improvement would be to use
freetype2-git from either the AUR[8] or heftig's repository[9].
Alternatively, due to pressure from other maintainers, an Arch Linux
specific addition[10] has exposed the subpixel hinter via the
environment variable FT2_SUBPIXEL_HINTING. Setting this to anything
so that it present in your environ will enable the hinter. Removing
it will disable it.
The next, and perhaps obvious, requirement is to use good fonts. I
speak not of aesthetic quality or visual style, but the the
construction. Typefaces designed with good hinting instructions[11]
or blues values[12]. A nice collection of commerically free to use
fonts is currated at <http://www.fontsquirrel.com/>. Simply download
and copy the outlines to XDG_DATA_HOME/fonts (~/.local/share/fonts).
8. https://aur.archlinux.org/packages/freetype2-git/
9. https://bbs.archlinux.org/viewtopic.php?id=117157
10. https://bugs.archlinux.org/task/35274
11. http://www.microsoft.com/typography/otspec160/ttinst.htm
12. https://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF
Configuration
I have provided what I consider a good base-line configuration for
freetype via fontconfig[13]. There is minimal opinion of which can be
easily removed. The configuration is fairly well documented in the
fonts-conf(5) manual.
Simply place the configuration in XDG_CONFIG_HOME/fontconfig/fonts.conf
(~/.config/fontconfig/fonts.conf) and restart any software which loaded
the freetype library.
(Some systems do not require restarts as they update freetype settings
automatically such as GNOME via the gnome-settings-daemon or xsettingsd.)
13. https://github.com/Earnestly/dotfiles/blob/master/.config/fontconfig/fonts.conf
The Infinality Ultimate Bundle
The Infinality Ultimate Bundle[14] is a nice project which aims to
create a curated and tuned collection of fonts for use on free OS' such
as Linux. This is similar to what both Windows and OSX do for their
users. Use this if you are not particularly interested in typefaces
and simply want nice font rendering.
14. http://bohoomil.com/
Additional Resources
* The de-facto Bible of outline hinting: <http://www.rastertragedy.com/>
* Behdad's excellent introduction to challenges facing high-DPI
displays and their relationship to current systems: <http://goo.gl/yf3M7>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment