ttfautohint on OS X

This page describes how to compile both ttfautohint and ttfautohintGUI on Mac OS X.

Compilation With Homebrew

[Homebrew dropped active Qt4 support in summer 2016; the new option to activate Qt support for the ttfautohint brew formula is thus no longer --with-qt but --with-qt5, similar to other Homebrew packages that use Qt.]

If you have Homebrew and are comfortable with it, you can either install the current release of ttfautohint and ttfautohintGUI with

brew install ttfautohint --with-qt5

or git HEAD (i.e., the current development version) with

brew install --HEAD ttfautohint --with-qt5

Note that you need an up-to-date Homebrew version for this simple installation.

For upgrading ttfautohint from an older version, please follow the standard instructions given in the Homebrew FAQ. However, in case you want to update from an older --HEAD installation to current git HEAD, you have to use

brew reinstall --HEAD ttfautohint --with-qt5

instead of calling brew upgrade ttfautohint (cf. this homebrew tracker issue).

To start the GUI, you can now type

ttfautohintGUI

from the Terminal.

Compilation From Scratch

If you don't have Homebrew, you should check it out because it's extremely useful. But supposing you don't want to use it, you can install the GUI on Mac OS X from scratch.

Following the instructions below, everything except XCode and Qt gets installed into the ‘/usr/local/’ directory tree. You should thus prepend/usr/local/bin’ to your path now (so that the new programs and scripts get found before the system ones). See here, for example, how to do that easily. It is possible to change the default installation directory hierarchy, though; please read the generic GNU installation instructions for more.

XCode

We start by installing XCode from the App Store, and then the Command Line Tools. Instructions are at http://guide.macports.org/chunked/installing.html#installing.xcode.

pkg-config

Another preliminary is pkg-config, which is a helper tool to get library information for both compilation and linking.

Create a folder in your Home folder called ‘src’.

In your browser, download https://pkg-config.freedesktop.org/releases/pkg-config-0.29.1.tar.gz.

In Finder, go to your Downloads folder and double click the pkg-config-0.29.1.tar.gz file to unpack it into a folder named ‘pkg-config-0.29.1’. Move that folder now into the src folder you created in your Home folder.

Open Terminal.app, type

cd ~/src/pkg-config-0.29.1

and press the return key. Continue with

./configure

and press the return key again. You will see a bunch of text rolling through the Terminal app. When it is done, type

make

and press the return key to see more text rolling through. When it is done, type

sudo make install

and press the return key. Enter your Mac login password, then press the return key again.

FreeType

Next we install FreeType, the system that ttfautohint is based on.

In your browser, download https://sourceforge.net/projects/freetype/files/freetype2/2.7/freetype-2.7.tar.gz/download.

In Finder, go to your Downloads folder and double click the freetype-2.7.tar.gz file to unpack it into a folder named ‘freetype-2.7’. Move that folder now into the src folder you created in your Home folder.

Open Terminal.app, type

cd ~/src/freetype-2.7

and press the return key. Continue with

./configure

and press the return key again. You will see a bunch of text rolling through the Terminal app. When it is done, type

make

and press the return key to see more text rolling through. When it is done, type

sudo make install

and press the return key. Enter your Mac login password, then press the return key again.

HarfBuzz

This library is also used by ttfautohint to handle OpenType features in TrueType fonts.

In your browser, download http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.3.3.tar.bz2.

In Finder, go to your Downloads folder and double click the harfbuzz-1.3.3.tar.bz2 file to unpack it into a folder named ‘harfbuzz-1.3.3’. Move that folder now into the src folder you created in your Home folder.

Open Terminal.app, type

cd ~/src/harfbuzz-1.3.3

and press the return key. Continue with

./configure --with-glib=no

and press the return key again. You will see a bunch of text rolling through the Terminal app. When it is done, type

make

and press the return key to see more text rolling through. When it is done, type

sudo make install

and press the return key. Enter your Mac login password, then press the return key again.

[Note: For a complete installation of FreeType you should now compile and install FreeType again to make it use the most recent version of HarfBuzz. However, this is not necessary if you only want to build ttfautohint and nothing else.]

Qt

Now install the Qt libraries for making ttfautohint's Graphical User Interface.

With your browser, download the latest ‘Qt Libraries for Mac’ .dmg file from http://qt.io/download-open-source and install Qt in the normal way. Currently, a direct link is http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-mac-x64-clang-5.7.0.dmg.

[In case you need Qt 4, use https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-opensource-mac-4.8.7.dmg instead.]

ttfautohint

We are almost finished. Visit http://freetype.org/ttfautohint and in the download section, download the latest version of the source code. Currently the direct link is http://sourceforge.net/projects/freetype/files/ttfautohint/1.6/ttfautohint-1.6.tar.gz/download.

In Finder, go to your Downloads folder and double click the ttfautohint-1.6.tar.gz file to unpack it into a folder named ‘ttfautohint-1.6’. Move the ttfautohint-1.6 folder to the src folder in your Home folder.

In Terminal, type

cd ~/src/ttfautohint-1.6

and press the return key. Now type

./configure --with-doc=no

and press the return key again. You will see a bunch of text rolling through the Terminal app. When it is done, type

make

and press the return key. Again you will see a bunch of text rolling through the Terminal app. When it is done, type

sudo make install

followed by a press to the return key. As above, enter your Mac login password, then press the return key again. You will see a bunch of text rolling through the Terminal app. When it is done, type

ttfautohintGUI

and press the return key: You should now see the GUI!

This page is maintained by Werner Lemberg, based on instructions written by David Crossland.

Last update: 27-Nov-2016