ttfautohint on OS X

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

Compilation With MacPorts

If you have MacPorts and are comfortable with it, you can install ttfautohint (together with libttfautohint) and ttfautohintGUI quite easily.

To install the ttfautohint command line executable, open Terminal.app and type

sudo port install ttfautohint

Enter your Mac login password, then press the return key again. This installs the currently released version.

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.

To install both the ttfautohint command line executable and the GUI version, use

sudo port install ttfautohint +qt5

instead of the above installation command. Enter your Mac login password, then press the return key again. This installs the currently released version using the Qt5 framework. If you want to use the Qt4 framework (for example, if you have a MacOS version that is not supported by Qt5), replace +qt5 with +qt4 in the above command.

After installation you can now type

ttfautohintGUI

from the Terminal app to start the GUI.

Compilation With Homebrew

Warning: Homebrew only supports recent MacOS versions (i.e., the current one and two older releases). For older MacOS versions please use MacPorts, see above.

If you have Homebrew and are comfortable with it, you can install ttfautohint (together with libttfautohint) and ttfautohintGUI quite easily.

ttfautohint only

If you do not need the GUI version of ttfautohint, you can install the ttfautohint command line executable 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.

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

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

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.

ttfautohint and ttfautohintGUI

If you need the GUI version of ttfautohint (which depends on the Qt library), you can't use core Homebrew's version. Instead, please use Cosimo Lupo's Homebrew Tap (i.e., a user's github repository). Calling

brew install anthrotype/ttfautohint/ttfautohintGUI

will both install ttfautohint and ttfautohintGUI. For the git HEAD version (i.e., the current development version) use

brew install --HEAD anthrotype/ttfautohint/ttfautohintGUI

instead.

If you want to switch from core Homebrew to Cosimo's tap, you should start with

brew uninstall ttfautohint

before installing from the tap to avoid interferences.

After installation you can now type

ttfautohintGUI

from the Terminal app to start the GUI.

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 or MacPorts, you should check out one of these two package managers because both are extremely useful and automate all ttfautohint build dependency installs for you. But supposing you don't want to use them, 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 https://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.11.0/freetype-2.11.0.tar.gz/download.

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

Open Terminal.app, type

cd ~/src/freetype-2.11.0

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 https://github.com/harfbuzz/harfbuzz/releases/download/2.9.0/harfbuzz-2.9.0.tar.xz.

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

Open Terminal.app, type

cd ~/src/harfbuzz-2.9.0

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 https://qt.io/download and install Qt in the normal way. Currently, a direct link is https://download.qt.io/official_releases/qt/5.12/5.12.11/qt-opensource-mac-x64-5.12.11.dmg.

[There are newer version of Qt 5 available, however, no .dmg files are provided. If you need them, follow the building instructions.]

[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 https://freetype.org/ttfautohint and in the download section, download the latest version of the source code. Currently the direct link is https://sourceforge.net/projects/freetype/files/ttfautohint/1.8.4/ttfautohint-1.8.4.tar.gz/download.

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

In Terminal, type

cd ~/src/ttfautohint-1.8.4

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: 21-Aug-2021