A note on installing RoboFab from SVN for FontLab? Studio on OSX Leopard
Python 2.3.5 on Mac OSX Leopard
There is a special problem which occurs on Mac OSX Leopard in combination with FontLab? Studio and Python 2.3. In short: FontLab? Studio requires Python 2.3.5. Leopard ships with an up-to-date Python 2.5.1. But, fortunately, Apple also put the *framework* of Python 2.3.5 in the OS, but it can't be called from the commandline because a part is missing.
file
A different problem, this time in FontLab? Studio itself, makes it very difficult to run installer-like scripts in FontLab?. Normally, Python interpreters, embedded or regular, include a variable named file in the namespace, it contains the path to the file that's running. This allows scripts to find out where they are, and where they need to go. FontLab?'s Python interpreter does not have this file variable, hence scripts have no way of finding out from where they've been launched. That puts an end to installing things from within FontLab?.
These two issues combined make it very difficult to actually install any Python packages specifically for FontLab?. We can't use an external interpreter because it is missing, and we can't use the embedded interpreter because it misses an important variable.
What to do
The following steps describe a way to get things working. It's not entirely elegant, but that's how things go. So, assuming you already have a local copy of the robofab svn.
- Download and run the all-in-one installer from
- Look into /Library/Python? (so, not /Users/you/Library and also not /System/Library?)
- You will find two folders, 2.3 and 2.5. These folders are specially there to make it easier to install packages for Python.
- Open the 2.3 folder. It contains a folder named site-packages.
- Open site-packages. It will contains items such as:
- FontTools?
- FontTools?.pth
- Numeric
- Numeric.pth
- README
- robofab.pth
- RoboFab
- Delete or remove the RoboFab folder (it is not as fresh as the svn version), but leave the robofab.pth file. Do not touch the other files.
- Open robofab.pth in your favorite text editor. It will probably just say RoboFab
- Replace it with the path to where you keep the svn robofab. It will say something like this: /Users/you/svn.robofab.com/trunk/robofab/Lib
- Make sure the path points all the way to the Lib.
- Open FontLab? and test importing robofab in the Macro window: import robofab
- If no complaints show up, it works!
- If this gives you an ImportError? it's most likely that the path in the robofab.pth file is somehow wrong.
