ttfautohint

Donate Now Click here to lend your support to: ttfautohint
		    and make a donation at www.pledgie.com! Flattr this

5th February 2012

Version 0.7 is available – we have a GUI!

The Qt framework is used to provide a uniform interface for all supported platforms.

Below you can find a link for downloading Windows binaries. If you want to have better installation support (including a package for Mac), please donate!

2nd January 2012

Version 0.6.1 is available.

This release should fix problems with version 0.6; additionally, dropout mode has been activated.

25th December 2011

My Xmas present to you: version 0.6. Thanks to all of you who are still donating!

This version greatly improves handling of composite glyphs. It also implements option -p to pre-hint a font with the original hints before processing it.

19th November 2011

Karsten Lücke provided a static binary for OS X – no need to install FreeType! It was generated under version 10.5.8, but should run with version 10.7 also.

9th November 2011

The Google Web Fonts has contributed an additional $3,000! I have now raised two thirds of my goal!

I hope other corporate font developers, especially those with large font catalogs, who will benefit substantially from this work, will consider making a contribution of a thousand dollars.

I have just released version 0.5, including a Windows binary. You can read the project roadmap here.

18th October 2011

In September we have raised over $2,000 from the public, $7,000 each from Google and FontLab, together with a copy of FontLab 5, and received from Microsoft the Visual TrueType file format specification. This will allow designers to refine ttfautohint's results further using VTT, if I reach my $30,000 goal!

The collected money so far enables me to intensively work on ttfautohint for the next three months. The two main issues I'm going to handle are

In case you have special wishes, now it's the right time to tell me! Please look into the TODO file and check whether your idea is already covered!

Introduction

Werner Lemberg is making it easy for type designers to create web fonts that look great on Windows, with ttfautohint.

Hinting can be a slow and expensive process, and many fonts lack good hinting.

ttfautohint solves this, by repurposing FreeType's autohinting system to bring the excellent quality of FreeType rendering to platforms which don't use it, and yet also require hinting for text to look good – like Microsoft's.

Across Windows rendering environments today, ttfautohint fonts look best with DirectWrite ClearType enabled. This is the default for Windows 7. Good visual results are also seen in recent MacOS X versions and GNU/Linux systems that do use FreeType for rendering.

The main part of the project is a code library, which is described in detail in the source code file src/ttfautohint.h. There is also a simple demo program with a command-line interface, ttfautohint.

It may later be possible to generate a ‘first pass’ of hinting that hinting designers can refine further for ultimate quality.

animated dollar glyph of LiberationSerif-Regular

The animation above shows how the hints created by ttfautohint get applied to the dollar glyph of Liberation Serif Regular at 19 pixels per em, using FontForge's TrueType hinting bytecode debugger. (You can view the image directly to see it in original size.)

Roadmap

The project started in 2010 when Dave Crossland suggested the idea of the program. Werner was able to start development thanks to financial support from the Google Web Fonts team.

He soon produced results that received some warm attention from professional type designers.

Werner is now seeking financial support from the wider typography community to continue the project.

In the end it should produce high quality hinting for a large range of fonts; this will simplify the life of type designers a lot, since hinting TrueType fonts is a very time consuming and expensive process. If development continues, this little program could improve overall quality of web typography!

Here is a short list of essential items:

The TODO file in the source code repository provides an extensive list of things which will be eventually handled in one or another way.

Visual Samples

Vernon Adams has done extensive testing of ttfautohint, and has documented this in detail over at his blog, New Typography. While doing so, he created a large set (ZIP) of test images. A few of them are shown below, with image descriptions always above an image:

Ubuntu Regular, Windows DirectWrite ClearType:

Ubuntu Regular, Windows DirectWrite ClearType

Ubuntu regular, GDI ClearType. This image clearly shows the aggressive colour filtering. With ttfautohint, curved outline extrema not aligned to a pixel border are not handled well, giving some sizes a bitmap-like appearance:

Ubuntu regular, GDI ClearType

Vera Regular, Windows DirectWrite ClearType:

Vera Regular, Windows DirectWrite ClearType

Droid Serif Regular, Windows DirectWrite ClearType:

Droid Serif Regular, Windows DirectWrite ClearType

Finally, here two font files of Ubuntu Regular so that you can compare the hinting results by yourself:

Ubuntu-R.ttf
Ubuntu-TTFautohint-R.ttf

Note that Ubuntu-TTFautohint-R.ttf has been generated with version 0.5 of ttfautohint; it has also been manually edited (using ttx) to change the font name so that it is possible to use the original version and the version processed with ttfautohint in parallel.

Matt Wiebe has tested the font VAG Rounded; he presents the results on his blog.

How It Works

A detailed description of the autohinter inside FreeType can be found here. Although these web pages are in need of an update, the basic principles of the autohinting process haven't changed. There is one exception: The autohinter no longer tries to provide good hinting for monochrome rasterization. Instead, it expects anti-aliasing with 256 gray levels, which became standard with Windows 98.

A scholarly paper published in the EuroTeX 2003 proceedings, titled Real-Time Grid Fitting of Typographic Outlines, gives further insight into the autohinting system's inner workings.

In the above links, one aspect of the autohinting process is missing: The various steps performed by the autohinter (called actions) can be described as high-level operations, for example “aligning a given edge to a given blue zone,” or “linking this edge to another one within a given distance.” The ttfautohint library hooks into these actions and transforms them into bytecode routines.

Similar to most TrueType hints, the autohint actions depend on the device resolution. Consequently, ttfautohint walks over a large range of ppem values (8 to 1000 ppem by default) and collects the actions as sets. A typical glyph outline needs three to four sets (covering the whole range), but sometimes more than ten are necessary.

Intentionally, ttfautohint adds hints only along the y-axis. The Anti-Grain research describes some of the reasons behind this decision. While the article is quite old, the mentioned ideas are still valid.

The ttfautohint library contains a copy of FreeType's ‘autofit’ module, reformatted and using a different function prefix, and with slight extensions for hooks into hinting actions. It therefore inherits the same dual-licensing as FreeType; you can choose between the GNU Public License (GPL) Version 2 and the FreeType License (FTL.)

Contact

Werner Lemberg (wl@gnu.org) is Technical Lead, and does all the programming. He is a professional classical musician and lives in Vienna, Austria.

Dave Crossland (dave@understandingfonts.com) is the Project Manager, and wrote and art directed the promotional video at the top of this page. He is a professional type designer and lives in London, England.

Andy Ellis (hello@fadeinfadeout.co.uk) designed and produced the promotion video. He is a professional motion graphic designer and lives in London, England.

Download

Current version: 0.7 (5nd February 2012)

Packages

Note: If you would like a package that is easy to install on all operating systems and has a Graphical User Interface which is easy to use, please donate now so that this work can be continued.

Windows
ttfautohint 0.7 (both command line and GUI)

Apple
ttfautohint 0.5 (thanks to Karsten Lücke for creating this; it has been compiled under OS X 10.5.8, but should run with version 10.7 also).

Source Code

Compile ttfautohint 0.2 for Mac OS X 10.6 – full instructions.

The latest source package of ttfautohint can be downloaded either from Savannah or from SourceForge.

All development takes places within a public git repository; see the repo.or.cz repository homepage for details.

Note: A prerequisite for compiling the library is FreeType version 2.4.5 or newer; see FreeType's download page for more information.