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 install ttfautohint and ttfautohintGUI (together with libttfautohint) quite easily.

If you need the GUI version of ttfautohint (includes Qt dependency), use

brew install ttfautohint --with-qt5

to get the currently released version. For the git HEAD version (i.e., the current development version) use

brew install --HEAD ttfautohint --with-qt5

instead.

If you do not need the GUI version of ttfautohint, you can install the ttfautohint command line executable only with

brew install ttfautohint

to get the currently released version. For the git HEAD version (i.e., the current development version) use

brew install --HEAD ttfautohint

instead.

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

To upgrade 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

or

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 app.

You can execute the ttfautohint executable on the command line with

ttfautohint

followed by an appropriate set of arguments as detailed in the usage documentation.

Compilation From Scratch

A simple solution to automatically compile ttfautohint (but not ttfautohintGUI) is Chris Simpkins's ttfautohint-build script.

If you don't have Homebrew, you should check it out because it's extremely useful and automates all ttfautohint build dependency installs for you. But supposing you don't want to use it, you can install the command line executable ttfautohint and the ttfautohint 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.2.tar.gz.

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

Open Terminal.app, type

cd ~/src/pkg-config-0.29.2

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.9.1/freetype-2.9.1.tar.gz/download.

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

Open Terminal.app, type

cd ~/src/freetype-2.9.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.

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.8.4.tar.bz2.

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

Open Terminal.app, type

cd ~/src/harfbuzz-1.8.4

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

This step is optional and only required if you intend to install ttfautohintGUI (the GUI version of ttfautohint). These steps install the Qt libraries for ttfautohint's Graphical User Interface.

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

[In case you need Qt 4, use https://download.qt.io/archive/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.8.2/ttfautohint-1.8.2.tar.gz/download.

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

In Terminal, type

cd ~/src/ttfautohint-1.8.2

and press the return key.

To include the GUI version of ttfautohint in the installation, use the following command.

./configure --with-doc=no

To install only the ttfautohint command line executable (without the GUI version of ttfautohint), use the following command.

./configure --with-doc=no --with-qt=no

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.

For GUI installs, you can launch ttfautohintGUI by typing

ttfautohintGUI

After pressing the return key, you should now see the GUI!

You can execute the ttfautohint executable on the command line with

ttfautohint

followed by an appropriate set of arguments as detailed in the usage documentation.

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

Last update: 24-Jul-2018