Skip to content

Instantly share code, notes, and snippets.

@davelab6
Last active July 26, 2017 05:33
Show Gist options
  • Save davelab6/3783491 to your computer and use it in GitHub Desktop.
Save davelab6/3783491 to your computer and use it in GitHub Desktop.
How to install TTFAutohint 0.92

With HomeBrew

If you have Homebrew and are comfortable with it, you can run

brew edit ttfautohint;

and then replace the file with this one

require 'formula'

class Ttfautohint < Formula
  homepage 'http://www.freetype.org/ttfautohint'
  url 'http://download.savannah.gnu.org/releases/freetype/ttfautohint-0.95.tar.gz'
  sha1 '5039cf8af38283a2f70b8912a968dd1abde9836a'
  head 'git://repo.or.cz/ttfautohint.git'

  depends_on :freetype
  depends_on qt

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--with-doc=no"
    system "make install"
  end

  test do
    system "#{bin}/ttfautohintGUI", "-V"
  end
end

then simply run

brew install ttfautohint;

and then to run it with the gui, you can from Terminal type

ttfautohintGUI;

From Scratch

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

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

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

Create a folder in your Home folder called src

In your browser, download http://downloads.sourceforge.net/project/freetype/freetype2/2.5.0/freetype-2.5.0.1.tar.gz

In Finder, go to your Downloads folder and double click the freetype-2.5.0.1.tar.bz2 file to unpack it into a folder named freetype-2.5.0.1.

In Finder, rename the folder freetype-2.5.0.1 to freetype2 and then move that folder into the src folder you created in your Home folder.

Open Terminal.app and type

cd ~/src/freetype2;

Press the return key.

./configure;

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

make;

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

sudo make install;

Press the return key, then enter your Mac login password, then press the return key again.

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-project.org/downloads#qt-lib and install Qt in the normal way. Currently the direct link is http://releases.qt-project.org/qt4/source/qt-mac-opensource-4.8.2.dmg

Now 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/0.95/ttfautohint-0.95.tar.gz/download

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

In Terminal, type...

cd ~/src/ttfautohint-0.95;

Press the return key, and type...

./configure --without-doc;

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

make;

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

sudo make install;

Press the return key, then 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;

Press the return key, and you should now see the GUI!

:-)

@JDW1
Copy link

JDW1 commented Apr 11, 2013

You fail to mention that you will get an error during the "./configure -- without-doc;" of "ttfautohint-0.9x" if you do not already have MacPorts installed:

http://www.macports.org/install.php

Also, at the time of this writing (April 10, 2013), the latest version of ttfautohint is 0.95:

http://sourceforge.net/projects/freetype/files/ttfautohint/0.95/

@impallari
Copy link

I'm getting this error:
configure: error: Cannot find qmake. Try --with-qt=PATH.

@vernnobile
Copy link

Pablo - go to the Terminal app and type
ls /usr/bin/qmake*
look at the resulting output, is there a file called 'qmake-4.8' there? or some other version number?
You need to make a link from the qmake-4.8 binary to a file called just 'qmake'. Do this by entering this in Terminal app;
sudo ln -s /usr/bin/qmake-4.8 /usr/bin/qmake

There are a few other QT related binaries that need to be linked like this, one is 'moc'
so link in same way as above,
sudo ln -s /usr/bin/moc-4.8 /usr/bin/moc

any other QT binaries you need to link will show up as configure errors once you have fixed the qmake and moc links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment