Saturday, August 24, 2013

Setup Mountain Lion with the freetype-py library

Today wanted to start exploring how I'm going to create a generic representation of a character based on the fonts information. However since I have changed my laptop I need to get the framework setup again, so I'll describe the process here for future use.

I have a mountain lion mac (which I love), running v10.8.4. In order to run the freetype-py library, the freetype library needs to be installed, which in turn requires GNU Make. freetype-py is a python binding to the freetype library that is written in C. Since I don't want to write this in C unless I have to, I'll see if I can get everything I need from freetype-py. If not I may take a look at the Ruby binding for freetype: ft2-ruby.

So the steps were:

  1. Download GNU Make and run the configuration file. 
  2. Download FreeType.
  3. From the root of the freetype folder run the following commands (as described in this post):
  4. ./configure
    make
    sudo make install
  5. Download FreeType-py.
  6. From the freetype-py root directory run:
    python setup.py build
    python setup.py install
    To verify the system is setup correctly try entering the python shell and run:
    import freetype
    If no error occurs the installation of freetype and freetype-py was successful.
  7. Next I wanted to also install matplotlib so I can run the example I was interested in. For that I followed the installation steps describe here.
  8. Finally I was able to run the glyph-vector examples that display the use of outlines in the library!
Well, that only took way too many hours...

No comments:

Post a Comment